{"version":3,"file":"size-rollup-m-dom-max.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.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/frame-data.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.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/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/complex/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.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/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/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/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/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.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/resolve-start-time.mjs","../../motion-dom/dist/es/animation/utils/notify-inspector.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.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/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/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/animation/waapi/transforms/groups.mjs","../../motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.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/setters.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.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/dimensions.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-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/is-svg-element.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.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/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/resize/handle-element.mjs","../../motion-dom/dist/es/resize/handle-window.mjs","../../motion-dom/dist/es/resize/index.mjs","../../motion-dom/dist/es/value/utils/as-number.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/render/html/utils/render.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/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/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/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.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/styles/default-scale-correctors.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/features/load-features.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","../lib/components/LazyMotion/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/motion/features/layout.js","../lib/motion/features/animation/exit.js","../lib/motion/features/animations.js","../lib/motion/features/animation/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/dom/features-animation.js","../lib/render/dom/create-visual-element.js","../lib/gestures/focus.js","../lib/render/dom/features-max.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","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 () => this.remove(handler);\n }\n remove(handler) {\n 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 t is found for a given x with Newton-Raphson, safeguarded by a bisection\n bracket: whenever a Newton step would leave the bracket (near flat parts\n of the curve), it bisects instead. This converges to full precision in\n ~5 iterations on typical curves, so output is smooth rather than snapped\n to a fixed bisection grid. The slope is estimated with a forward\n difference, and the lookup table is omitted, to save bytes.\n\n x = 0 and x = 1 return exactly 0 and 1. x outside [0, 1] starts outside\n the bracket, so it bisects towards the nearer end and saturates to within\n ~1e-12 of 0 or 1.\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.\n// Bernstein form, so it is exactly 0 at t = 0 and exactly 1 at t = 1.\nconst calcBezier = (t, a1, a2) => t * (3 * (1 - t) * ((1 - t) * a1 + t * a2) + t * t);\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 return (x) => {\n let lowerBound = 0;\n let upperBound = 1;\n let t = x;\n for (let i = 0;; i++) {\n // If t is outside the bracket, because x is out of range or a\n // Newton step overshot where the slope is ~0, bisect instead.\n if (!(t >= lowerBound && t <= upperBound)) {\n t = (lowerBound + upperBound) / 2;\n }\n const currentX = calcBezier(t, mX1, mX2) - x;\n if (currentX * currentX < 1e-28 || i === 40)\n break;\n currentX > 0 ? (upperBound = t) : (lowerBound = t);\n // Newton-Raphson step, with dx/dt from a forward difference\n t -=\n (currentX * 1e-7) /\n (calcBezier(t + 1e-7, mX1, mX2) - x - currentX);\n }\n return calcBezier(t, mY1, mY2);\n };\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","/**\n * The frameloop's state, kept apart from the frameloop itself so that\n * reading it doesn't bundle the scheduler.\n */\nconst frameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n};\n\nexport { frameData };\n//# sourceMappingURL=frame-data.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame-data.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","// 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 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","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","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\n/**\n * Non-global copies of the token regexes so test() can use .test()\n * (no match array, stops at the first token) without lastIndex state.\n */\nconst hasFloat = /*@__PURE__*/ new RegExp(floatRegex.source);\nconst hasColor = /*@__PURE__*/ new RegExp(colorRegex.source, \"i\");\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (hasFloat.test(v) || hasColor.test(v)));\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`.\n// The lookahead skips digits in function names, like the 3 in matrix3d(.\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+)(?![a-z]*\\()/giu;\n/**\n * Whether analyseComplexValue(value) would find any values, without\n * tokenising the string. CSS variables are resolved before this is\n * used, so it's enough to look for a number or a color.\n */\nfunction hasComplexValues(value) {\n const asString = value.toString();\n return hasFloat.test(asString) || hasColor.test(asString);\n}\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, hasComplexValues };\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","// 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 if (!type) {\n warning(false, `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n return false;\n }\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 { sanitize } from '../../value/types/utils/sanitize.mjs';\nimport { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\n/**\n * A single number with an optional unit, e.g. \"50%\", \"-10px\", \".5em\".\n * Exponents don't match, so they fall through to the complex mixer.\n */\nconst unitValue = /^(-?(?:\\d+(?:\\.\\d*)?|\\.\\d+))([a-z%]*)$/iu;\n/**\n * Most CSS values Motion mixes are a single number with a unit. Mixing\n * these directly produces the same output as the complex mixer\n * (\"25%\", \"0.33333px\") without tokenising both strings.\n */\nfunction mixUnit(from, to) {\n const a = unitValue.exec(from);\n if (!a)\n return;\n const b = unitValue.exec(to);\n if (!b || a[2] !== b[2])\n return;\n const unit = a[2];\n const origin = parseFloat(a[1]);\n const target = parseFloat(b[1]);\n return (p) => sanitize(mixNumber(origin, target, p)) + unit;\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 if (typeof from === \"string\" && typeof to === \"string\") {\n const mixer = mixUnit(from, to);\n if (mixer)\n return mixer;\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.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, state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n}) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\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 * A keepAlive process is always also held by a frame queue until\n * it's cancelled, so a Set has the same lifetime semantics as a\n * WeakSet here while being considerably faster to query every frame.\n */\n const toKeepAlive = new Set();\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 nextFrame.add(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';\nimport { frameData } from './frame-data.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true, frameData);\n\nexport { cancelFrame, frame, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData } from '../../frameloop/frame-data.mjs';\nimport { 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, timeStep = 50, maxDuration = maxGeneratorDuration, keyframes) {\n let duration = 0;\n let state = generator.next(duration);\n keyframes?.push(state.value);\n while (!state.done && duration < maxDuration) {\n duration += timeStep;\n state = generator.next(duration);\n keyframes?.push(state.value);\n }\n return duration >= maxDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { millisecondsToSeconds, secondsToMilliseconds, warning, clamp } 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 // 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};\n/**\n * Maps bounce to a damping ratio as SwiftUI does: 0 is critically damped, and\n * it approaches undamped towards 1 and infinitely overdamped towards -1. Both\n * ends are limited so the spring still moves and settles.\n */\nconst bounceToDampingRatio = (bounce) => bounce < 0\n ? 1 / Math.max(1 + bounce, springDefaults.minDamping)\n : Math.max(1 - bounce, springDefaults.minDamping);\n/**\n * Scales an overdamped spring's undamped frequency so that, at its defining\n * time, it has as far left to go as the critically damped spring that's\n * criticalFreqTime radians in by then. A negative bounce then changes the\n * shape of the curve, not when it arrives. 1 at a damping ratio of 1, so\n * there's no jump at a bounce of 0.\n *\n * Solved by Newton on the remaining distance (times fast - slow), which is\n * convex from criticalFreqTime onwards. criticalFreqTime is always below the\n * answer, so it converges from below without overshooting.\n */\nfunction overdampedFreqScale(dampingRatio, criticalFreqTime) {\n if (!(dampingRatio > 1))\n return 1;\n const root = Math.sqrt(dampingRatio * dampingRatio - 1);\n const slow = dampingRatio - root;\n const fast = dampingRatio + root;\n const target = 2 * root * Math.exp(-criticalFreqTime) * (1 + criticalFreqTime);\n return (approximateRoot((freqTime) => fast * Math.exp(-slow * freqTime) -\n slow * Math.exp(-fast * freqTime) -\n target, (freqTime) => Math.exp(-fast * freqTime) - Math.exp(-slow * freqTime), criticalFreqTime) / criticalFreqTime);\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;\n/**\n * Assumes zero initial velocity and the default mass: time-defined springs\n * ignore inherited velocity and only resolve without valid physics. Returns\n * NaN physics when the root search doesn't converge.\n */\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n const dampingRatio = bounceToDampingRatio(bounce);\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 b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (exponentialDecay / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const e = dampingRatio *\n dampingRatio *\n undampedFreq *\n undampedFreq *\n duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(undampedFreq * undampedFreq, dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * -e * f) / g;\n };\n }\n else {\n /**\n * Critically-damped spring. Overdamped springs reuse this root,\n * scaled below.\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = undampedFreq * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = -undampedFreq * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const criticalFreq = approximateRoot(envelope, derivative, initialGuess);\n const undampedFreq = criticalFreq *\n overdampedFreqScale(dampingRatio, criticalFreq * duration);\n const stiffness = undampedFreq * undampedFreq;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(stiffness),\n duration: secondsToMilliseconds(duration),\n };\n}\n/**\n * Spring physics must be finite. stiffness and mass are also divisors so must\n * be positive, whereas a damping of 0 is a valid, perpetually oscillating\n * spring. Relational rather than Number.isFinite so numeric strings still\n * coerce.\n */\nconst isValidPhysics = (value, canBeZero) => (canBeZero ? value >= 0 : value > 0) && value < Infinity;\n/**\n * Returns value if it's usable spring physics, otherwise undefined so callers\n * fall back to the default. An explicit `undefined`, e.g. from a forwarded\n * optional prop, must fall back too. Invalid physics would otherwise resolve\n * to NaN spring values that never report done.\n */\nfunction resolvePhysics(value, canBeZero) {\n if (isValidPhysics(value, canBeZero))\n return value;\n if (process.env.NODE_ENV !== \"production\") {\n warning(value === undefined, \"Spring stiffness and mass must be positive, damping 0 or greater\", \"spring-invalid-physics\");\n }\n return undefined;\n}\nfunction getSpringOptions(options) {\n /**\n * Resolve physics before choosing between physics- and duration-based\n * resolution, so an invalid stiffness doesn't also silently discard a\n * valid duration/bounce.\n */\n const validStiffness = resolvePhysics(options.stiffness);\n const validDamping = resolvePhysics(options.damping, true);\n const validMass = resolvePhysics(options.mass);\n const springOptions = {\n ...options,\n stiffness: validStiffness ?? springDefaults.stiffness,\n damping: validDamping ?? springDefaults.damping,\n mass: validMass ?? springDefaults.mass,\n isResolvedFromDuration: false,\n // stiffness/damping/mass overrides duration/bounce\n isTimeDefined: (validStiffness ?? validDamping ?? validMass) === undefined &&\n (options.duration !== undefined || options.bounce !== undefined),\n };\n if (springOptions.isTimeDefined) {\n if (options.visualDuration) {\n const dampingRatio = bounceToDampingRatio(options.bounce || 0);\n const root = ((2 * Math.PI) / (options.visualDuration * 1.2)) *\n overdampedFreqScale(dampingRatio, (2 * Math.PI) / 1.2);\n springOptions.stiffness = root * root;\n springOptions.damping =\n 2 * dampingRatio * Math.sqrt(springOptions.stiffness);\n }\n else {\n Object.assign(springOptions, findSpring(springOptions));\n springOptions.isResolvedFromDuration = true;\n }\n /**\n * Time options can degenerate: a NaN bounce gives a NaN damping, an\n * infinite visualDuration a 0 stiffness, and findSpring NaN for both\n * when it doesn't converge. Replace the two together, so the\n * relationship duration resolution establishes between them is never\n * left half-overwritten.\n */\n if (!isValidPhysics(springOptions.stiffness) ||\n !isValidPhysics(springOptions.damping, true)) {\n springOptions.stiffness = springDefaults.stiffness;\n springOptions.damping = springDefaults.damping;\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 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, isResolvedFromDuration, isTimeDefined, } = getSpringOptions({ ...options });\n /**\n * Time-defined springs ignore inherited velocity. Velocity from\n * interrupted animations causes massive oscillation on small-range\n * animations.\n */\n const inheritVelocity = (velocity) => isTimeDefined ? 0 : -millisecondsToSeconds(velocity);\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n const decay = dampingRatio * undampedAngularFreq;\n /**\n * Everything that changes when the spring is retargeted: written by\n * retarget() and update(), read by the resolvers. Grouped on one object,\n * like the coefficients (c) below. Writing doubles to object fields\n * measured marginally faster than to captured let variables in optimised\n * code; neither allocates, so this is a grouping choice, not a GC one.\n */\n const s = {\n target,\n delta: target - origin,\n velocity: inheritVelocity(options.velocity || 0) || 0,\n restSpeed: 0,\n restDelta: 0,\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 empirically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const setRestThresholds = () => {\n const isGranularScale = Math.abs(s.delta) < 5;\n s.restSpeed =\n options.restSpeed ||\n (isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n s.restDelta =\n options.restDelta ||\n (isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n };\n setRestThresholds();\n let resolveSpring;\n let resolveVelocity;\n /**\n * Derives the coefficients that depend on origin, target and initial\n * velocity. Called once now and again whenever the spring is retargeted.\n */\n let update;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n /**\n * A is the position coefficient, sinC/cosC the coefficients of the\n * analytical derivative (px/ms). The exp/sin/cos terms depend only\n * on t, so they're memoized by t independently of the target: a\n * spring retargeted every frame samples the same t each frame and\n * skips the transcendentals entirely.\n */\n const c = { A: 0, sinC: 0, cosC: 0, t: -1, env: 0, sin: 0, cos: 0 };\n update = () => {\n c.A = (s.velocity + decay * s.delta) / angularFreq;\n c.sinC = decay * c.A + s.delta * angularFreq;\n c.cosC = decay * s.delta - c.A * angularFreq;\n };\n const sample = (t) => {\n if (t !== c.t) {\n c.t = t;\n c.env = Math.exp(-decay * t);\n c.sin = Math.sin(angularFreq * t);\n c.cos = Math.cos(angularFreq * t);\n }\n };\n // Underdamped spring\n resolveSpring = (t) => {\n sample(t);\n return s.target - c.env * (c.A * c.sin + s.delta * c.cos);\n };\n resolveVelocity = (t) => {\n sample(t);\n return c.env * (c.sinC * c.sin + c.cosC * c.cos);\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => s.target -\n Math.exp(-undampedAngularFreq * t) *\n (s.delta + (s.velocity + undampedAngularFreq * s.delta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const c = { C: 0 };\n update = () => {\n c.C = s.velocity + undampedAngularFreq * s.delta;\n };\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * c.C * t - s.velocity);\n }\n else {\n /**\n * Overdamped spring: the sum of a slow and a fast decaying\n * exponential, so no term can overflow however heavily it's damped.\n */\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n const slow = decay - dampedAngularFreq;\n const fast = decay + dampedAngularFreq;\n /**\n * Physics-defined springs keep a non-physical limit: once\n * dampedAngularFreq * t passes 300, both terms decay at the damping\n * rate. Heavily overdamped drag springs (dragElastic: 0,\n * dragTransition) rely on this to settle almost at once rather than\n * creep at stiffness / damping. Negative bounce needs the exact\n * curve, so time-defined springs are exempt.\n */\n const limit = isTimeDefined ? Infinity : 300 / dampedAngularFreq;\n const decayAt = (rate, t) => Math.exp(t > limit ? -rate * limit - decay * (t - limit) : -rate * t);\n const c = { S: 0, F: 0 };\n update = () => {\n const P = (s.velocity + decay * s.delta) / dampedAngularFreq;\n c.S = (s.delta + P) / 2;\n c.F = (s.delta - P) / 2;\n };\n resolveSpring = (t) => s.target - c.S * decayAt(slow, t) - c.F * decayAt(fast, t);\n // Analytical derivative of overdamped spring (px/ms)\n resolveVelocity = (t) => slow * c.S * decayAt(slow, t) + fast * c.F * decayAt(fast, t);\n }\n update();\n const calculatedDuration = isResolvedFromDuration ? duration || null : null;\n const generator = {\n calculatedDuration,\n /**\n * Aim the spring at a new target from its current position and\n * velocity, reusing the resolved physics and closures.\n */\n retarget: (keyframes, newVelocity) => {\n s.target = keyframes[keyframes.length - 1];\n s.delta = s.target - keyframes[0];\n s.velocity = inheritVelocity(newVelocity);\n // Default thresholds depend on the scale of the new delta\n if (!(options.restSpeed && options.restDelta))\n setRestThresholds();\n // Invalidate any duration lazily cached by JSAnimation\n generator.calculatedDuration = calculatedDuration;\n state.done = false;\n update();\n },\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= s.restSpeed &&\n Math.abs(s.target - current) <= s.restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? s.target : current;\n return state;\n },\n toString: () => {\n const easingDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(easingDuration * progress).value, easingDuration, 30);\n return easingDuration + \"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 { spring } from './spring.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) => v < min || 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 applyFriction = (t) => {\n const delta = calcDelta(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : target + delta;\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 /**\n * The friction curve is target + calcDelta(t), so its exact\n * derivative is -calcDelta(t) / timeConstant in units/ms,\n * converted here to the units/second expected by spring.\n */\n velocity: (-calcDelta(t) / timeConstant) * 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, MotionGlobalConfig, clamp } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { mix } from '../../utils/mix/index.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) || easeInOut;\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 * Fast setup path for two keyframes one easing.\n */\n if (keyframeValues.length === 2 &&\n !Array.isArray(easingFunctions) &&\n (!times ||\n times.length !== 2 ||\n (times[0] === 0 && times[1] === 1))) {\n const [origin, target] = keyframeValues;\n const mixer = origin === target\n ? undefined\n : (MotionGlobalConfig.mix || mix)(origin, target);\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mixer\n ? mixer(easingFunctions(duration > 0 ? clamp(0, 1, t / duration) : 1))\n : target;\n state.done = t >= duration;\n return state;\n },\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), 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","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 /**\n * The easing is generated over 0 - scale, but velocity is in the\n * value's own units, so scale it to match. Otherwise an interrupted\n * spring hands off the wrong speed, or direction. Keyframes with\n * units (colours, filters, mixed units) give NaN, which is falsy,\n * so their velocity passes through unscaled.\n */\n const { keyframes: k, velocity: v } = options;\n const delta = k && k[k.length - 1] - k[0];\n const generator = createGenerator({\n ...options,\n velocity: v && delta ? (v * scale) / delta : v,\n keyframes: [0, scale],\n });\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/**\n * A generator's velocity at time t in units/second: analytical where the\n * generator provides it (springs), otherwise by finite difference. Before\n * the animation has started this is its initial velocity.\n */\nfunction calcGeneratorVelocity(generator, t, initialVelocity = 0) {\n if (t <= 0)\n return initialVelocity;\n return generator.velocity\n ? generator.velocity(t)\n : getGeneratorVelocity((s) => generator.next(s).value, t, generator.next(t).value);\n}\n\nexport { calcGeneratorVelocity, getGeneratorVelocity };\n//# sourceMappingURL=velocity.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","import { MotionGlobalConfig } from 'motion-utils';\n\n/**\n * If an animation's keyframes resolve, or its first frame renders, more than\n * this long after its start time, it starts from then instead. While we prefer\n * to \"start\" an animation as soon as it's triggered, this avoids a visual jump\n * into it after main thread work.\n *\n * Manual timing steps frames by however long it likes, so never lags.\n */\nconst MAX_START_DELAY = 40;\nconst resolveStartTime = (startTime, now) => now - startTime > MAX_START_DELAY && !MotionGlobalConfig.useManualTiming\n ? now\n : startTime;\n\nexport { resolveStartTime };\n//# sourceMappingURL=resolve-start-time.mjs.map\n","import { frameData } from '../../frameloop/frame-data.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\n\nfunction baseRecord(kind, animation) {\n return {\n kind,\n animation,\n timestamp: time.now(),\n frameTimestamp: frameData.timestamp,\n frameIsProcessing: frameData.isProcessing,\n };\n}\n/**\n * Notify an optional inspector without adding a public Motion API.\n *\n * The record is a raw firehose: the live animation handle, the concrete\n * animation's internal options object untouched (timing fields in\n * internal milliseconds, name/keyframes/element/motionValue still\n * attached), a timestamp and the raw frameloop state at notify time.\n * All interpretation belongs to the consumer behind\n * globalThis.__MOTION_INSPECT__.\n */\nfunction notifyAnimationStart(animation, options, transition) {\n const notify = globalThis.__MOTION_INSPECT__;\n if (!notify)\n return;\n try {\n notify({\n ...baseRecord(\"animation-start\", animation),\n options: transition ? { ...options, ...transition } : options,\n });\n }\n catch { }\n}\n/**\n * Layout animations drive a projection node's progress rather than a\n * property, so the record forwards the live node itself: it carries the\n * DOM instance, the layout options (layoutId) and the progress handle.\n * Fired inside the frame.update that starts the animation, so nodes\n * animating in the same layout commit share frameTimestamp.\n */\nfunction notifyLayoutAnimationStart(animation, node) {\n const notify = globalThis.__MOTION_INSPECT__;\n if (!notify)\n return;\n try {\n notify({\n ...baseRecord(\"layout-animation-start\", animation),\n node,\n });\n }\n catch { }\n}\n\nexport { notifyAnimationStart, notifyLayoutAnimationStart };\n//# sourceMappingURL=notify-inspector.mjs.map\n","class WithPromise {\n constructor() {\n this.isResolved = false;\n }\n get finished() {\n if (!this._finished) {\n this._finished = this.isResolved\n ? Promise.resolve()\n : new Promise((resolve) => {\n this._resolve = resolve;\n });\n }\n return this._finished;\n }\n updateFinished() {\n this._finished = this._resolve = undefined;\n this.isResolved = false;\n }\n notifyFinished() {\n this.isResolved = true;\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 { calcGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nconst round = (value) => Math.round(value * 10000) / 10000;\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 notifyAnimationStart(this, this.options);\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(keyframes$1 === options.keyframes\n ? options\n : { ...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, calculatedDuration } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, type, onUpdate, finalKeyframe, } = this.options;\n if (this.startTime === this.pendingStartTime) {\n this.startTime = resolveStartTime(this.startTime, timestamp);\n }\n this.pendingStartTime = undefined;\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 const state = this.generate(this.currentTime, isInDelayPhase);\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 * This animation's time, including delay, at a timestamp.\n */\n at(timestamp) {\n return (this.holdTime ??\n round((timestamp - this.startTime) * this.playbackSpeed));\n }\n /**\n * The value at a timestamp, without changing this animation's state.\n * If resolved, it ends at the last resolved keyframe, which is in the\n * same unit as the others, rather than at finalKeyframe.\n */\n sampleAt(timestamp, resolved) {\n const { options, totalDuration } = this;\n const t = this.at(timestamp) - (options.delay || 0);\n return t >= totalDuration && options.type !== inertia\n ? getFinalKeyframe(options.keyframes, options, resolved ? undefined : options.finalKeyframe)\n : this.generate(Math.max(t, 0), t < 0).value;\n }\n /**\n * The generator's state `currentTime` ms after the delay, without\n * changing the animation's own state.\n */\n generate(currentTime, isInDelayPhase) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, } = this;\n const { keyframes, repeat, repeatType, repeatDelay } = this.options;\n let elapsed = 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(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 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 return calcGeneratorVelocity(this.generator, this.currentTime, this.options.velocity);\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 / (this.playbackSpeed || 1);\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? (this.pendingStartTime = 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, round };\n//# sourceMappingURL=JSAnimation.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","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 scaleZ: () => 1,\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.hypot(v[0], v[1]);\nconst scaleY = (v) => Math.hypot(v[4], 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 scaleZ: (v) => Math.hypot(v[8], v[9], v[10]),\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 \"scaleZ\",\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));\n/**\n * Reset any bounding box-changing transforms so the element can be\n * measured. Returns the values to restore. Values already at their\n * default don't change the box, so they're left alone: an element with\n * only `rotate: 0` doesn't need to be re-rendered before measuring.\n */\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n const current = value.get();\n const reset = key.startsWith(\"scale\") ? 1 : 0;\n if (current === reset)\n return;\n removedTransforms.push([key, current]);\n value.set(reset);\n }\n });\n return removedTransforms;\n}\n/**\n * Values that can only be measured from the bounding box. Elements with\n * these values need bounding box-changing transforms removed first.\n */\nconst boxDependentValues = new Set([\"bottom\", \"right\"]);\n/**\n * Computed width/height is already in pixels and unaffected by\n * transforms. It's \"auto\" for elements without a layout box (e.g. inline),\n * in which case we fall back to measuring the bounding box.\n */\nfunction measureDimension(computed, measureBox, axis, paddingStart, paddingEnd, boxSizing) {\n const px = parseFloat(computed);\n if (!isNaN(px))\n return px;\n const { min, max } = measureBox()[axis];\n const size = max - min;\n return boxSizing === \"border-box\"\n ? size\n : size - parseFloat(paddingStart) - parseFloat(paddingEnd);\n}\nconst positionalValues = {\n // Dimensions\n width: ({ width, paddingLeft = \"0\", paddingRight = \"0\", boxSizing }, measureBox) => measureDimension(width, measureBox, \"x\", paddingLeft, paddingRight, boxSizing),\n height: ({ height, paddingTop = \"0\", paddingBottom = \"0\", boxSizing }, measureBox) => measureDimension(height, measureBox, \"y\", paddingTop, paddingBottom, boxSizing),\n top: ({ top }) => parseFloat(top),\n left: ({ left }) => parseFloat(left),\n bottom: ({ top }, measureBox) => {\n const { y } = measureBox();\n return parseFloat(top) + (y.max - y.min);\n },\n right: ({ left }, measureBox) => {\n const { x } = measureBox();\n return parseFloat(left) + (x.max - x.min);\n },\n // Transform\n x: ({ transform }) => parseValueFromTransform(transform, \"x\"),\n y: ({ transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { boxDependentValues, isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { isNumericalString, isZeroValueString } from 'motion-utils';\nimport { complex } from '../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../value/types/utils/animatable-none.mjs';\nimport { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { boxDependentValues, 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 = [];\n const elementsToMeasure = new Set();\n const elementsToUntransform = new Set();\n toResolve.forEach((resolver) => {\n if (!resolver.needsMeasurement)\n return;\n resolversToMeasure.push(resolver);\n elementsToMeasure.add(resolver.element);\n if (boxDependentValues.has(resolver.name)) {\n elementsToUntransform.add(resolver.element);\n }\n });\n const transformsToRestore = new Map();\n /**\n * Write pass\n * Values measured from the bounding box need bounding box-changing\n * transforms removed first. Values read from computed style don't.\n */\n elementsToUntransform.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}\n/**\n * Normalise a value read from the subject into an animation origin: a\n * number read as a string (\"0\", \"200\") becomes a number, and a value\n * that isn't animatable (e.g. \"none\") but whose target is becomes an\n * animatable zero in the shape of the target.\n */\nfunction readOrigin(value, name, target) {\n if (typeof value === \"string\") {\n if (isNumericalString(value) || isZeroValueString(value)) {\n return parseFloat(value);\n }\n else if (!complex.test(value) && complex.test(target)) {\n return getAnimatableNone(name, target);\n }\n }\n return value ?? undefined;\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 = readOrigin(element.readValue(name, finalKeyframe), name, finalKeyframe);\n if (valueAsRead !== undefined) {\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 { notifyAnimationStart } from './utils/notify-inspector.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 notifyAnimationStart(this, options, transition);\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, onAttach, 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 onAttach?.(this.animation);\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 * The animation's time now, in ms. Wall-clock rather than WAAPI's\n * currentTime while running, as under CPU load currentTime may not\n * reflect the actual elapsed time, causing incorrect sampling and\n * visual jumps.\n */\n elapsed() {\n return this.state === \"running\"\n ? (time.now() - this.startTime) * this.speed\n : this.time * 1000;\n }\n /**\n * The value at a time, from a renderless JS animation.\n */\n sample(sampleTime) {\n if (!this.sampler) {\n const { motionValue, onUpdate, onComplete, onPlay, onStop, element, ...options } = this.options;\n /**\n * Stop it straight away so its driver doesn't run every frame.\n * It can still be sampled.\n */\n this.sampler = new JSAnimation({ ...options, autoplay: false });\n this.sampler.stop();\n }\n return this.sampler.sample(Math.max(0, sampleTime)).value;\n }\n /**\n * The value now, as WAAPI doesn't set the motion value while it runs.\n */\n liveValue() {\n const { state } = this;\n if (state === \"running\" || state === \"paused\") {\n return this.sample(this.elapsed());\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 * sample a renderless JS animation twice to calculate its current\n * value, \"previous\" value, and therefore allow Motion to calculate\n * velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, element, name } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const { speed } = this;\n const sampleTime = this.elapsed();\n const delta = this.state === \"running\" && speed\n ? clamp(0, sampleDelta, sampleTime)\n : 0;\n const current = this.sample(sampleTime);\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 if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(this.sample(sampleTime - delta * Math.sign(speed)), current, delta / Math.abs(speed || 1));\n }\n}\n\nexport { NativeAnimationExtended, sampleDelta };\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 /**\n * Most values can't be accelerated at all, so check the name before\n * looking at the element or its props.\n */\n if (!name ||\n !(acceleratedValues.has(name) || colorProperties.has(name))) {\n return false;\n }\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 /**\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, supportsWaapi };\n//# sourceMappingURL=waapi.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 { 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, translateAlias };\n//# sourceMappingURL=build-transform.mjs.map\n","const transformGroups = new WeakMap();\n\nexport { transformGroups };\n//# sourceMappingURL=groups.mjs.map\n","import { isBezierDefinition, millisecondsToSeconds, clamp, progress } from 'motion-utils';\nimport { frame } from '../../../frameloop/frame.mjs';\nimport { frameData } from '../../../frameloop/frame-data.mjs';\nimport { time } from '../../../frameloop/sync-time.mjs';\nimport { buildTransform, translateAlias } from '../../../render/html/utils/build-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { frameloopDriver } from '../../drivers/frame.mjs';\nimport { keyframes } from '../../generators/keyframes.mjs';\nimport { defaultOffset } from '../../keyframes/offsets/default.mjs';\nimport { JSAnimation, round } from '../../JSAnimation.mjs';\nimport { sampleDelta } from '../../NativeAnimationExtended.mjs';\nimport { cubicBezierAsString } from '../easing/cubic-bezier.mjs';\nimport { supportedWaapiEasing } from '../easing/supported.mjs';\nimport { supportsWaapi } from '../supports/waapi.mjs';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { transformGroups } from './groups.mjs';\n\n/**\n * Sample at the interruption sampling rate, up to a cap for long\n * animations.\n */\nconst maxSamples = 200;\n/**\n * How far values may stray from the WAAPI animation: as a fraction of\n * each value's change when they share an easing, otherwise in px or deg,\n * or for scale.\n */\nconst easingTolerance = 0.001;\nconst sampleTolerance = 0.1;\nconst scaleTolerance = 0.001;\n/**\n * If an outside write, or a seek the WAAPI animation can't follow,\n * happens again within this window, the group is being driven every\n * frame (scrubbing, drag), which is cheaper on the main thread than\n * rebuilding the WAAPI animation every frame.\n */\nconst churnWindow = 100;\n/**\n * Named easings that are the same cubic-bezier in JS and CSS.\n */\nconst isNativeEasing = (ease) => /^(linear|ease(In|Out|InOut))$/.test(ease);\nconst byTime = (a, b) => a - b;\n/**\n * n + 1 evenly spaced timestamps, from one timestamp to another.\n */\nconst spread = (from, to, n) => {\n const result = [];\n for (let i = 0; i <= n; i++)\n result.push(mixNumber(from, to, i / n));\n return result;\n};\nconst getOwner = (options) => options.motionValue.owner;\nconst getGroup = (element) => transformGroups.get(element);\nconst read = (owner, key) => owner.latestValues ? owner.latestValues[key] : owner.getValue(key)?.get();\n/**\n * Whether this animation should join its element's transform group.\n * Animations that can't be accelerated still join, so the group knows\n * to stay on the main thread while they run. Browsers without linear()\n * easing stay on the main thread.\n */\nconst canGroupTransform = ({ name, motionValue, }) => name &&\n transformPropOrder.includes(name) &&\n motionValue?.owner?.current instanceof HTMLElement &&\n supportsWaapi() &&\n supportsLinearEasing();\nfunction canAccelerateTransform(options) {\n const owner = getOwner(options);\n const { onUpdate, transformTemplate } = owner.getProps();\n return (\n /**\n * A handoff from an optimised appear animation is already running\n * on its own WAAPI animation. onUpdate needs every value, every\n * frame.\n */\n !options.isHandoff &&\n !onUpdate &&\n !options.hasOnUpdate &&\n /**\n * transformTemplate could output anything.\n */\n !transformTemplate &&\n options.type !== \"inertia\" &&\n /**\n * A literal transform, or pathRotation, replaces or adds to the\n * transform we'd build. styleEffect builds its own as \"none\".\n */\n (read(owner, \"transform\") || \"none\") === \"none\" &&\n !read(owner, \"pathRotation\") &&\n /**\n * Layout animations write transform every frame.\n */\n !owner.projection?.isProjecting());\n}\nclass TransformAnimation extends JSAnimation {\n constructor(options) {\n const element = getOwner(options).current;\n const { driver = frameloopDriver } = options;\n let animation;\n /**\n * Before JSAnimation replaces the type with its generator.\n */\n const canAccelerate = canAccelerateTransform(options);\n /**\n * The driver ticks on the main thread only once the group has\n * moved there. Until then, starting or stopping tells the group to\n * update its WAAPI animation.\n */\n options.driver = (update) => {\n const js = driver(update);\n return {\n js,\n now: js.now,\n start: (keepAlive = true) => {\n const group = getGroup(element);\n const isJS = !group || group.isJS;\n /**\n * keepAlive is false when seeking. Seeking the WAAPI\n * animation is free, but if a seek needs a rebuild and\n * keeps happening, the group moves to the main thread.\n */\n isJS\n ? js.start(keepAlive)\n : group.schedule(false, !keepAlive);\n },\n stop: () => {\n js.stop();\n const group = getGroup(element);\n group && !group.isFinishing && group.release(animation);\n },\n };\n };\n super(options);\n animation = this;\n this.canAccelerate = canAccelerate;\n /**\n * stop is bound in JSAnimation, so wrap it rather than override.\n * Before stopping, set the motion value to where the WAAPI\n * animation is now, with velocity, for the next animation to\n * start from.\n */\n const { stop } = this;\n this.stop = () => {\n this.isAccelerated() && this.sync();\n stop();\n };\n }\n get group() {\n return getGroup(getOwner(this.options).current);\n }\n get js() {\n return this.driver?.js;\n }\n get name() {\n return this.options.name;\n }\n /**\n * When this stops moving, or, if it repeats forever, when it starts\n * repeating, and how long each repeat takes. Held (paused, or at\n * speed 0) animations never stop moving.\n */\n timing() {\n const { startTime, speed, totalDuration } = this;\n const { delay = 0, repeatType } = this.options;\n return this.holdTime !== null\n ? [Infinity, 0]\n : totalDuration === Infinity\n ? [\n startTime + delay / speed,\n (this.resolvedDuration * (repeatType === \"loop\" ? 1 : 2)) /\n speed || 1,\n ]\n : [startTime + (delay + totalDuration) / speed, 0];\n }\n /**\n * Whether this is running, or paused, on the compositor.\n */\n isAccelerated() {\n const { group, state } = this;\n return (group?.tracks.has(this) &&\n !group.isJS &&\n this.canAccelerate &&\n (state === \"running\" || state === \"paused\"));\n }\n /**\n * The value now, while this runs on the compositor and so doesn't\n * set its motion value every frame.\n */\n liveValue() {\n return this.isAccelerated() ? this.sampleAt(time.now()) : undefined;\n }\n /**\n * If this is a two-keyframe tween whose easing WAAPI runs exactly,\n * when it starts and stops moving, and that easing.\n */\n tween() {\n const { keyframes: keyframes$1, type, ease, times, repeat, delay = 0 } = this.options;\n const easing = isBezierDefinition(ease)\n ? cubicBezierAsString(ease)\n : isNativeEasing(ease) && supportedWaapiEasing[ease];\n if (easing &&\n !repeat &&\n !times &&\n keyframes$1.length === 2 &&\n type === keyframes &&\n this.holdTime === null) {\n const start = this.startTime + delay / this.speed;\n return [start, start + this.resolvedDuration / this.speed, easing];\n }\n }\n /**\n * The timestamps between two timestamps where this reaches a\n * keyframe or starts a repeat, where it can turn or jump.\n */\n boundaries(from, to) {\n const { startTime, speed, resolvedDuration, options } = this;\n const { delay = 0, repeat = 0, repeatDelay = 0, repeatType, times, keyframes: keyframes$1, type, } = options;\n const offsets = (type || keyframes) === keyframes\n ? times || defaultOffset(keyframes$1)\n : [0, 1];\n const start = startTime + delay / speed;\n const result = [];\n if (this.holdTime !== null || !(resolvedDuration > 0))\n return result;\n for (let i = Math.max(0, Math.floor(((from - start) * speed) / resolvedDuration)); i <= repeat; i++) {\n const iterationStart = start + (i * resolvedDuration) / speed;\n if (iterationStart > to)\n break;\n for (const offset of offsets) {\n const t = iterationStart +\n ((i % 2 && repeatType && repeatType !== \"loop\"\n ? 1 - offset\n : offset) *\n (resolvedDuration - repeatDelay)) /\n speed;\n t > from && t < to && result.push(t);\n }\n }\n return result;\n }\n /**\n * The value at a timestamp, as a number.\n */\n numberAt(timestamp) {\n return parseFloat(this.sampleAt(timestamp, true));\n }\n /**\n * Write the current value, and velocity, to the motion value.\n */\n sync() {\n const now = time.now();\n this.options.motionValue.setWithVelocity(this.sampleAt(now - sampleDelta, true), this.sampleAt(now, true), sampleDelta);\n }\n play() {\n /**\n * A stopped animation (one that was interrupted) can't play again,\n * so it mustn't join the group.\n */\n if (this.isStopped)\n return;\n (this.group || createGroup(getOwner(this.options))).tracks.add(this);\n super.play();\n }\n pause() {\n super.pause();\n if (this.isAccelerated()) {\n this.sync();\n this.group.schedule(false);\n }\n }\n /**\n * JSAnimation finishes on its next tick, which only happens on the\n * main thread, so finish now.\n */\n complete() {\n super.complete();\n const { group } = this;\n group && !group.isJS && this.canAccelerate && this.tick(time.now());\n }\n /**\n * Without a tick to rebase it, a held time still includes the delay,\n * so take it off here, as a JS animation does on its next tick.\n */\n get time() {\n if (this.isAccelerated()) {\n return millisecondsToSeconds(clamp(0, this.totalDuration, this.at(time.now()) - (this.options.delay || 0)));\n }\n return super.time;\n }\n /**\n * A JS animation sets its motion value from a seek on its next tick.\n * This doesn't tick, so set it now, rather than leave it to be set\n * when this next stops.\n */\n set time(newTime) {\n super.time = newTime;\n this.isAccelerated() && this.sync();\n }\n /**\n * Scroll timelines set time every frame, so run these on the main\n * thread.\n */\n attachTimeline(timeline) {\n this.canAccelerate = false;\n this.group?.demote(true);\n return super.attachTimeline(timeline);\n }\n}\nfunction createGroup(owner) {\n const element = owner.current;\n const tracks = new Set();\n const byKey = new Map();\n /**\n * Transforms that aren't animating, as built into the WAAPI animation.\n */\n let statics = {};\n /**\n * The transforms in the WAAPI animation, in order.\n */\n let keys = [];\n let built = new Map();\n let segments = [];\n let needsBuild = false;\n let isScheduled = false;\n let isEnded = false;\n let hasChurned = false;\n let lastChurn = -Infinity;\n const has = (key) => {\n for (const track of tracks)\n if (track.name === key)\n return true;\n };\n /**\n * The transform values at a timestamp or, without one, from the\n * motion values. Animations that don't repeat forever are sampled no\n * earlier than settled, so a loop that starts from an earlier cycle\n * boundary holds them at their end.\n */\n const valuesAt = (timestamp, settled) => {\n const values = {};\n for (const key of timestamp === undefined ? transformPropOrder : keys) {\n const track = byKey.get(key);\n const value = timestamp === undefined\n ? read(owner, key)\n : track\n ? track.sampleAt(settled > timestamp && !track.timing()[1]\n ? settled\n : timestamp)\n : statics[key];\n if (value !== undefined)\n values[key] = value;\n }\n return values;\n };\n /**\n * Build the transform at a timestamp. Unlike buildTransform, every key\n * is written, even at its default, so each keyframe has the same list\n * of functions and the browser interpolates them one by one.\n */\n const compose = (timestamp, settled) => {\n let transform = \"\";\n const values = valuesAt(timestamp, settled);\n for (const key in values) {\n transform +=\n (translateAlias[key] || key) +\n \"(\" +\n getValueAsType(values[key], numberValueTypes[key]) +\n \") \";\n }\n return transform || \"none\";\n };\n /**\n * Write the transform as an inline style, as the renderer would.\n */\n const commit = (values = valuesAt()) => {\n element.style.transform = buildTransform(values, {});\n };\n /**\n * Cancel the WAAPI animations, by default first committing the\n * transform. The renderer writes its own version on its next render.\n */\n const stop = (shouldCommit = true) => {\n shouldCommit && commit();\n segments.forEach(({ animation }) => animation.cancel());\n segments = [];\n };\n const add = (animation, offset, end = Infinity) => {\n const segment = { animation, offset, end };\n animation.startTime = time.now() + offset;\n /**\n * Animations finish when the WAAPI animation reaches their end.\n * Once a loop has taken over, the finished animation isn't needed.\n */\n if (end < Infinity) {\n animation.onfinish = () => {\n segment.isDone = true;\n if (segments.some((s) => s.end === Infinity)) {\n animation.cancel();\n segments = segments.filter((s) => s !== segment);\n }\n group.schedule(false);\n };\n }\n /**\n * Something else cancelled it, so carry on on the main thread.\n */\n animation.oncancel = () => segments.includes(segment) && group.demote();\n segments.push(segment);\n };\n /**\n * Where a value jumps between two timestamps, as when a repeat starts\n * again: the timestamps either side of the jump, or none if it moves\n * there continuously.\n */\n const jumpAt = (value, a, b) => {\n const change = (x, y) => Math.abs(value(y) - value(x));\n const size = change(a, b);\n while (b - a > 0.01) {\n const mid = (a + b) / 2;\n change(a, mid) > change(mid, b) ? (b = mid) : (a = mid);\n }\n return change(a, b) > size / 2 ? [a, b] : [];\n };\n /**\n * If every moving animation follows the same eased progress between\n * two timestamps, the easing that describes it.\n */\n const getEasing = (moving, from, to, bounds) => {\n const samples = Math.min(maxSamples, Math.max(2, Math.ceil((to - from) / sampleDelta)));\n /**\n * Too many keyframes or repeats to follow with this many samples.\n */\n if (bounds.length * 4 > samples)\n return;\n const at = spread(from, to, samples).concat(bounds).sort(byTime);\n const position = (t) => progress(from, to, t);\n let shared;\n let progressAt;\n for (const track of moving) {\n const values = at.map((t) => track.numberAt(t));\n const [first] = values;\n const changes = values.map((value) => value - first);\n const end = changes[changes.length - 1];\n /**\n * A value that ends only a tiny way from where it started, as\n * a round trip does if it's built just after it starts, or\n * from a float residue, ends where it started. Dividing by\n * that tiny range would stretch the easing to values the\n * compositor can't render.\n */\n const range = changes.some((change) => Math.abs(change) * easingTolerance > Math.abs(end))\n ? 0\n : end;\n const progress = changes.map((change) => range ? change / range : change);\n /**\n * A value that doesn't change, like one still in its delay,\n * fits any easing. One that changes but ends where it started\n * fits none.\n */\n if (!range) {\n if (progress.some((p) => !(Math.abs(p) <= easingTolerance))) {\n return;\n }\n }\n else if (!shared) {\n shared = progress;\n progressAt = (t) => (track.numberAt(t) - first) / range;\n }\n else if (progress.some((p, i) => !(Math.abs(p - shared[i]) <= easingTolerance))) {\n return;\n }\n }\n if (!shared ||\n shared.every((p, i) => Math.abs(p - position(at[i])) <= easingTolerance)) {\n return \"linear\";\n }\n /**\n * A repeat that starts again jumps back, which takes two points at\n * the same position.\n */\n const points = [];\n const point = (t, p = progressAt(t)) => points.push(round(p) + \" \" + round(position(t) * 100) + \"%\");\n shared.forEach((p, i) => {\n i &&\n Math.abs(p - shared[i - 1]) > 0.2 &&\n jumpAt(progressAt, at[i - 1], at[i]).forEach((t) => point(t));\n point(at[i], p);\n });\n return \"linear(\" + points + \")\";\n };\n /**\n * Sample timestamps between two timestamps, closer together where the\n * moving animations curve.\n */\n const sample = (moving, from, to, bounds) => {\n const times = [from];\n /**\n * Values that aren't numbers, like calc(), are left to the\n * browser to interpolate.\n */\n const isStraight = (a, b) => moving.every((track) => !(Math.abs(track.numberAt((a + b) / 2) -\n (track.numberAt(a) + track.numberAt(b)) / 2) >\n (track.name.startsWith(\"scale\")\n ? scaleTolerance\n : sampleTolerance)));\n const split = (a, b, depth) => {\n if (b - a < 1 || isStraight(a, b)) {\n times.push(b);\n }\n else if (depth < 4) {\n split(a, (a + b) / 2, depth + 1);\n split((a + b) / 2, b, depth + 1);\n }\n else {\n /**\n * Keyframes either side of a jump, like a repeat starting\n * again, so it doesn't play as a quick sweep.\n */\n for (const track of moving) {\n times.push(...jumpAt((t) => track.numberAt(t), a, b));\n }\n times.push(b);\n }\n };\n /**\n * Split at least every 100ms, and at every keyframe and repeat,\n * either side of where a value can jump.\n */\n const ends = spread(from, to, Math.ceil((to - from) / 100));\n for (const t of bounds)\n ends.push(t, Math.min(t + 0.01, to));\n let start = from;\n for (const end of ends.sort(byTime)) {\n end > start && split(start, end, 0);\n start = end;\n }\n return times.sort(byTime);\n };\n /**\n * If every moving animation is the same tween, started together, as\n * happens for the values of one animate() call or transition, when\n * they move and their native easing.\n */\n const getTween = (moving) => {\n let shared;\n for (const track of moving) {\n const tween = track.tween();\n if (!tween ||\n shared?.some((v, i) => i < 2\n ? Math.abs(tween[i] - v) > 1\n : tween[i] !== v)) {\n return;\n }\n shared = tween;\n }\n return shared;\n };\n /**\n * A WAAPI animation of the composed transform between two timestamps.\n */\n const run = (moving, from, to, options = { fill: \"both\" }, settled, nativeEasing) => {\n const bounds = moving.flatMap((track) => track.boundaries(from, to));\n const easing = nativeEasing || getEasing(moving, from, to, bounds);\n const times = easing ? [from, to] : sample(moving, from, to, bounds);\n const transform = times.map((t) => compose(t, settled));\n let keyframes = { transform };\n if (!easing) {\n keyframes.offset = times.map((t) => progress(from, to, t));\n }\n /**\n * If nothing moves, don't hold a transform, which, even at its\n * default, would make the element a containing block. The empty\n * animation still finishes the animations.\n */\n if (transform.every((t) => t === transform[0])) {\n commit(valuesAt(from, settled));\n keyframes = null;\n }\n return element.animate(keyframes, {\n ...options,\n duration: to - from,\n easing: easing || \"linear\",\n });\n };\n /**\n * Replace the WAAPI animations with ones built from now. Returns\n * undefined if the animations can't be composed.\n */\n const animate = (now) => {\n /**\n * The finite part runs until the last finite animation (or the\n * last delay) ends. Infinitely repeating animations then continue\n * as one looping WAAPI animation, which needs them to share a\n * cycle.\n */\n let end = now;\n let cycle = 0;\n let cycleStart = 0;\n const moving = [];\n const looping = [];\n const ends = new Set();\n byKey.clear();\n built = new Map();\n for (const track of tracks) {\n byKey.set(track.name, track);\n const [trackEnd, trackCycle] = track.timing();\n const isHeld = trackEnd === Infinity;\n built.set(track, [track.at(now), track.speed, isHeld]);\n /**\n * Held animations don't move, so keep their motion values up\n * to date, as a JSAnimation would on a seek.\n */\n if (isHeld) {\n track.sync();\n continue;\n }\n if (track.speed < 0)\n return;\n if (trackCycle) {\n if (cycle) {\n const phase = (trackEnd - cycleStart) / trackCycle;\n if (Math.abs(trackCycle - cycle) > 1 ||\n Math.abs(phase - Math.round(phase)) * cycle > 1) {\n return;\n }\n }\n else {\n cycle = trackCycle;\n cycleStart = trackEnd;\n }\n looping.push(track);\n }\n else {\n ends.add(trackEnd);\n }\n moving.push(track);\n end = Math.max(end, trackEnd);\n }\n statics = {};\n /**\n * Transforms that aren't animating are left out at their default.\n */\n keys = transformPropOrder.filter((key) => {\n if (byKey.has(key))\n return true;\n const value = (statics[key] = read(owner, key));\n return (value !== undefined &&\n parseFloat(value) !==\n (key.startsWith(\"scale\") ? 1 : 0));\n });\n stop(false);\n /**\n * Values that share one tween are one WAAPI animation of it, with\n * two keyframes and its own easing, from when they started.\n */\n const tween = !cycle && getTween(moving);\n try {\n if (tween && tween[1] > now) {\n const [from, to, easing] = tween;\n add(run(moving, from, to, undefined, undefined, easing), from - now, to - from);\n }\n else if (end > now) {\n add(run(moving, now, end), 0, end - now);\n /**\n * Animations that end sooner finish on the events of\n * empty animations that end with them.\n */\n ends.forEach((trackEnd) => trackEnd < end - 1 &&\n add(element.animate(null, {\n duration: trackEnd - now,\n }), 0, trackEnd - now));\n }\n if (cycle) {\n /**\n * Build one cycle from a cycle boundary, so it repeats\n * seamlessly, and start it part way through.\n */\n const from = cycleStart + Math.floor((end - cycleStart) / cycle) * cycle;\n add(run(looping, from, from + cycle, {\n iterations: Infinity,\n iterationStart: (end - from) / cycle,\n /**\n * It must not fill backwards over the finite part\n * that runs before it.\n */\n fill: \"forwards\",\n }, end), end - now);\n }\n }\n catch {\n return;\n }\n /**\n * Everything is held, so hold it with an inline style instead.\n */\n segments.length || stop();\n return true;\n };\n /**\n * If every animation has been paused, played, seeked or sped up\n * together since the WAAPI animation was built, do the same to it.\n * Returns false if it needs rebuilding instead.\n */\n const retime = (now) => {\n let elapsed;\n let rate = 0;\n for (const track of tracks) {\n const state = built.get(track);\n if (!state)\n return false;\n const [builtTime, builtSpeed, wasHeld] = state;\n const trackTime = track.at(now);\n const isHeld = track.timing()[0] === Infinity;\n if (wasHeld) {\n if (isHeld && trackTime === builtTime)\n continue;\n return false;\n }\n const trackElapsed = (trackTime - builtTime) / builtSpeed;\n const trackRate = isHeld ? 0 : track.speed / builtSpeed;\n if (elapsed === undefined) {\n elapsed = trackElapsed;\n rate = trackRate;\n }\n else if (Math.abs(trackElapsed - elapsed) > 1 ||\n trackRate !== rate) {\n return false;\n }\n }\n if (elapsed === undefined)\n return true;\n if (!segments.length)\n return false;\n for (const { offset, end, isDone } of segments) {\n const local = elapsed - offset;\n if (end < Infinity &&\n (isDone ? local < end - 1 : local < 0 || local >= end)) {\n return false;\n }\n }\n for (const { animation, offset, isDone } of segments) {\n if (isDone)\n continue;\n const local = elapsed - offset;\n if (rate) {\n animation.playbackRate = rate;\n animation.startTime = now - local / rate;\n }\n else {\n animation.pause();\n animation.currentTime = local;\n }\n }\n return true;\n };\n /**\n * If no animations are left, write where they got to and cancel the\n * WAAPI animations. Returns whether the group ended.\n */\n const end = () => {\n if (tracks.size)\n return false;\n isEnded = true;\n transformGroups.delete(element);\n group.isJS || stop();\n return true;\n };\n const build = () => {\n const now = time.now();\n /**\n * Finish the animations that have reached their end, which the\n * WAAPI animation has already rendered.\n */\n if (!group.isJS) {\n group.isFinishing = true;\n tracks.forEach((track) => {\n const [trackEnd, trackCycle] = track.timing();\n if (track.state === \"running\" &&\n track.speed > 0 &&\n !trackCycle &&\n trackEnd <= now + 1) {\n track.complete();\n /**\n * From now it's checked for outside writes like any\n * other static transform. If the WAAPI animation never\n * rendered it (it was instant), rebuild with its value.\n */\n statics[track.name] = read(owner, track.name);\n built.has(track) || (needsBuild = true);\n }\n });\n group.isFinishing = false;\n }\n isScheduled = false;\n if (isEnded)\n return;\n tracks.forEach(({ state }, track) => {\n if (state === \"idle\" || state === \"finished\")\n tracks.delete(track);\n });\n if (end())\n return;\n for (const track of tracks) {\n if (!track.canAccelerate)\n return group.demote(true);\n }\n /**\n * Everything that kept the group on the main thread has finished,\n * so move the remaining animations back to the compositor.\n */\n if (group.isJS) {\n group.isJS = false;\n needsBuild = true;\n tracks.forEach((track) => track.js?.stop());\n }\n const shouldBuild = needsBuild;\n const churned = hasChurned;\n needsBuild = hasChurned = false;\n if (shouldBuild || !retime(now)) {\n if (churned) {\n if (now - lastChurn < churnWindow)\n return group.demote();\n lastChurn = now;\n }\n if (!animate(now))\n return group.demote();\n }\n };\n const group = {\n tracks,\n isJS: false,\n isFinishing: false,\n schedule(build_, isChurn) {\n if (isEnded)\n return;\n needsBuild || (needsBuild = build_);\n hasChurned || (hasChurned = !!isChurn);\n /**\n * Build in this frame's render step, so it's in place before\n * anything reads the DOM in postRender, or straight after the\n * current task outside of a frame.\n */\n if (!isScheduled) {\n isScheduled = true;\n frameData.isProcessing\n ? frame.render(build, false, true)\n : queueMicrotask(build);\n }\n },\n /**\n * End the group now, rather than when it next builds, so the\n * element's transform is the caller's again as soon as its last\n * animation is stopped.\n */\n release(track) {\n /**\n * Only drop the stopped animation. Others can be idle because\n * they're part way through play(), and are about to run.\n */\n const { state } = track;\n if (state === \"idle\" || state === \"finished\")\n tracks.delete(track);\n end() || group.schedule(true);\n },\n /**\n * An outside write. Rebuild once, but if it keeps happening, move\n * to the main thread.\n */\n check() {\n if (group.isJS)\n return;\n for (const key in statics) {\n if (read(owner, key) !== statics[key] && !has(key)) {\n return group.schedule(true, true);\n }\n }\n },\n demote(canReturn) {\n if (group.isJS || isEnded)\n return;\n /**\n * Unless only another animation is holding the group on the\n * main thread, these animations stay there until they end.\n */\n tracks.forEach((track) => {\n track.isAccelerated() && track.sync();\n canReturn || (track.canAccelerate = false);\n });\n group.isJS = true;\n built = new Map();\n stop();\n tracks.forEach((track) => track.state === \"running\" && track.js?.start());\n },\n };\n transformGroups.set(element, group);\n return group;\n}\n\nexport { TransformAnimation, canGroupTransform };\n//# sourceMappingURL=TransformAnimation.mjs.map\n","import { MotionGlobalConfig } 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 { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\nimport { canGroupTransform, TransformAnimation } from './waapi/transforms/TransformAnimation.mjs';\n\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor(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 { keyframes, name, motionValue, element } = options;\n /**\n * animateMotionValue builds a fresh options object per value, so\n * it's completed in place as keyframes resolve rather than copied.\n */\n const optionsWithDefaults = options;\n optionsWithDefaults.autoplay ?? (optionsWithDefaults.autoplay = true);\n optionsWithDefaults.delay ?? (optionsWithDefaults.delay = 0);\n optionsWithDefaults.type ?? (optionsWithDefaults.type = \"keyframes\");\n optionsWithDefaults.repeat ?? (optionsWithDefaults.repeat = 0);\n optionsWithDefaults.repeatDelay ?? (optionsWithDefaults.repeatDelay = 0);\n optionsWithDefaults.repeatType ?? (optionsWithDefaults.repeatType = \"loop\");\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 const { onComplete } = options;\n options.finalKeyframe = finalKeyframe;\n options.keyframes = keyframes;\n /**\n * JSAnimation and NativeAnimation call onComplete exactly when\n * their own `finished` resolves, so this replaces a promise chain\n * per value with a callback.\n */\n options.onComplete = () => {\n onComplete?.();\n this.notifyFinished();\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 && !isHandoff && supportsBrowserAnimation(options);\n /**\n * Independent transforms (x, scale etc) on an HTML element are\n * composed into one WAAPI transform animation per element.\n */\n const isGroupedTransform = !useWaapi && canGroupTransform(options);\n /**\n * Resolve startTime for the animation. A startTime passed in options\n * (an optimised appear handoff syncing to its WAAPI animation) takes\n * precedence.\n *\n * *Ideally*, we would use the createdAt time as t=0 as the following\n * frame would then be the first frame of the animation in progress,\n * which would feel snappier. If keyframes resolved on a later frame,\n * and long after creation, we start from then instead.\n *\n * If they resolved immediately, a JSAnimation picks its own start\n * time and resolves it the same way on its first frame, so every\n * animation started in that moment stays in sync. WAAPI has no frame\n * of ours to do that on.\n */\n if (sync &&\n (useWaapi ||\n isGroupedTransform ||\n this.resolvedAt !== this.createdAt)) {\n options.startTime ?? (options.startTime = resolveStartTime(this.createdAt, this.resolvedAt));\n }\n let animation;\n if (useWaapi) {\n /**\n * The resolver needed the VisualElement, WAAPI needs the DOM\n * element. JSAnimation reads neither, so this is safe to\n * leave in place if we fall back to it.\n */\n options.element = options.motionValue?.owner?.current;\n try {\n animation = new NativeAnimationExtended(options);\n }\n catch {\n animation = new JSAnimation(options);\n }\n }\n else if (isGroupedTransform) {\n animation = new TransformAnimation(options);\n }\n else {\n animation = new JSAnimation(options);\n }\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 return this._animation ? this._animation.finished : super.finished;\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n /**\n * The value now, if the animation runs on the compositor.\n */\n liveValue() {\n return this._animation?.liveValue?.();\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 // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n // Only build the message when we're going to warn\n isOriginAnimatable !== isTargetAnimatable &&\n warning(false, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\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.notifyChange();\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 var _a;\n if (eventName === \"change\")\n return this.onChangeSubscribe(callback);\n return ((_a = this.events)[eventName] || (_a[eventName] = new SubscriptionManager())).add(callback);\n }\n onChangeSubscribe(callback) {\n const { events } = this;\n if (!events.change && !this.changeSubscriber) {\n this.changeSubscriber = callback;\n }\n else {\n if (!events.change) {\n events.change = new SubscriptionManager();\n events.change.add(this.changeSubscriber);\n this.changeSubscriber = undefined;\n }\n events.change.add(callback);\n }\n return () => {\n if (this.changeSubscriber === callback) {\n this.changeSubscriber = undefined;\n }\n else {\n events.change?.remove(callback);\n }\n this.stopIfUnobserved();\n };\n }\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n stopIfUnobserved() {\n frame.read(() => {\n if (!this.changeSubscriber && !this.events.change?.getSize()) {\n this.stop();\n }\n });\n }\n clearListeners() {\n this.changeSubscriber = undefined;\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.notifyChange();\n }\n notifyChange() {\n const { current, changeSubscriber } = this;\n /**\n * One or the other exists. Subscribing during the direct\n * subscriber's call moves it into a new manager, which must not\n * then be notified for the same change.\n */\n if (changeSubscriber) {\n changeSubscriber(current);\n }\n else {\n this.events.change?.notify(current);\n }\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 /**\n * A value animating on the compositor isn't updated every frame,\n * so read it from its animation.\n */\n const sampled = this.animation?.liveValue?.();\n return sampled === undefined ? this.current : sampled;\n }\n /**\n * The value as last set. Unlike get(), this doesn't read an animation\n * running on the compositor, which renders the value itself.\n */\n getCurrent() {\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 /**\n * Complete synchronously via the callback rather than chaining a\n * second promise per animation. Guard against animations that\n * complete before startAnimation has returned.\n */\n let isComplete = false;\n let animation;\n // eslint-disable-next-line prefer-const -- read by the callback before assignment when completing synchronously\n animation = startAnimation(() => {\n isComplete = true;\n this.events.animationComplete?.notify();\n if (this.animation === animation)\n this.clearAnimation();\n resolve();\n });\n if (!isComplete)\n this.animation = animation;\n this.events.animationStart?.notify();\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 // Assign rather than delete to keep the object's shape stable\n this.animation = undefined;\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 hasOnUpdate: !!valueTransition.onUpdate,\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 const resolveFunction = (def) => typeof def === \"function\"\n ? def(custom !== undefined ? custom : props.custom, ...getValueState(visualElement))\n : def;\n /**\n * Resolve a function, then a variant label (which the function may have\n * returned), then a function again as the label may point to one. The\n * final function can only return a target object.\n */\n definition = resolveFunction(definition);\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n return resolveFunction(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 return resolveVariantFromProps(visualElement.getProps(), definition, custom, visualElement);\n}\n/**\n * Exit variants resolve with AnimatePresence's custom, every other type\n * with the element's own.\n */\nconst getTypeCustom = (visualElement, type) => type === \"exit\" ? visualElement.presenceContext?.custom : undefined;\n\nexport { getTypeCustom, 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","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","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\nconst isBrowser = typeof window !== \"undefined\";\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 = key in protectedKeys && !needsAnimating[key];\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 && 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.animateValues\n ? path.animateValues((key) => visualElement.getValue(key, visualElement.latestValues[key] ?? 0), target, transition, delay, animations)\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 (isBrowser && 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, getTypeCustom } 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, getTypeCustom(visualElement, options.type));\n const transition = options.transitionOverride ||\n (resolved?.transition ?? (visualElement.getDefaultTransition() || {}));\n const getAnimation = () => Promise.all(resolved ? animateTarget(visualElement, resolved, options) : []);\n const getChildAnimations = (delay = 0) => {\n const { variantChildren } = visualElement;\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n const animations = [];\n variantChildren?.forEach((child) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delay +\n (typeof delayChildren === \"function\"\n ? 0\n : delayChildren) +\n calcChildStagger(variantChildren, child, delayChildren, staggerChildren, staggerDirection),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n };\n /**\n * when: \"beforeChildren\" | \"afterChildren\" runs this element's animation\n * and its children's in sequence.\n */\n const { when } = transition;\n return when\n ? when === \"beforeChildren\"\n ? getAnimation().then(() => getChildAnimations())\n : getChildAnimations().then(getAnimation)\n : Promise.all([getAnimation(), getChildAnimations(options.delay)]);\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","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","/**\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 { 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 { hasComplexValues } 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 hasComplexValues(keyframe)) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n /**\n * A zero-valued template like \"0%\" is already its own\n * animatable none, so there's nothing to derive.\n */\n if (unresolvedKeyframes[noneIndex] === animatableTemplate)\n continue;\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 { containsCSSVariable, isCSSVariableToken } 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 /**\n * Keyframes that don't need reading from the DOM, or measuring,\n * resolve straight away rather than in the frame loop's batched read.\n */\n scheduleResolve() {\n if (this.canReadNow()) {\n this.readKeyframes();\n if (!this.needsMeasurement)\n return this.complete();\n }\n super.scheduleResolve();\n }\n canReadNow() {\n const { unresolvedKeyframes, element, motionValue } = this;\n const origin = unresolvedKeyframes[0] ?? motionValue?.get();\n if (!element?.current || origin === undefined)\n return false;\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (containsCSSVariable(i ? unresolvedKeyframes[i] : origin)) {\n return false;\n }\n }\n return 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 // Two numbers share a unit, so skip the value type search.\n if (typeof origin === \"number\" && typeof target === \"number\")\n return;\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 measure() {\n const { element, name } = this;\n return positionalValues[name](window.getComputedStyle(element.current), () => element.measureViewportBox());\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 = this.measure();\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 this.motionValue?.jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n this.motionValue?.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = this.measure();\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","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","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","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\n/**\n * Values rendered via style rather than as attributes. This must include\n * every value WAAPI can accelerate, as WAAPI writes its final value to\n * style, which would otherwise override later attribute writes.\n */\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"clipPath\",\n \"filter\",\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 * 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.rotateZ ||\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 // Incorporate 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 { 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 \"pointerleave\" 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 { 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","const asNumber = (v) => typeof v === \"number\" ? v : parseFloat(v);\n\nexport { asNumber };\n//# sourceMappingURL=as-number.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 if (isAnimationControls(props.animate))\n return true;\n for (let i = 0; i < variantProps.length; i++) {\n if (isVariantLabel(props[variantProps[i]])) {\n return true;\n }\n }\n return false;\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 { transformGroups } from '../animation/waapi/transforms/groups.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 { 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 { 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 /**\n * Join the closest variant node above, so its variant changes\n * propagate here, unless inherit={false} cuts the chain.\n */\n if (this.isVariantNode && !this.isControllingVariants) {\n let node = this;\n do\n node = node.props.inherit !== false && node.parent;\n while (node && !node.isVariantNode);\n if (node) {\n const { variantChildren } = node;\n variantChildren.add(this);\n this.removeFromVariantTree = () => variantChildren.delete(this);\n }\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) {\n if (this.projection) {\n this.projection.isTransformDirty = true;\n }\n transformGroups.get(this.current)?.check();\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 either node isn't mounted, or they aren't even of the same type,\n * we can't compare their document order.\n */\n if (!this.current ||\n !other.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 const { transformTemplate, onUpdate } = this.props;\n if (props.transformTemplate || transformTemplate) {\n this.scheduleRender();\n }\n /**\n * Transforms on the compositor can't use a new transformTemplate\n * or onUpdate, so move them to the main thread.\n */\n if ((props.transformTemplate && !transformTemplate) ||\n (props.onUpdate && !onUpdate)) {\n transformGroups.get(this.current)?.demote();\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 /**\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 /**\n * An animated value with no base value is undefined until the\n * keyframe resolver reads its origin. Rendering it before then\n * writes an invalid placeholder (e.g. points=\"undefined\") that\n * the resolver can read back from the DOM as the origin.\n */\n const latest = value.get();\n if (latest !== undefined)\n this.latestValues[key] = latest;\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 ?? this.getDefaultValue?.(key), {\n owner: this,\n });\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 (\n /**\n * If the value as read isn't animatable (e.g. \"none\") but\n * the target is, derive an animatable none from the target.\n * A value is animatable if it's a number or contains a\n * number or color, which is cheaper to check than trying\n * every value type in turn.\n */\n typeof value !== \"number\" &&\n !complex.test(value) &&\n 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 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 precedes 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","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 { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\n\nconst scaleCorrectors = {};\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","/**\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 /**\n * A MotionValue child is rendered as text content by\n * DOMVisualElement, so it mustn't also be written as an attribute.\n */\n if (key !== \"children\" &&\n (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 { defaultTransformValue } from '../dom/parse-transform.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 /**\n * An independent transform's base is never an attribute of the same\n * name, e.g. is a position, not a translate. Like HTML it\n * comes from style, falling back to the transform's default.\n */\n return transformProps.has(key)\n ? super.getBaseTargetFromProps(props, key) ??\n defaultTransformValue(key)\n : props[key];\n }\n /**\n * An independent transform's origin is never read from the DOM, so it\n * starts from its latest or default value and renders on mount.\n */\n getDefaultValue(key) {\n return transformProps.has(key)\n ? this.latestValues[key] ?? defaultTransformValue(key)\n : undefined;\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","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 { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant, getTypeCustom } from './resolve-dynamic-variants.mjs';\nimport { shallowCompare } from './shallow-compare.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\n/**\n * Diffs the element's animation props (one layer per AnimationType, highest\n * priority wins each value) against the previous call and starts animations\n * for what changed.\n *\n * Uses `any` type for visualElement to avoid circular dependencies. It reads\n * props, parent, presenceContext, variantChildren, enteringChildren,\n * manuallyAnimateOnMount, blockInitialAnimation, getValue(),\n * getBaseTargetFromProps(), baseTarget and initialValues.\n */\nfunction createAnimationState(visualElement) {\n let animate = (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n let state = createState();\n let isInitialRender = true;\n /**\n * After a reset (StrictMode, Suspense, AnimatePresence re-entry) the next\n * animateChanges() mounts again, but initial={false} no longer applies.\n */\n let wasReset = false;\n function animateChanges(changedActiveType) {\n const { props, parent, manuallyAnimateOnMount } = visualElement;\n const isMounting = isInitialRender || wasReset;\n const animations = [];\n /**\n * Values removed from a type. A lower-priority type that defines\n * them animates them back, otherwise they fall back to a base target.\n */\n const removedKeys = new Set();\n /**\n * Values claimed by active, higher-priority types.\n */\n let encounteredKeys = {};\n /**\n * Once a type has been deactivated, lower-priority variant labels\n * re-animate so variant children animate back too.\n */\n let removedVariantIndex = Infinity;\n /**\n * Variant labels are inherited from the closest variant-controlling\n * ancestor, unless an element on the way has inherit={false}.\n */\n let source = visualElement;\n do\n source = source.props.inherit !== false && source.parent;\n while (source && !source.isControllingVariants);\n reversePriorityOrder.forEach((type, i) => {\n const typeState = state[type];\n const ownProp = props[type];\n const inheritedProp = source && source.props[type];\n const prop = ownProp !== undefined\n ? ownProp\n : isVariantLabel(inheritedProp) || inheritedProp === false\n ? inheritedProp\n : undefined;\n const propIsVariant = isVariantLabel(prop);\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * Inherited labels are animated by the parent through\n * variantChildren, unless this element mounted after its parent.\n */\n const isInherited = propIsVariant &&\n ownProp === undefined &&\n !(isMounting && manuallyAnimateOnMount);\n typeState.protectedKeys = { ...encounteredKeys };\n if ((!typeState.isActive && activeDelta === null) ||\n (!prop && !typeState.prevProp) ||\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n return;\n }\n /**\n * Don't re-resolve a running exit: a changed custom would start\n * new value animations that stop the originals, leaving the exit\n * promise unresolved and the element stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n };\n return;\n }\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n (propIsVariant &&\n ((activeDelta && !isInherited) || i > removedVariantIndex));\n let handledRemovedValues = false;\n const definitionList = Array.isArray(prop) ? prop : [prop];\n let resolvedValues = {};\n if (activeDelta !== false) {\n for (const definition of definitionList) {\n const { transition, transitionEnd, ...target } = resolveVariant(visualElement, definition, getTypeCustom(visualElement, type)) || {};\n resolvedValues = {\n ...resolvedValues,\n ...target,\n ...transitionEnd,\n };\n }\n }\n const { prevResolvedValues } = typeState;\n for (const key in { ...prevResolvedValues, ...resolvedValues }) {\n if (key in encounteredKeys)\n continue;\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n /**\n * Keyframes compare by value, but replay whenever the\n * variant label changed.\n */\n const valueHasChanged = Array.isArray(next) && Array.isArray(prev)\n ? !shallowCompare(next, prev) || variantDidChange\n : next !== prev;\n if (valueHasChanged &&\n (next === undefined || next === null)) {\n removedKeys.add(key);\n }\n else if (valueHasChanged ||\n (next !== undefined && removedKeys.has(key))) {\n shouldAnimateType = true;\n if (removedKeys.delete(key))\n handledRemovedValues = true;\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n }\n else {\n typeState.protectedKeys[key] = true;\n }\n }\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if (shouldAnimateType &&\n (!(isInherited && variantDidChange) || handledRemovedValues)) {\n for (const animation of definitionList) {\n const options = { type };\n /**\n * Elements that mount into an already-mounted parent\n * animate themselves, staggered by the parent variant's\n * delayChildren.\n */\n if (typeof animation === \"string\" &&\n isMounting &&\n manuallyAnimateOnMount &&\n parent?.enteringChildren) {\n const delayChildren = resolveVariant(parent, animation)\n ?.transition?.delayChildren;\n options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);\n }\n animations.push({ animation, options });\n }\n }\n });\n /**\n * Removed values that no lower-priority type defines animate back to\n * initial, then style, then the value as first read. If initial no\n * longer defines a value it once did, it stays where it is.\n */\n if (removedKeys.size) {\n const { initial } = props;\n const fallbackAnimation = {};\n const resolvedInitial = typeof initial !== \"boolean\" &&\n resolveVariant(visualElement, Array.isArray(initial) ? initial[0] : initial, visualElement.presenceContext?.custom);\n if (resolvedInitial && resolvedInitial.transition) {\n fallbackAnimation.transition = resolvedInitial.transition;\n }\n removedKeys.forEach((key) => {\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n const fromInitial = resolvedInitial && !Array.isArray(initial)\n ? resolvedInitial[key]\n : undefined;\n const fromProps = visualElement.getBaseTargetFromProps(props, key);\n fallbackAnimation[key] =\n (fromInitial !== undefined\n ? fromInitial\n : fromProps !== undefined && !isMotionValue(fromProps)\n ? fromProps\n : visualElement.initialValues[key] === undefined\n ? visualElement.baseTarget[key]\n : undefined) ?? null;\n /**\n * If it stays where it is, that's now its base. Otherwise a\n * later removal (like a gesture ending) would also stay,\n * leaving the value stuck. Stop first so accelerated\n * animations sync the value they reached. In practice initial\n * only changes like this with Fast Refresh, so this is\n * dev-only (#3787).\n */\n if (process.env.NODE_ENV !== \"production\" &&\n fallbackAnimation[key] === null &&\n visualElement.initialValues[key] !== undefined) {\n delete visualElement.initialValues[key];\n motionValue?.stop();\n visualElement.baseTarget[key] = motionValue?.get();\n }\n });\n animations.push({ animation: fallbackAnimation });\n }\n const blockAnimation = (isMounting && visualElement.blockInitialAnimation) ||\n (isInitialRender &&\n !manuallyAnimateOnMount &&\n (props.initial === false || props.initial === props.animate));\n isInitialRender = wasReset = false;\n return !blockAnimation && animations.length\n ? animate(animations)\n : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n if (state[type].isActive === isActive)\n return Promise.resolve();\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 /**\n * Allows tests to inject a mocked animate function.\n * @internal\n */\n setAnimateFunction: (makeAnimator) => {\n animate = makeAnimator(visualElement);\n },\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 createState() {\n const state = {};\n for (const type of variantPriorityOrder) {\n state[type] = {\n isActive: type === \"animate\",\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n }\n return state;\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 const animation = Array.isArray(definition)\n ? Promise.all(definition.map((variant) => animateVariant(visualElement, variant, options)))\n : typeof definition === \"string\"\n ? animateVariant(visualElement, definition, options)\n : Promise.all(animateTarget(visualElement, resolveVariant(visualElement, definition, options.custom), options));\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 { 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 { 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';\nimport { asNumber } from '../../value/utils/as-number.mjs';\n\nconst numBorders = cornerRadiusProps.length;\nconst mixedTransforms = [\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skewX\",\n \"skewY\",\n];\nconst numMixedTransforms = mixedTransforms.length;\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 and skew. These can't be projected, so mix them every\n * frame rather than leaving them frozen at the animation-start snapshot.\n */\n for (let i = 0; i < numMixedTransforms; i++) {\n const key = mixedTransforms[i];\n if (follow[key] || lead[key]) {\n target[key] = mixNumber(follow[key] || 0, lead[key] || 0, progress);\n }\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","import { cornerRadiusProps } from '../../utils/border-radius.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst defaultScaleCorrectors = {\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 { defaultScaleCorrectors };\n//# sourceMappingURL=default-scale-correctors.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 { notifyLayoutAnimationStart } from '../../animation/utils/notify-inspector.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 { transformGroups } from '../../animation/waapi/transforms/groups.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 { defaultScaleCorrectors } from '../styles/default-scale-correctors.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, frameSteps } from '../../frameloop/frame.mjs';\nimport { frameData } from '../../frameloop/frame-data.mjs';\n\n/**\n * Correctors registered via addScaleCorrector before projection loaded\n * (e.g. with an async LazyMotion bundle) take precedence over the defaults.\n */\nObject.assign(scaleCorrectors, {\n ...defaultScaleCorrectors,\n ...scaleCorrectors,\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}\nconst demoteTransforms = ({ instance }) => instance && transformGroups.get(instance)?.demote();\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 calculated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to visually\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 // 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.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 this.addLayoutListener();\n }\n /**\n * Only register the layout animation handler if this node requires\n * layout animation. This is called on mount, and again whenever options\n * change, as `layout` or `layoutId` may be enabled after mount.\n */\n addLayoutListener() {\n const { layoutId, layout, visualElement, animate } = this.options;\n if (!this.instance ||\n this.hasLayoutListener ||\n animate === false ||\n !visualElement ||\n !(layoutId || layout))\n return;\n this.hasLayoutListener = true;\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => {\n if (this.isAnimationBlocked) {\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.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 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 this.hasLayoutListener = false;\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 // 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 /**\n * Accelerated transforms aren't reflected in latestValues or\n * removed by resetTransform, so move them back to the main\n * thread before this node, or its ancestors, are measured.\n */\n demoteTransforms(this);\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 demoteTransforms(node);\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 * Measure the nearest dragged ancestor before the DOM\n * changes, so this node can follow its layout change.\n */\n if (node.isAnimationBlocked) {\n node.dragSnapshot || (node.dragSnapshot = node.measure());\n this.dragAncestor = node;\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 this.nodes.forEach(syncRelativeLayout);\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 /**\n * A stack's last member can unmount while a replacement with the\n * same layoutId mounts in the same commit, so the stack (and its\n * lead) must outlive the unmount for the replacement to resume\n * from it. By now that handoff has happened, so stacks that are\n * still empty only retain unmounted nodes and can be released.\n */\n this.sharedNodes.forEach((stack, layoutId) => stack.members.length\n ? stack.removeLeadSnapshot()\n : this.sharedNodes.delete(layoutId));\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 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 isResetRequested && demoteTransforms(this);\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 this.addLayoutListener();\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 /**\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.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 notifyLayoutAnimationStart(this.currentAnimation, this);\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 const { targetWithTransforms, layout, latestValues } = lead;\n let { target } = 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 =\n this.snapshot =\n this.dragSnapshot =\n this.dragAncestor =\n 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}\n/**\n * Nodes are depth-ordered, so a dragged ancestor's layout is updated before\n * its descendants'.\n */\nfunction updateLayout(node) {\n node.updateLayout();\n followDraggedAncestor(node);\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 * A dragged node doesn't layout animate, so it jumps to its new layout. Shift\n * its descendants' snapshots by the same amount, so they only animate layout\n * changes relative to it, rather than lagging behind.\n */\nfunction followDraggedAncestor(node) {\n const { snapshot, dragAncestor } = node;\n const to = dragAncestor?.layout;\n if (!snapshot || !to || node.resumeFrom || node.isAnimationBlocked)\n return;\n const from = dragAncestor.dragSnapshot;\n eachAxis((axis) => translateAxis(snapshot.layoutBox[axis], to.layoutBox[axis].min - from.layoutBox[axis].min));\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.dragSnapshot || node.layout;\n node.isLayoutDirty = true;\n }\n}\n/**\n * If a node's relative parent is about to be re-measured but the node isn't\n * (e.g. it's in another LayoutGroup), its relative target is out of date.\n * If it's layout animating, re-measure it too, so its relative target keeps\n * resolving against current layouts. Otherwise its layout is still valid\n * relative to its parent, so drop the relative target, and any targetDelta\n * left over from a finished animation while an ancestor still animates, to be\n * rebuilt from its layout.\n */\nfunction syncRelativeLayout(node) {\n if (node.relativeTarget && node.relativeParent?.isLayoutDirty) {\n if (node.currentAnimation) {\n node.isLayoutDirty = true;\n }\n else {\n node.targetDelta = undefined;\n node.removeRelativeTarget();\n }\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 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, rotateZ, 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 (rotateZ)\n transform += `rotateZ(${rotateZ}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 \"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","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","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 /**\n * Layout effects re-run when a hidden Suspense/Activity boundary is\n * revealed, but passive effects only re-run if this component re-renders\n * (not the case for memoized elements). Replay animations on every\n * reconnection. Must be declared before the effect that sets hasMountedOnce.\n */\n useIsomorphicLayoutEffect(() => {\n if (!hasMountedOnce.current || !visualElement)\n return;\n visualElement.animationState?.animateChanges();\n visualElement.enteringChildren = undefined;\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 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 situation 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","\"use client\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { loadFeatures } from \"../../motion/features/load-features\";\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 }) {\n const [, setIsLoaded] = useState(!isLazyBundle(features));\n const loadedRenderer = useRef(undefined);\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 useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures);\n loadedRenderer.current = renderer;\n setIsLoaded(true);\n });\n }\n }, []);\n return (_jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children }));\n}\nfunction isLazyBundle(features) {\n return typeof features === \"function\";\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, time, } 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 this.hasPendingMove = false;\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 this.history.push({ ...point, timestamp: time.now() });\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 this.hasPendingMove = true;\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n // Browsers flush a coalesced pointermove immediately before\n // pointerup, so the final move can still be waiting for a frame.\n this.hasPendingMove && this.updatePoint();\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 seconds = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (seconds === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / seconds,\n y: (lastPoint.y - timestampedPoint.y) / seconds,\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 aesthetically 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, getVariableValue, isCSSVariableToken, isElementTextInput, measurePageBox, mixNumber, percent, px, resize, setDragLock, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { addDomEvent } from \"motion-dom\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\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(event);\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 CSS variable, like \"var(--y)\",\n * resolve it so it can be converted to px below.\n */\n if (isCSSVariableToken(current)) {\n current =\n getVariableValue(current, this.visualElement.current) || 0;\n }\n /**\n * If the MotionValue is a px or percentage value convert to px\n */\n if (px.test(current)) {\n current = parseFloat(current);\n }\n else 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 /**\n * Measure the live box - projection.layout may or may not include the\n * drag transform, depending on when it was measured.\n */\n snapToCursor({ clientX, clientY }) {\n const { drag } = this.getProps();\n const point = { x: clientX, y: clientY };\n const cursor = this.visualElement.getTransformPagePoint()?.(point) || point;\n const box = this.visualElement.measureViewportBox();\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = box[axis];\n axisValue.set((axisValue.get() || 0) + cursor[axis] - mixNumber(min, max, 0.5));\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 constraints = this.constraints;\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const latest = this.getAxisMotionValue(axis).get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, constraints[axis]);\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 const axisValue = this.getAxisMotionValue(axis);\n /**\n * An element resting at its origin has no offset to preserve,\n * and re-projecting 0 into the new constraints would move it.\n */\n if (!shouldDrag(axis, drag, null) || !axisValue.get())\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\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;\n/**\n * The projection node is created with the props from the component's first\n * render, so keep these in sync as `layout` can change (or be enabled) later.\n */\nconst layoutOptions = ({ layout, layoutDependency }) => ({\n layout,\n layoutDependency,\n animationType: typeof layout === \"string\" ? layout : \"both\",\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 } = 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 ...layoutOptions(this.props),\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layout, 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 prevProps.layout !== layout) {\n projection.setOptions({\n ...projection.options,\n ...layoutOptions(this.props),\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 { 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 { Feature, resolveVariant } from \"motion-dom\";\nlet id = 0;\nexport class ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n }\n update() {\n const { presenceContext, prevPresenceContext, animationState } = this.node;\n if (!presenceContext || !animationState)\n return;\n const { isPresent, onExitComplete } = presenceContext;\n const prevIsPresent = prevPresenceContext?.isPresent;\n if (isPresent === prevIsPresent)\n return;\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering after the exit completed (element is at\n * rest), replay the enter animation from initial.\n */\n if (this.exit === true) {\n const { initial } = this.node.getProps();\n if (initial && !Array.isArray(initial)) {\n const { transition, transitionEnd, ...target } = resolveVariant(this.node, initial) || {};\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(target[key]);\n }\n }\n /**\n * A re-entering element is no longer an initial child, so\n * AnimatePresence's initial={false} mustn't block its enter.\n */\n this.node.blockInitialAnimation = false;\n animationState.reset();\n animationState.animateChanges();\n }\n else {\n animationState.setActive(\"exit\", false);\n }\n this.exit = undefined;\n return;\n }\n const exit = (this.exit = animationState.setActive(\"exit\", !isPresent));\n if (onExitComplete && !isPresent) {\n exit.then(() => {\n /**\n * An exit can resolve after the element has re-entered, e.g.\n * when its final tick lands in the stop() of the enter.\n */\n if (this.exit !== exit)\n return;\n this.exit = 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, this.node);\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 { 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","\"use client\";\nimport { animations } from \"../../motion/features/animations\";\nimport { gestureAnimations } from \"../../motion/features/gestures\";\nimport { createDomVisualElement } from \"./create-visual-element\";\n/**\n * @public\n */\nexport const domAnimation = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n};\n//# sourceMappingURL=features-animation.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, 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","\"use client\";\nimport { drag } from \"../../motion/features/drag\";\nimport { layout } from \"../../motion/features/layout\";\nimport { domAnimation } from \"./features-animation\";\n/**\n * @public\n */\nexport const domMax = {\n ...domAnimation,\n ...drag,\n ...layout,\n};\n//# sourceMappingURL=features-max.js.map"],"names":["addUniqueItem","arr","item","indexOf","push","removeItem","index","splice","clamp","min","max","v","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","remove","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","x","lowerBound","upperBound","currentX","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","Math","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","frameData","delta","timestamp","isProcessing","now","clearTime","time","set","useManualTiming","performance","newTime","queueMicrotask","sanitize","round","checkStringStartsWith","token","key","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","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","hasFloat","RegExp","source","hasColor","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","hasComplexValues","asString","toString","analyseComplexValue","originalValue","values","indexes","var","types","replace","parsedValue","buildTransformer","numSections","output","convertToZero","splitBefore","complex","isNaN","createTransformer","info","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","Set","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","has","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","unitValue","mix","mixer","exec","mixUnit","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","state","runNextFrame","useDefaultElapsed","flagRunNextFrame","steps","acc","thisFrame","nextFrame","flushNextFrame","toKeepAlive","latestFrameData","triggerCallback","step","schedule","keepAlive","immediate","queue","cancel","delete","process","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","frame","cancelFrame","frameSteps","requestAnimationFrame","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","timeStep","maxDuration","keyframes","next","done","Infinity","springDefaults","granular","bounceToDampingRatio","bounce","overdampedFreqScale","dampingRatio","criticalFreqTime","root","slow","fast","exp","approximateRoot","freqTime","calcAngularFreq","undampedFreq","rootIterations","envelope","derivative","initialGuess","safeMin","isValidPhysics","canBeZero","resolvePhysics","getSpringOptions","options","validStiffness","stiffness","validDamping","damping","validMass","mass","springOptions","isResolvedFromDuration","isTimeDefined","visualDuration","PI","assign","exponentialDecay","e","f","criticalFreq","findSpring","spring","optionsOrVisualDuration","inheritVelocity","undampedAngularFreq","decay","s","restSpeed","restDelta","setRestThresholds","isGranularScale","abs","resolveSpring","resolveVelocity","angularFreq","A","sinC","cosC","env","cos","sample","C","dampedAngularFreq","limit","decayAt","rate","S","F","P","calculatedDuration","retarget","newVelocity","current","currentVelocity","easingDuration","toTransition","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","applyFriction","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","ease","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","offset","remaining","offsetProgress","fillOffset","keyframeValues","times","easingFunctions","isEasingArray","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","applyToOptions","generatorOptions","createGenerator","k","createGeneratorEasing","calcGeneratorVelocity","initialVelocity","resolveValue","prevT","getGeneratorVelocity","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","tween","replaceTransitionType","transition","resolveStartTime","startTime","baseRecord","kind","animation","frameTimestamp","frameIsProcessing","notifyAnimationStart","globalThis","__MOTION_INSPECT__","WithPromise","isResolved","finished","_finished","Promise","resolve","_resolve","updateFinished","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","isStopped","currentTime","holdTime","playbackSpeed","delayState","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","delay","onUpdate","pendingStartTime","timeWithoutDelay","isInDelayPhase","generate","isAnimationFinished","finish","at","sampleAt","resolved","elapsed","frameGenerator","currentIteration","floor","iterationProgress","reject","iterationDuration","driver","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","maxDefaults","applyDefaultFilter","name","slice","defaultValue","functionRegex","functions","join","mask","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","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","radToDeg","rad","angle","atan2","rebaseAngle","matrix2dParsers","atan","hypot","matrix3dParsers","defaultTransformValue","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","boxDependentValues","measureDimension","computed","measureBox","axis","paddingStart","paddingEnd","boxSizing","size","positionalValues","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","elementsToMeasure","elementsToUntransform","resolver","needsMeasurement","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","reset","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readOrigin","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","setStyle","isCSSVar","style","setProperty","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","cubicBezierAsString","d","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","onfinish","keyframe","updateMotionValue","commitStyles","isConnected","effect","getComputedTiming","Number","wasFinished","playbackRate","playState","newStartTime","onAttach","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampler","liveValue","setWithVelocity","sign","isAnimatable","makeAnimationInstant","acceleratedValues","browserColorFunctions","colorProperties","supportsWaapi","Element","supportsBrowserAnimation","subject","owner","HTMLElement","SVGElement","transformTemplate","getProps","hasBrowserOnlyColors","getValueAsType","translateAlias","numTransforms","buildTransform","latestValues","transformString","transformIsDefault","valueIsDefault","valueAsType","transformGroups","WeakMap","easingTolerance","byTime","spread","n","getOwner","getGroup","TransformAnimation","canAccelerate","isHandoff","hasOnUpdate","projection","isProjecting","canAccelerateTransform","js","group","isJS","isFinishing","release","isAccelerated","sync","timing","tracks","isNativeEasing","boundaries","offsets","iterationStart","numberAt","byKey","statics","keys","built","segments","needsBuild","isEnded","hasChurned","lastChurn","track","valuesAt","settled","compose","commit","shouldCommit","end","segment","isDone","some","oncancel","demote","jumpAt","change","mid","getEasing","moving","bounds","samples","ceil","concat","sort","position","shared","progressAt","first","changes","every","point","isStraight","depth","ends","getTween","run","nativeEasing","flatMap","cycle","cycleStart","looping","trackEnd","trackCycle","isHeld","phase","retime","builtTime","builtSpeed","wasHeld","trackTime","trackElapsed","trackRate","local","build","shouldBuild","churned","build_","isChurn","check","canReturn","createGroup","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","resolvedAt","canAnimateValue","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","useWaapi","isGroupedTransform","canGroupTransform","pendingTimeline","_onReject","finally","calcChildStagger","children","child","delayChildren","staggerChildren","staggerDirection","sortNodePosition","numChildren","maxStaggerDuration","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","notifyChange","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","_a","onChangeSubscribe","changeSubscriber","stopIfUnobserved","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","sampled","getCurrent","getPrevious","getVelocity","startAnimation","isComplete","animationComplete","clearAnimation","animationStart","animationCancel","isAnimating","destroy","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","orchestrationKeys","animateMotionValue","isTransitionDefined","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","splitCSSVariableRegex","getVariableValue","fallback","token1","token2","parseCSSVariable","getComputedStyle","getPropertyValue","trimmed","resolveVariantFromProps","props","custom","resolveFunction","def","getValueState","variants","resolveVariant","getTypeCustom","presenceContext","positionalKeys","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isKeyframesTarget","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","isBrowser","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","transitionEnd","defaultTransition","reduceMotion","animations","animationTypeState","animationState","getState","path","animateValues","animateVisualElement","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","setTarget","all","animateVariant","variant","getAnimation","getChildAnimations","variantChildren","when","dimensionValueTypes","findDimensionValueType","testValueType","isNone","invalidTemplates","DOMKeyframesResolver","canReadNow","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","measure","measureViewportBox","pageYOffset","measuredOrigin","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","cornerRadiusProps","isSVGElement","resolveElements","elementOrSelector","scope","selectorCache","EventTarget","elements","querySelectorAll","buildHTMLStyles","vars","transformOrigin","hasTransform","hasTransformOrigin","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","latest","isSVGTag","styleProp","viewBox","attrs","transformBox","spacing","useDashCase","buildSVGPath","convertBoundingBoxToBox","isIdentityScale","hasScale","has2DTranslate","is2DTranslate","scalePoint","originPoint","applyPointDelta","translate","boxScale","applyAxisDelta","applyBoxDelta","box","TREE_SCALE_SNAP_MIN","TREE_SCALE_SNAP_MAX","translateAxis","transformAxis","axisTranslate","axisScale","axisOrigin","resolveAxisTranslate","sourceBox","resolveBox","instance","transformPoint","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","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","WeakSet","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","resizeHandlers","observer","borderBoxAxis","svgAxis","htmlAxis","borderBoxSize","getBBox","getWidth","getHeight","notifyTarget","notifyAll","entries","resizeElement","ResizeObserver","elementHandlers","unobserve","windowCallbacks","windowResizeHandler","resizeWindow","innerWidth","innerHeight","resize","asNumber","createBox","visualElementStore","isAnimationControls","isVariantLabel","variantPriorityOrder","variantProps","isControllingVariants","isVariantNode","prefersReducedMotion","hasReducedMotionListener","propEventHandlers","featureDefinitions","setFeatureDefinitions","definitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","reducedMotionConfig","blockInitialAnimation","visualState","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","manuallyAnimateOnMount","initialMotionValues","mount","node","removeFromVariantTree","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","initPrefersReducedMotion","addChild","unmount","removeChild","feature","isMounted","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","unsubscribe","removeValueFromRenderState","getDefaultValue","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","childSubscription","textContent","renderHTML","elementStyle","applyProjectionStyles","scaleCorrectors","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","readTransformValue","computedStyle","camelCaseAttributes","tag","scrapeMotionValuesFromProps$1","charAt","toUpperCase","SVGVisualElement","defaultType","getAttribute","_styleProp","setAttribute","renderSVG","shallowCompare","prevLength","reversePriorityOrder","createAnimationState","createState","isInitialRender","wasReset","animateChanges","changedActiveType","isMounting","removedKeys","encounteredKeys","removedVariantIndex","typeState","ownProp","inheritedProp","prop","propIsVariant","activeDelta","isActive","isInherited","prevProp","prevResolvedValues","variantDidChange","checkVariantsDidChange","shouldAnimateType","handledRemovedValues","definitionList","resolvedValues","valueHasChanged","fallbackAnimation","resolvedInitial","fromInitial","fromProps","blockAnimation","setActive","setAnimateFunction","makeAnimator","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","pixelsToPercent","pixels","correctBorderRadius","correct","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","numBorders","mixedTransforms","numMixedTransforms","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","defaultScaleCorrectors","applyTo","boxShadow","globalProjectionState","hasAnimatedSinceResize","hasEverUpdated","transformAxes","id","resetDistortingTransform","sharedAnimationValues","demoteTransforms","cancelTreeOptimisedTransformAnimations","projectionNode","hasCheckedOptimisedAppear","MotionHasOptimisedAnimation","MotionCancelOptimisedAnimation","createProjectionNode","attachResizeListener","defaultParent","measureScroll","checkIsScrollRoot","resetTransform","animationId","animationCommitId","isTreeAnimating","isAnimationBlocked","isProjectionDirty","isSharedProjectionDirty","updateManuallyBlocked","updateBlockedByResize","isSVG","needsReset","shouldResetTransform","eventHandlers","hasTreeAnimated","updateScheduled","scheduleUpdate","projectionUpdateScheduled","checkUpdateFailed","clearAllSnapshots","updateProjection","nodes","propagateDirtyNodes","resolveTargetDelta","calcProjection","cleanDirtyNodes","resolvedRelativeTargetAt","hasProjected","isVisible","animationProgress","sharedNodes","notifyListeners","subscriptionManager","hasListeners","cancelDelay","resizeUnblockUpdate","newInnerWidth","timeout","checkElapsed","finishAnimation","registerSharedNode","addLayoutListener","hasLayoutListener","hasLayoutChanged","hasRelativeLayoutChanged","newLayout","relativeTarget","layoutTransition","defaultLayoutTransition","onLayoutAnimationStart","onLayoutAnimationComplete","hasTargetChanged","targetLayout","hasOnlyRelativeTargetChanged","layoutRoot","currentAnimation","animationOptions","setAnimationOrigin","isLead","willUpdate","stack","getStack","blockUpdate","unblockUpdate","isUpdateBlocked","startUpdate","resetSkewAndRotation","getTransformTemplate","shouldNotifyListeners","updateScroll","dragSnapshot","dragAncestor","prevTransformTemplateValue","wasBlockedByResize","forceLayoutMeasure","clearMeasurements","clearIsLayoutDirty","ensureDraggedNodesSnapshotted","syncRelativeLayout","resetTransformStyle","updateLayout","notifyLayoutUpdate","didUpdate","clearSnapshot","scheduleUpdateProjection","scheduleCheckAfterUnmount","measuredBox","alwaysMeasureLayout","prevLayout","layoutCorrected","layoutBox","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","layoutAnchor","createRelativeTarget","removeRelativeTarget","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","notifyLayoutAnimationStart","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","followDraggedAncestor","measuredLayout","axisSnapshot","snapAxis","layoutDelta","visualDelta","parentSnapshot","relativeSnapshot","onBeforeLayoutMeasure","userAgentContains","string","navigator","userAgent","roundPoint","maxDistance","DocumentProjectionNode","ref","documentElement","scrollLeft","body","scrollTop","rootProjectionNode","HTMLProjectionNode","documentNode","useCreateMotionContext","context","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","createHtmlRenderState","copyRawValuesOnly","useStyle","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","onTap","onTapStart","whileTap","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","exit","focus","tap","pan","inView","isInitialized","getInitializedFeatureDefinitions","initialFeatureDefinitions","initFeatureDefinitions","loadFeatures","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","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","createMinimalMotionComponent","MotionDiv","LazyMotion","setIsLoaded","useState","isLazyBundle","loadedRenderer","loadedFeatures","extractEventInfo","pageX","pageY","addPointerEvent","addPointerInfo","getContextWindow","ownerDocument","defaultView","overflowStyles","PanSession","handlers","contextWindow","dragSnapToOrigin","distanceThreshold","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","removeScrollListeners","onElementScroll","handleScroll","onWindowScroll","updatePoint","hasPendingMove","getPanInfo","history","isPanStarted","isDistancePastThreshold","xDelta","yDelta","distance2D","onStart","onMove","handlePointerMove","handlePointerUp","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","clientX","clientY","cursor","scalePositionWithinConstraints","boxProgress","sourceLength","targetLength","calcProgress","calcOrigin","addListeners","stopPointerListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","skipFirstCall","stopContainer","startResizeObservers","stopMeasureLayoutListener","stopResizeListener","stopLayoutUpdateListener","isFirst","asyncHandler","hasTakenAnySnapshot","layoutOptions","MeasureLayoutWithContext","componentDidMount","layoutGroup","switchLayoutGroup","register","safeToRemove","getSnapshotBeforeUpdate","componentDidUpdate","componentWillUnmount","promoteContext","deregister","subscribe","useId","usePresence","removePointerDownListener","onPointerDown","pointerDownEvent","session","createPanHandlers","onPanSessionStart","onPanStart","onPan","onPanEnd","removeGroupControls","controls","dragControls","prevDragControls","updateAnimationControlsSubscription","unmountControls","prevAnimate","prevIsPresent","handleHoverEvent","lifecycle","whileHover","handlePressEvent","HTMLButtonElement","disabled","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","observeIntersection","rootInteresectionObserver","lookupRoot","rootObservers","JSON","stringify","IntersectionObserver","initIntersectionObserver","thresholdNames","domAnimation","hasEnteredView","isInView","startObserver","stopObserver","viewport","rootMargin","amount","once","threshold","isIntersecting","onViewportEnter","onViewportLeave","prevViewport","hasViewportOptionChanged","globalTapTarget","propagate","_element","onFocus","isFocusVisible","onBlur","domMax"],"mappings":"uSAAA,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,MAAMC,EAAqB,CAAA,ECGrBC,EAAqBF,GAAM,+BAA+BG,KAAKH,GCH/DI,EAAYC,GAA2B,iBAAVA,GAAgC,OAAVA,ECGnDC,EAAqBN,GAAM,cAAcG,KAAKH,GCFpD,SAASO,EAAKC,GACV,IAAIC,EACJ,MAAO,UACYC,IAAXD,IACAA,EAASD,KACNC,EAEf,CCPA,MAAME,EAAQC,GAAQA,ECMhBC,EAAO,IAAIC,IAAiBA,EAAaC,OAAO,CAACC,EAAGC,IAAOjB,GAAMiB,EAAED,EAAEhB,KCCrEkB,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,OADAtC,EAAcmC,KAAKC,cAAeE,GAC3B,IAAMH,KAAKI,OA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