@squeletteapp/widget 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/array.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/clamp.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/format-error-message.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/errors.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/global-config.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/is-numerical-string.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/is-object.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/is-zero-value-string.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/memo.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/noop.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/pipe.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/progress.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/subscription-manager.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/time-conversion.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/velocity-per-second.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/warn-once.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/wrap.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/back.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/anticipate.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/circ.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/ease.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs", "../../../node_modules/.bun/motion-utils@12.23.6/node_modules/motion-utils/dist/es/easing/utils/map.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/frameloop/order.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/frameloop/render-step.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/frameloop/batcher.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/frameloop/frame.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/color/utils.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/color/hex.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/color/index.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/complex/index.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/mix/number.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/mix/color.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/mix/complex.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/mix/index.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/interpolate.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/render/dom/style-set.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/supports/flags.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/supports/memo.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/auto.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/test.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/dimensions.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/int.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/maps/number.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/index.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/frameloop/microtask.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs", "../../../node_modules/.bun/motion-dom@12.23.23/node_modules/motion-dom/dist/es/value/types/utils/find.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/sequence/create.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/store.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/utils/setters.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/value/use-will-change/is.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/projection/utils/measure.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/motion/features/definitions.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/projection/geometry/models.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/utils/is-browser.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/utils/variant-props.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/utils/motion-values.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/VisualElement.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/html/utils/render.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/object/ObjectVisualElement.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/svg/utils/render.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/animate/single-value.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/animate/subject.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs", "../../../node_modules/.bun/framer-motion@12.23.25+2f44e903108183df/node_modules/framer-motion/dist/es/animation/animate/index.mjs", "../../../node_modules/.bun/preact@10.27.2/node_modules/preact/dist/preact.module.js", "../../../node_modules/.bun/preact@10.27.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js", "../../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js", "../../widget-builder/src/utils/position.ts", "../../widget-builder/src/utils/animations.ts", "../../widget-builder/src/utils/dropdown-position.ts", "../../widget-builder/src/utils/fit-to-content.ts", "../../widget-builder/src/components/WidgetContainer.tsx", "../../widget-builder/src/components/ModalOverlay.tsx", "../../widget-builder/src/components/Widget.tsx", "../../widget-builder/src/utils/messaging.ts", "../../widget-builder/src/widget-element.ts", "../../widget-builder/src/create-widget.ts", "../src/changelog-entry.ts"],
4
+ "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", "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", "function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n", "import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (process.env.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n", "const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\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", "function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\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", "/*#__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", "/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\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 combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\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 @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n", "import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n", "/**\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", "/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n", "import { formatErrorMessage } from './format-error-message.mjs';\n\nconst warned = new Set();\nfunction hasWarned(message) {\n return warned.has(message);\n}\nfunction warnOnce(condition, message, errorCode) {\n if (condition || warned.has(message))\n return;\n console.warn(formatErrorMessage(message, errorCode));\n warned.add(message);\n}\n\nexport { hasWarned, warnOnce };\n", "const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n", "import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n", "// 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.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n", "// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\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", "import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\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", "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", "const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n", "import { wrap } from '../../wrap.mjs';\nimport { isEasingArray } from './is-easing-array.mjs';\n\nfunction getEasingForSegment(easing, i) {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\n}\n\nexport { getEasingForSegment };\n", "const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n", "import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeIn, easeInOut, easeOut } 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", "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", "import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\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 if (!queue.has(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 [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\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", "import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.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", "import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n", "import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n", "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\nexport { isCSSVariableName, isCSSVariableToken };\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", "// 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", "const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n", "function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\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", "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", "import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } 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", "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", "/*#__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", "import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } 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", "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", "const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n", "import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\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}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\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", "function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\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", "import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n", "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", "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", "import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n", "import { time } from '../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } 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", "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", "/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n", "import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n", "import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n", "const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\n\nexport { springDefaults };\n", "import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst 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}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n", "import { millisecondsToSeconds, secondsToMilliseconds, 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';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n", "import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n", "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", "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", "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", "function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n", "import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n", "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", "import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.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", "class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n", "import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.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 { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * 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 activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n this.driver?.start(false);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n this.updateTime(time.now());\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n", "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", "const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n", "/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n", "import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n", "import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n", "const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\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", "import { memo } from 'motion-utils';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== undefined);\n\nexport { supportsScrollTimeline };\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", "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", "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", "const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\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", "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", "import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { 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 if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\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 const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n", "function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\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", "import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n 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 else {\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 */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\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 if (!this.isPseudoElement) {\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 this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\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 Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, 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 return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n", "import { anticipate, backInOut, circInOut } 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", "import { secondsToMilliseconds } from 'motion-utils';\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 if (options.startTime) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read commited styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\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", "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 * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n", "function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n", "import { memo } from 'motion-utils';\n\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 // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n", "import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first commited frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element: resolvedOptions.motionValue.owner.current,\n })\n : new JSAnimation(resolvedOptions);\n animation.finished.then(() => this.notifyFinished()).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n", "class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n", "import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n", "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", "function getValueTransition(transition, key) {\n return (transition?.[key] ??\n transition?.[\"default\"] ??\n transition);\n}\n\nexport { getValueTransition };\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", "/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n", "/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\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", "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", "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", "import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n", "import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: 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", "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 radius: 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 // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: 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", "import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.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};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n", "import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (defaultValueType !== filter)\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", "import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n", "import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken } 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 { isNumOrPxType, positionalValues } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n", "function resolveElements(elementOrSelector, scope, selectorCache) {\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);\n}\n\nexport { resolveElements };\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", "import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n", "import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\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", "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", "const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n", "import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n", "function isDOMKeyframes(keyframes) {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\n}\n\nexport { isDOMKeyframes };\n", "import { resolveElements } from 'motion-dom';\nimport { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs';\n\nfunction resolveSubjects(subject, keyframes, scope, selectorCache) {\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache);\n }\n else if (subject instanceof NodeList) {\n return Array.from(subject);\n }\n else if (Array.isArray(subject)) {\n return subject;\n }\n else {\n return [subject];\n }\n}\n\nexport { resolveSubjects };\n", "function calculateRepeatDuration(duration, repeat, _repeatDelay) {\n return duration * (repeat + 1);\n}\n\nexport { calculateRepeatDuration };\n", "/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nfunction calcNextTime(current, next, prev, labels) {\n if (typeof next === \"number\") {\n return next;\n }\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next));\n }\n else if (next === \"<\") {\n return prev;\n }\n else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)));\n }\n else {\n return labels.get(next) ?? current;\n }\n}\n\nexport { calcNextTime };\n", "import { mixNumber } from 'motion-dom';\nimport { getEasingForSegment, removeItem } from 'motion-utils';\n\nfunction eraseKeyframes(sequence, startTime, endTime) {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i];\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe);\n // If we remove this item we have to push the pointer back one\n i--;\n }\n }\n}\nfunction addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime);\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n });\n }\n}\n\nexport { addKeyframes, eraseKeyframes };\n", "/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nfunction normalizeTimes(times, repeat) {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1);\n }\n}\n\nexport { normalizeTimes };\n", "function compareByTime(a, b) {\n if (a.at === b.at) {\n if (a.value === null)\n return 1;\n if (b.value === null)\n return -1;\n return 0;\n }\n else {\n return a.at - b.at;\n }\n}\n\nexport { compareByTime };\n", "import { isMotionValue, defaultOffset, isGenerator, createGeneratorEasing, fillOffset } from 'motion-dom';\nimport { progress, secondsToMilliseconds, invariant, getEasingForSegment } from 'motion-utils';\nimport { resolveSubjects } from '../animate/resolve-subjects.mjs';\nimport { calculateRepeatDuration } from './utils/calc-repeat-duration.mjs';\nimport { calcNextTime } from './utils/calc-time.mjs';\nimport { addKeyframes } from './utils/edit.mjs';\nimport { normalizeTimes } from './utils/normalize-times.mjs';\nimport { compareByTime } from './utils/sort.mjs';\n\nconst defaultSegmentEasing = \"easeInOut\";\nconst MAX_REPEAT = 20;\nfunction createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {\n const defaultDuration = defaultTransition.duration || 0.3;\n const animationDefinitions = new Map();\n const sequences = new Map();\n const elementCache = {};\n const timeLabels = new Map();\n let prevTime = 0;\n let currentTime = 0;\n let totalDuration = 0;\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i];\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime);\n continue;\n }\n else if (!Array.isArray(segment)) {\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\n continue;\n }\n let [subject, keyframes, transition = {}] = segment;\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);\n }\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0;\n const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = \"keyframes\", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay = typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay;\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length;\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"];\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100;\n if (numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)) {\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\n absoluteDelta = Math.abs(delta);\n }\n const springTransition = { ...remainingTransition };\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration);\n }\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);\n ease = springEasing.ease;\n duration = springEasing.duration;\n }\n duration ?? (duration = defaultDuration);\n const startTime = currentTime + calculatedDelay;\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1;\n }\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length;\n remainder > 0 && fillOffset(times, remainder);\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null);\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(repeat < MAX_REPEAT, \"Repeat count too high, must be less than 20\", \"repeat-count-high\");\n duration = calculateRepeatDuration(duration, repeat);\n const originalKeyframes = [...valueKeyframesAsList];\n const originalTimes = [...times];\n ease = Array.isArray(ease) ? [...ease] : [ease];\n const originalEase = [...ease];\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes);\n for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {\n times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));\n ease.push(keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(originalEase, keyframeIndex - 1));\n }\n }\n normalizeTimes(times, repeat);\n }\n const targetTime = startTime + duration;\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n };\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences);\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope, elementCache);\n const numSubjects = subjects.length;\n /**\n * For every element in this segment, process the defined values.\n */\n for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes;\n transition = transition;\n const thisSubject = subjects[subjectIndex];\n const subjectSequence = getSubjectSequence(thisSubject, sequences);\n for (const key in keyframes) {\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);\n }\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\n }\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key];\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime);\n const keyframes = [];\n const valueOffset = [];\n const valueEasing = [];\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i];\n keyframes.push(value);\n valueOffset.push(progress(0, totalDuration, at));\n valueEasing.push(easing || \"easeOut\");\n }\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0);\n keyframes.unshift(keyframes[0]);\n valueEasing.unshift(defaultSegmentEasing);\n }\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1);\n keyframes.push(null);\n }\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n });\n }\n const definition = animationDefinitions.get(element);\n definition.keyframes[key] = keyframes;\n definition.transition[key] = {\n ...defaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n };\n }\n });\n return animationDefinitions;\n}\nfunction getSubjectSequence(subject, sequences) {\n !sequences.has(subject) && sequences.set(subject, {});\n return sequences.get(subject);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\nfunction keyframesAsList(keyframes) {\n return Array.isArray(keyframes) ? keyframes : [keyframes];\n}\nfunction getValueTransition(transition, key) {\n return transition && transition[key]\n ? {\n ...transition,\n ...transition[key],\n }\n : { ...transition };\n}\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\n\nexport { createAnimationsFromSequence, getValueTransition };\n", "const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n", "const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n", "function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n", "import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n", "import { motionValue } from 'motion-dom';\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.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", "import { isMotionValue } from 'motion-dom';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\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", "/**\n * Convert camelCase to dash-case properties.\n */\nconst camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, \"$1-$2\").toLowerCase();\n\nexport { camelToDash };\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", "import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n", "const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n", "import { transformProps } from 'motion-dom';\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", "/**\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({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n\nexport { isTransitionDefined };\n", "import { getValueTransition, makeAnimationInstant, frame, JSAnimation, AsyncMotionValueAnimation } from 'motion-dom';\nimport { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations) {\n 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", "import { getValueTransition, frame, positionalKeys } from 'motion-dom';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\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 /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.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 Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\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", "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", "const 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};\nconst featureDefinitions = {};\nfor (const key in featureProps) {\n featureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n}\n\nexport { featureDefinitions };\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", "const isBrowser = typeof window !== \"undefined\";\n\nexport { isBrowser };\n", "// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n", "import { isBrowser } from '../is-browser.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\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 { initPrefersReducedMotion };\n", "function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\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", "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", "import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n", "import { isMotionValue, motionValue } from 'motion-dom';\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", "import { KeyframeResolver, time, frame, isMotionValue, cancelFrame, transformProps, motionValue, findValueType, complex, getAnimatableNone, microtask } from 'motion-dom';\nimport { warnOnce, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { featureDefinitions } from '../motion/features/definitions.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\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, 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 * 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 * 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.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 this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion =\n this.reducedMotionConfig === \"never\"\n ? false\n : this.reducedMotionConfig === \"always\"\n ? true\n : prefersReducedMotion.current;\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 this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\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 const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement };\n", "import { DOMKeyframesResolver, isMotionValue } from 'motion-dom';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n return props.style\n ? props.style[key]\n : 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", "import { transformPropOrder, getValueAsType, numberValueTypes } from 'motion-dom';\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 valueIsDefault = parseFloat(value) === 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 transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n", "import { transformProps, isCSSVariableName, getValueAsType, numberValueTypes } from 'motion-dom';\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", "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", "import { isCSSVariableName } from 'motion-dom';\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", "import { transformProps } from 'motion-dom';\nimport { scaleCorrectors } 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 };\n", "import { isMotionValue } from 'motion-dom';\nimport { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const { style } = props;\n const newValues = {};\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevProps.style &&\n isMotionValue(prevProps.style[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", "import { transformProps, defaultTransformValue, readTransformValue, isCSSVariableName } from 'motion-dom';\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 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", "import { createBox } from '../../projection/geometry/models.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nfunction isObjectKey(key, object) {\n return key in object;\n}\nclass ObjectVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.type = \"object\";\n }\n readValueFromInstance(instance, key) {\n if (isObjectKey(key, instance)) {\n const value = instance[key];\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n }\n return undefined;\n }\n getBaseTargetFromProps() {\n return undefined;\n }\n removeValueFromRenderState(key, renderState) {\n delete renderState.output[key];\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n build(renderState, latestValues) {\n Object.assign(renderState.output, latestValues);\n }\n renderInstance(instance, { output }) {\n Object.assign(instance, output);\n }\n sortInstanceNodePosition() {\n return 0;\n }\n}\n\nexport { ObjectVisualElement };\n", "import { px } from 'motion-dom';\n\nconst 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 */\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\n attrs[keys.offset] = px.transform(-offset);\n // Build the dash array\n const pathLength = px.transform(length);\n const pathSpacing = px.transform(spacing);\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\n}\n\nexport { buildSVGPath };\n", "import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\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 /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\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 };\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", "const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\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", "import { isMotionValue, transformPropOrder } from 'motion-dom';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n", "import { transformProps, getDefaultValueType } from 'motion-dom';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n 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", "import { isSVGElement, isSVGSVGElement } from 'motion-dom';\nimport { HTMLVisualElement } from '../../render/html/HTMLVisualElement.mjs';\nimport { ObjectVisualElement } from '../../render/object/ObjectVisualElement.mjs';\nimport { visualElementStore } from '../../render/store.mjs';\nimport { SVGVisualElement } from '../../render/svg/SVGVisualElement.mjs';\n\nfunction createDOMVisualElement(element) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n };\n const node = isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options);\n node.mount(element);\n visualElementStore.set(element, node);\n}\nfunction createObjectVisualElement(subject) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n };\n const node = new ObjectVisualElement(options);\n node.mount(subject);\n visualElementStore.set(subject, node);\n}\n\nexport { createDOMVisualElement, createObjectVisualElement };\n", "import { isMotionValue, motionValue } from 'motion-dom';\nimport { animateMotionValue } from '../interfaces/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", "import { isMotionValue } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { visualElementStore } from '../../render/store.mjs';\nimport { animateTarget } from '../interfaces/visual-element-target.mjs';\nimport { createDOMVisualElement, createObjectVisualElement } from '../utils/create-visual-element.mjs';\nimport { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs';\nimport { resolveSubjects } from './resolve-subjects.mjs';\nimport { animateSingleValue } from './single-value.mjs';\n\nfunction isSingleValue(subject, keyframes) {\n return (isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes)));\n}\n/**\n * Implementation\n */\nfunction animateSubject(subject, keyframes, options, scope) {\n const animations = [];\n if (isSingleValue(subject, keyframes)) {\n animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)\n ? keyframes.default || keyframes\n : keyframes, options ? options.default || options : options));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope);\n const numSubjects = subjects.length;\n invariant(Boolean(numSubjects), \"No valid elements provided.\", \"no-valid-elements\");\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i];\n invariant(thisSubject !== null, \"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.\", \"animate-null\");\n const createVisualElement = thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement;\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject);\n }\n const visualElement = visualElementStore.get(thisSubject);\n const transition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (\"delay\" in transition &&\n typeof transition.delay === \"function\") {\n transition.delay = transition.delay(i, numSubjects);\n }\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\n }\n }\n return animations;\n}\n\nexport { animateSubject };\n", "import { spring } from 'motion-dom';\nimport { createAnimationsFromSequence } from '../sequence/create.mjs';\nimport { animateSubject } from './subject.mjs';\n\nfunction animateSequence(sequence, options, scope) {\n const animations = [];\n const animationDefinitions = createAnimationsFromSequence(sequence, options, scope, { spring });\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition));\n });\n return animations;\n}\n\nexport { animateSequence };\n", "import { GroupAnimationWithThen } from 'motion-dom';\nimport { removeItem } from 'motion-utils';\nimport { animateSequence } from './sequence.mjs';\nimport { animateSubject } from './subject.mjs';\n\nfunction isSequence(value) {\n return Array.isArray(value) && value.some(Array.isArray);\n}\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nfunction createScopedAnimate(scope) {\n /**\n * Implementation\n */\n function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {\n let animations = [];\n let animationOnComplete;\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(subjectOrSequence, optionsOrKeyframes, scope);\n }\n else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {};\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete;\n }\n animations = animateSubject(subjectOrSequence, optionsOrKeyframes, rest, scope);\n }\n const animation = new GroupAnimationWithThen(animations);\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete);\n }\n if (scope) {\n scope.animations.push(animation);\n animation.finished.then(() => {\n removeItem(scope.animations, animation);\n });\n }\n return animation;\n }\n return scopedAnimate;\n}\nconst animate = createScopedAnimate();\n\nexport { animate, createScopedAnimate };\n", "var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,r,o,e={};for(o in u)\"key\"==o?i=u[o]:\"ref\"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return\"function\"==typeof n.type?S(n):null}function C(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!$.__r++||r!=l.debounceRendering)&&((r=l.debounceRendering)||o)($)}function $(){for(var n,u,t,r,o,f,c,s=1;i.length;)i.length>s&&i.sort(e),n=i.shift(),s=i.length,n.__d&&(t=void 0,r=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N(f,t,c),r.__e=r.__=null,t.__e!=o&&C(t)));$.__r=0}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_,m=t&&t.__k||v,b=l.length;for(f=P(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p:m[y.__i]||p,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),(_=!!(4&y.__u))||h.__k===y.__k?f=A(y,f,n,_):\"function\"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&\"boolean\"!=typeof o&&\"function\"!=typeof o?(f=r+h,(o=n.__k[r]=\"string\"==typeof o||\"number\"==typeof o||\"bigint\"==typeof o||o.constructor==String?m(null,o,null,null,null):w(o)?m(k,{children:o},null,null,null):null==o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),\"function\"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D(e,e));return t}function A(n,l,u,t){var i,r;if(\"function\"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=A(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8==l.nodeType);return l}function H(n,l){return l=l||[],null==n||\"boolean\"==typeof n||(w(n)?n.some(function(n){H(n,l)}):l.push(n)),l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function T(n,l,u){\"-\"==l[0]?n.setProperty(l,null==u?\"\":u):n[l]=null==u?\"\":\"number\"!=typeof u||y.test(l)?u:u+\"px\"}function j(n,l,u,t,i){var r,o;n:if(\"style\"==l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof t&&(n.style.cssText=t=\"\"),t)for(l in t)u&&l in u||T(n.style,l,\"\");if(u)for(l in u)t&&u[l]==t[l]||T(n.style,l,u[l])}else if(\"o\"==l[0]&&\"n\"==l[1])r=l!=(l=l.replace(f,\"$1\")),o=l.toLowerCase(),l=o in n||\"onFocusOut\"==l||\"onFocusIn\"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if(\"http://www.w3.org/2000/svg\"==i)l=l.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(\"width\"!=l&&\"height\"!=l&&\"href\"!=l&&\"list\"!=l&&\"form\"!=l&&\"tabIndex\"!=l&&\"download\"!=l&&\"rowSpan\"!=l&&\"colSpan\"!=l&&\"role\"!=l&&\"popover\"!=l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null==u||!1===u&&\"-\"!=l[4]?n.removeAttribute(l):n.setAttribute(l,\"popover\"==l&&1==u?\"\":u))}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if(\"function\"==typeof j)try{if(b=u.props,S=\"prototype\"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=E),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k&&null==a.key&&(L=V(a.props.children)),f=I(n,w(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f}else{for(T=o.length;T--;)g(o[T]);z(u)}else u.__e=t.__e,u.__k=t.__k,n.then||z(u);l.__e(n,u,t)}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q(t.__e,u,t,i,r,o,e,c,s);return(a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(z)}function N(n,u,t){for(var i=0;i<t.length;i++)B(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function V(n){return\"object\"!=typeof n||null==n||n.__b&&n.__b>0?n:w(n)?n.map(V):d({},n)}function q(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if(\"svg\"==x?o=\"http://www.w3.org/2000/svg\":\"math\"==x?o=\"http://www.w3.org/1998/Math/MathML\":o||(o=\"http://www.w3.org/1999/xhtml\"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&\"setAttribute\"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(t,e),c=!1),e=null}if(null==x)b===k||c&&u.data==k||(u.data=k);else{if(e=e&&n.call(u.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],\"children\"==a);else if(\"dangerouslySetInnerHTML\"==a)v=d;else if(!(a in k)){if(\"value\"==a&&\"defaultValue\"in k||\"checked\"==a&&\"defaultChecked\"in k)continue;j(u,a,null,d,o)}for(a in k)d=k[a],\"children\"==a?y=d:\"dangerouslySetInnerHTML\"==a?h=d:\"value\"==a?_=d:\"checked\"==a?m=d:c&&\"function\"!=typeof d||b[a]===d||j(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=\"\"),I(\"template\"==t.type?u.content:u,w(y)?y:[y],t,i,r,\"foreignObject\"==x?\"http://www.w3.org/1999/xhtml\":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a=\"value\",\"progress\"==x&&null==_?u.removeAttribute(\"value\"):null!=_&&(_!==u[a]||\"progress\"==x&&!_||\"option\"==x&&_!=b[a])&&j(u,a,_,b[a],o),a=\"checked\",null!=m&&m!=u[a]&&j(u,a,m,b[a],o))}return u}function B(n,u,t){try{if(\"function\"==typeof n){var i=\"function\"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function D(n,u,t){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D(i[r],u,t||\"function\"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0}function E(n,l,u){return this.constructor(n,u)}function G(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l.__&&l.__(u,t),o=(r=\"function\"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],O(t,u=(!r&&i||t).__k=_(k,null,[u]),o||p,p,t.namespaceURI,!r&&i?[i]:o?null:t.firstChild?n.call(t.childNodes):null,e,!r&&i?i:o?o.__e:t.firstChild,r,f),N(e,u,f)}function J(n,l){G(n,l,J)}function K(l,u,t){var i,r,o,e,f=d({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)\"key\"==o?i=u[o]:\"ref\"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function Q(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}return l.__c=\"__cC\"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d({},this.state),\"function\"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=F(!1),a=F(!0),h=0;export{x as Component,k as Fragment,K as cloneElement,Q as createContext,_ as createElement,b as createRef,_ as h,J as hydrate,t as isValidElement,l as options,G as render,H as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n", "import{options as r,Fragment as e}from\"preact\";export{Fragment}from\"preact\";var t=/[\"&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o=\"\",f=\"\";n<r.length;n++){switch(r.charCodeAt(n)){case 34:f=\"&quot;\";break;case 38:f=\"&amp;\";break;case 60:f=\"&lt;\";break;default:continue}n!==e&&(o+=r.slice(e,n)),o+=f,e=n+1}return n!==e&&(o+=r.slice(e,n)),o}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=0,i=Array.isArray;function u(e,t,n,o,i,u){t||(t={});var a,c,p=t;if(\"ref\"in p)for(c in p={},t)\"ref\"==c?a=t[c]:p[c]=t[c];var l={type:e,props:p,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--f,__i:-1,__u:0,__source:i,__self:u};if(\"function\"==typeof e&&(a=e.defaultProps))for(c in a)void 0===p[c]&&(p[c]=a[c]);return r.vnode&&r.vnode(l),l}function a(r){var t=u(e,{tpl:r,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t}var c={},p=/[A-Z]/g;function l(e,t){if(r.attr){var f=r.attr(e,t);if(\"string\"==typeof f)return f}if(t=function(r){return null!==r&&\"object\"==typeof r&&\"function\"==typeof r.valueOf?r.valueOf():r}(t),\"ref\"===e||\"key\"===e)return\"\";if(\"style\"===e&&\"object\"==typeof t){var i=\"\";for(var u in t){var a=t[u];if(null!=a&&\"\"!==a){var l=\"-\"==u[0]?u:c[u]||(c[u]=u.replace(p,\"-$&\").toLowerCase()),s=\";\";\"number\"!=typeof a||l.startsWith(\"--\")||o.test(l)||(s=\"px;\"),i=i+l+\":\"+a+s}}return e+'=\"'+n(i)+'\"'}return null==t||!1===t||\"function\"==typeof t||\"object\"==typeof t?\"\":!0===t?e:e+'=\"'+n(\"\"+t)+'\"'}function s(r){if(null==r||\"boolean\"==typeof r||\"function\"==typeof r)return null;if(\"object\"==typeof r){if(void 0===r.constructor)return r;if(i(r)){for(var e=0;e<r.length;e++)r[e]=s(r[e]);return r}}return n(\"\"+r)}export{u as jsx,l as jsxAttr,u as jsxDEV,s as jsxEscape,a as jsxTemplate,u as jsxs};\n//# sourceMappingURL=jsxRuntime.module.js.map\n", "import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=n,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){if(\"function\"==typeof n){var r=n(t());return function(){n(null),r&&\"function\"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=p(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function j(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],c.__e(t,n.__v)}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k=\"function\"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return\"function\"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,y as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,h as useReducer,A as useRef,d as useState};\n//# sourceMappingURL=hooks.module.js.map\n", "/**\n * Position utilities\n * Functions to calculate modal positioning based on position type\n */\n\nimport type { Position } from '../types';\n\n/**\n * Get CSS styles for positioning a modal\n * @param position - The desired position on screen\n * @returns CSS style object with positioning properties\n */\nexport function getPositionStyles(position: Position = 'center'): Record<string, string> {\n const positions: Record<Position, Record<string, string>> = {\n center: {\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n n: {\n top: '20px',\n left: '50%',\n transform: 'translateX(-50%)',\n },\n s: {\n bottom: '20px',\n left: '50%',\n transform: 'translateX(-50%)',\n },\n e: {\n right: '20px',\n top: '50%',\n transform: 'translateY(-50%)',\n },\n w: {\n left: '20px',\n top: '50%',\n transform: 'translateY(-50%)',\n },\n ne: {\n top: '20px',\n right: '20px',\n },\n nw: {\n top: '20px',\n left: '20px',\n },\n se: {\n bottom: '20px',\n right: '20px',\n },\n sw: {\n bottom: '20px',\n left: '20px',\n },\n };\n\n return positions[position] || positions.center;\n}\n", "/**\n * Animation Utilities\n * Provides different animation styles for modal open/close transitions\n */\n\nimport type { Position } from '../types';\n\n/**\n * Available animation types\n * - slide-spring: Directional slide with spring timing\n * - slide-linear: Directional slide with linear timing\n * - scale-spring: Scale animation with spring timing\n * - scale-linear: Scale animation with linear timing\n */\nexport type AnimationType = 'slide-spring' | 'slide-linear' | 'scale-spring' | 'scale-linear';\n\n/**\n * Animation style configuration returned by getAnimationStyle\n */\nexport type AnimationStyle = {\n /** CSS transform value */\n transform: string;\n /** CSS transition value */\n transition: string;\n};\n\n/**\n * Get directional slide transform based on position\n * Slides from the edge the modal is positioned at\n */\nfunction getSlideTransform(position: Position, isVisible: boolean): string {\n const slideDistance = '20px';\n\n const slideTransforms: Record<Position, { hidden: string; visible: string }> = {\n // Right side - slide from right\n e: { hidden: `translateY(-50%) translateX(${slideDistance})`, visible: 'translateY(-50%)' },\n ne: { hidden: `translateX(${slideDistance})`, visible: '' },\n se: { hidden: `translateX(${slideDistance})`, visible: '' },\n\n // Left side - slide from left\n w: { hidden: `translateY(-50%) translateX(-${slideDistance})`, visible: 'translateY(-50%)' },\n nw: { hidden: `translateX(-${slideDistance})`, visible: '' },\n sw: { hidden: `translateX(-${slideDistance})`, visible: '' },\n\n // Top - slide from top\n n: { hidden: `translateX(-50%) translateY(-${slideDistance})`, visible: 'translateX(-50%)' },\n\n // Bottom/center - slide from bottom\n s: { hidden: `translateX(-50%) translateY(${slideDistance})`, visible: 'translateX(-50%)' },\n center: { hidden: `translate(-50%, calc(-50% + ${slideDistance}))`, visible: 'translate(-50%, -50%)' },\n };\n\n const slide = slideTransforms[position];\n return isVisible ? slide.visible : slide.hidden;\n}\n\n/**\n * Get scale transform based on position (accounts for centering transforms)\n */\nfunction getScaleTransform(position: Position, isVisible: boolean): string {\n const scale = isVisible ? 1 : 0.95;\n\n // Position-specific transforms to maintain proper positioning\n const positionTransforms: Record<Position, string> = {\n e: 'translateY(-50%)',\n w: 'translateY(-50%)',\n n: 'translateX(-50%)',\n s: 'translateX(-50%)',\n ne: '',\n nw: '',\n se: '',\n sw: '',\n center: 'translate(-50%, -50%)',\n };\n\n const positionTransform = positionTransforms[position];\n return positionTransform ? `${positionTransform} scale(${scale})` : `scale(${scale})`;\n}\n\n/**\n * Get CSS transition string for spring animation\n * Uses cubic-bezier for spring-like effect\n */\nfunction getSpringTransition(): string {\n // Spring-like cubic bezier curve\n return 'opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)';\n}\n\n/**\n * Get CSS transition string for linear animation\n */\nfunction getLinearTransition(): string {\n return 'opacity 0.3s ease-out, transform 0.3s ease-out';\n}\n\n/**\n * Get animation style based on animation type and state\n * Returns the transform and transition CSS properties\n */\nexport function getAnimationStyle(\n animationType: AnimationType,\n position: Position,\n isVisible: boolean,\n hasAnimated: boolean\n): AnimationStyle {\n let transform: string;\n let transition: string;\n\n // Determine transform based on animation type\n if (animationType === 'slide-spring' || animationType === 'slide-linear') {\n transform = getSlideTransform(position, isVisible && hasAnimated);\n } else {\n // scale-spring or scale-linear\n transform = getScaleTransform(position, isVisible && hasAnimated);\n }\n\n // Determine transition based on animation type\n if (animationType === 'slide-spring' || animationType === 'scale-spring') {\n transition = getSpringTransition();\n } else {\n transition = getLinearTransition();\n }\n\n return { transform, transition };\n}\n", "/**\n * Dropdown Position Utilities\n * Functions to calculate dropdown positioning relative to an anchor element\n */\n\nimport type { DropdownPosition } from '../types';\n\nexport type DropdownPositionResult = {\n top: number;\n left: number;\n};\n\n/**\n * Calculate dropdown position relative to anchor element\n * @param anchor - The anchor element to position relative to\n * @param dropdown - The dropdown element (for size calculations)\n * @param position - Desired position relative to anchor\n * @param offset - Gap between anchor and dropdown in pixels\n * @returns Absolute position coordinates\n */\nexport function getDropdownPosition(\n anchor: Element,\n dropdown: { width: number; height: number },\n position: DropdownPosition = 's',\n offset = 8\n): DropdownPositionResult {\n const anchorRect = anchor.getBoundingClientRect();\n const scrollX = window.scrollX;\n const scrollY = window.scrollY;\n\n // Anchor dimensions and position (accounting for scroll)\n const anchorTop = anchorRect.top + scrollY;\n const anchorLeft = anchorRect.left + scrollX;\n const anchorWidth = anchorRect.width;\n const anchorHeight = anchorRect.height;\n const anchorCenterX = anchorLeft + anchorWidth / 2;\n const anchorCenterY = anchorTop + anchorHeight / 2;\n\n // Dropdown dimensions\n const dropdownWidth = dropdown.width;\n const dropdownHeight = dropdown.height;\n\n let top: number;\n let left: number;\n\n switch (position) {\n // Below anchor\n case 's':\n top = anchorTop + anchorHeight + offset;\n left = anchorCenterX - dropdownWidth / 2;\n break;\n case 'sw':\n top = anchorTop + anchorHeight + offset;\n left = anchorLeft;\n break;\n case 'se':\n top = anchorTop + anchorHeight + offset;\n left = anchorLeft + anchorWidth - dropdownWidth;\n break;\n\n // Above anchor\n case 'n':\n top = anchorTop - dropdownHeight - offset;\n left = anchorCenterX - dropdownWidth / 2;\n break;\n case 'nw':\n top = anchorTop - dropdownHeight - offset;\n left = anchorLeft;\n break;\n case 'ne':\n top = anchorTop - dropdownHeight - offset;\n left = anchorLeft + anchorWidth - dropdownWidth;\n break;\n\n // Right of anchor\n case 'e':\n top = anchorCenterY - dropdownHeight / 2;\n left = anchorLeft + anchorWidth + offset;\n break;\n\n // Left of anchor\n case 'w':\n top = anchorCenterY - dropdownHeight / 2;\n left = anchorLeft - dropdownWidth - offset;\n break;\n\n default:\n // Default to south\n top = anchorTop + anchorHeight + offset;\n left = anchorCenterX - dropdownWidth / 2;\n }\n\n return { top, left };\n}\n\n/**\n * Get slide animation transform for dropdown based on position\n * Slides from the direction opposite to where the dropdown appears\n */\nexport function getDropdownSlideTransform(\n position: DropdownPosition,\n isVisible: boolean\n): string {\n const slideDistance = '10px';\n\n if (isVisible) {\n return 'translate(0, 0)';\n }\n\n // Slide from opposite direction\n switch (position) {\n // Below anchor - slide down from above\n case 's':\n case 'sw':\n case 'se':\n return `translate(0, -${slideDistance})`;\n\n // Above anchor - slide up from below\n case 'n':\n case 'nw':\n case 'ne':\n return `translate(0, ${slideDistance})`;\n\n // Right of anchor - slide right from left\n case 'e':\n return `translate(-${slideDistance}, 0)`;\n\n // Left of anchor - slide left from right\n case 'w':\n return `translate(${slideDistance}, 0)`;\n\n default:\n return `translate(0, -${slideDistance})`;\n }\n}\n\n/**\n * Get scale animation transform for dropdown\n */\nexport function getDropdownScaleTransform(isVisible: boolean): string {\n return isVisible ? 'scale(1)' : 'scale(0.95)';\n}\n", "/**\n * Fit to Content Utilities\n * Handles automatic resizing of widget to match iframe content size via postMessage\n */\n\n/** Message type for dimension changes from iframe */\nexport type ChangeDimensionsMessage = {\n type: 'CHANGE_DIMENSIONS';\n payload: {\n width: number;\n height: number;\n };\n /** Source identifier to scope messages to specific widgets */\n source?: string;\n};\n\n/** Check if a message is a change dimensions message */\nfunction isChangeDimensionsMessage(data: unknown): data is ChangeDimensionsMessage {\n return (\n typeof data === 'object' &&\n data !== null &&\n (data as ChangeDimensionsMessage).type === 'CHANGE_DIMENSIONS' &&\n typeof (data as ChangeDimensionsMessage).payload?.width === 'number' &&\n typeof (data as ChangeDimensionsMessage).payload?.height === 'number'\n );\n}\n\n/**\n * Listen for dimension change messages from iframe\n *\n * The iframe content must send dimension updates via postMessage:\n * ```js\n * window.parent.postMessage({\n * type: 'CHANGE_DIMENSIONS',\n * payload: { width: document.body.scrollWidth, height: document.body.scrollHeight },\n * source: window.location.href\n * }, '*');\n * ```\n *\n * @param onSizeChange - Callback when size changes\n * @param expectedSource - Optional source URL to filter messages (only accept messages from this source)\n * @returns Cleanup function\n */\nexport function listenToDimensionChanges(\n onSizeChange: (size: { width: number; height: number }) => void,\n expectedSource?: string\n): () => void {\n const handleMessage = (event: MessageEvent) => {\n if (isChangeDimensionsMessage(event.data)) {\n // If expectedSource is provided, only accept messages from that source\n if (expectedSource && event.data.source !== expectedSource) {\n return;\n }\n onSizeChange(event.data.payload);\n }\n };\n\n window.addEventListener('message', handleMessage);\n return () => window.removeEventListener('message', handleMessage);\n}\n", "/**\n * Widget Container Component\n * Unified animated container with iframe - works as modal or dropdown\n */\n\nimport type { FunctionComponent } from 'preact';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport type { Position, AnimationType } from '../types';\nimport { getPositionStyles } from '../utils/position';\nimport { getAnimationStyle } from '../utils/animations';\nimport { getDropdownPosition, getDropdownSlideTransform, getDropdownScaleTransform } from '../utils/dropdown-position';\nimport { listenToDimensionChanges } from '../utils/fit-to-content';\n\ntype WidgetContainerProps = {\n /** Whether the widget is visible (for animations) */\n visible: boolean;\n /** Whether the widget should be rendered (visible or preloaded) */\n shouldRender: boolean;\n /** Iframe source URL */\n source: string;\n /** Position on screen (modal) or relative to anchor (dropdown) */\n position: Position;\n /** Anchor element - if provided, positions relative to it (dropdown mode) */\n anchorElement?: Element;\n /** Gap between anchor and widget (only for dropdown mode) */\n offset: number;\n /** Custom CSS styles */\n style?: Record<string, string | number>;\n /** Z-index for the widget */\n zIndex: number;\n /** Animation type */\n animation: AnimationType;\n /** Whether to auto-resize to fit iframe content */\n fitToContent: boolean;\n /** Callback when iframe is loaded */\n onIframeLoad?: (iframe: HTMLIFrameElement) => void;\n /** Callback to expose widget element for imperative animations */\n onWidgetReady?: (widgetElement: HTMLDivElement) => void;\n};\n\n/**\n * Get animation styles for dropdown mode\n */\nfunction getDropdownAnimationStyles(\n animation: AnimationType,\n position: Position,\n isVisible: boolean,\n hasAnimated: boolean\n): { transform: string; transition: string } {\n const effectiveVisible = isVisible && hasAnimated;\n\n let transform: string;\n if (animation === 'slide-spring' || animation === 'slide-linear') {\n transform = getDropdownSlideTransform(position as Exclude<Position, 'center'>, effectiveVisible);\n } else {\n transform = getDropdownScaleTransform(effectiveVisible);\n }\n\n const transition =\n animation === 'slide-spring' || animation === 'scale-spring'\n ? 'opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)'\n : 'opacity 0.15s ease-out, transform 0.15s ease-out';\n\n return { transform, transition };\n}\n\n/**\n * Unified widget container - modal or dropdown based on anchor presence\n */\nexport const WidgetContainer: FunctionComponent<WidgetContainerProps> = ({\n visible,\n shouldRender,\n source,\n position,\n anchorElement,\n offset,\n style,\n zIndex,\n animation,\n fitToContent,\n onIframeLoad,\n onWidgetReady,\n}) => {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const widgetRef = useRef<HTMLDivElement>(null);\n const [hasAnimated, setHasAnimated] = useState(false);\n const [dropdownCoords, setDropdownCoords] = useState({ top: 0, left: 0 });\n const [contentSize, setContentSize] = useState<{ width: number; height: number } | null>(null);\n\n const isDropdownMode = Boolean(anchorElement);\n\n\n // Determine dimensions: fitToContent overrides style dimensions\n const baseWidth = (style?.width as number | string) || (isDropdownMode ? 320 : 480);\n const baseHeight = (style?.height as number | string) || (isDropdownMode ? 400 : 600);\n\n const width = fitToContent && contentSize ? contentSize.width : baseWidth;\n const height = fitToContent && contentSize ? contentSize.height : baseHeight;\n\n const numericWidth = typeof width === 'number' ? width : parseInt(width, 10) || 320;\n const numericHeight = typeof height === 'number' ? height : parseInt(height, 10) || 400;\n\n // Listen for dimension changes from iframe when fitToContent is enabled\n useEffect(() => {\n if (!fitToContent || !shouldRender) return;\n\n return listenToDimensionChanges((size) => {\n setContentSize(size);\n }, source);\n }, [fitToContent, shouldRender, source]);\n\n // Update dropdown position\n const updateDropdownPosition = () => {\n if (!anchorElement) return;\n\n const newCoords = getDropdownPosition(\n anchorElement,\n { width: numericWidth, height: numericHeight },\n position as Exclude<Position, 'center'>,\n offset\n );\n setDropdownCoords(newCoords);\n };\n\n // Position updates for dropdown mode\n useEffect(() => {\n if (!shouldRender || !isDropdownMode) return;\n\n updateDropdownPosition();\n\n const handleUpdate = () => updateDropdownPosition();\n window.addEventListener('scroll', handleUpdate, true);\n window.addEventListener('resize', handleUpdate);\n\n return () => {\n window.removeEventListener('scroll', handleUpdate, true);\n window.removeEventListener('resize', handleUpdate);\n };\n }, [shouldRender, anchorElement, position, offset, numericWidth, numericHeight]);\n\n // Notify parent when iframe loads\n useEffect(() => {\n const iframe = iframeRef.current;\n if (!iframe) return;\n\n const handleLoad = () => onIframeLoad?.(iframe);\n iframe.addEventListener('load', handleLoad);\n return () => iframe.removeEventListener('load', handleLoad);\n }, [onIframeLoad]);\n\n // Notify parent when widget element is ready\n useEffect(() => {\n const widget = widgetRef.current;\n if (widget) onWidgetReady?.(widget);\n }, [onWidgetReady]);\n\n // Trigger animation after initial render and handle closing animation\n useEffect(() => {\n if (visible && !hasAnimated) {\n requestAnimationFrame(() => setHasAnimated(true));\n }\n }, [visible, hasAnimated]);\n\n if (!shouldRender) return null;\n\n // Compute styles based on mode\n let positioningStyles: Record<string, string | number>;\n let animationStyles: { transform: string; transition: string };\n\n if (isDropdownMode) {\n // Dropdown mode: absolute positioning relative to anchor\n positioningStyles = {\n position: 'absolute',\n top: `${dropdownCoords.top}px`,\n left: `${dropdownCoords.left}px`,\n };\n animationStyles = getDropdownAnimationStyles(animation, position, visible, hasAnimated);\n } else {\n // Modal mode: fixed positioning on viewport\n const modalPositionStyles = getPositionStyles(position);\n const { transform: _, ...positionStylesWithoutTransform } = modalPositionStyles;\n positioningStyles = {\n position: 'fixed',\n ...positionStylesWithoutTransform,\n };\n animationStyles = getAnimationStyle(animation, position, visible, hasAnimated);\n }\n\n // Build final styles, excluding width/height from style prop if fitToContent\n const { width: _w, height: _h, ...styleWithoutDimensions } = style || {};\n const finalStyle = fitToContent ? styleWithoutDimensions : style;\n\n return (\n <div\n ref={widgetRef}\n style={{\n ...positioningStyles,\n zIndex,\n width,\n height,\n maxWidth: isDropdownMode ? undefined : '95vw',\n maxHeight: isDropdownMode ? undefined : '95vh',\n borderRadius: 8,\n boxShadow: isDropdownMode\n ? '0 4px 16px rgba(0, 0, 0, 0.12)'\n : '0 2px 8px rgba(0, 0, 0, 0.1)',\n transform: animationStyles.transform,\n transition: fitToContent\n ? `${animationStyles.transition}, width 0.2s ease-out, height 0.2s ease-out`\n : animationStyles.transition,\n ...finalStyle,\n // These must come after finalStyle to prevent overrides\n pointerEvents: visible ? 'auto' : 'none',\n opacity: hasAnimated && visible ? 1 : 0,\n }}\n >\n <iframe\n ref={iframeRef}\n src={source}\n style={{\n border: 'none',\n width: '100%',\n height: '100%',\n borderRadius: 'inherit',\n }}\n title=\"Widget\"\n />\n </div>\n );\n};\n", "/**\n * Modal Overlay Component\n * Animated backdrop using CSS transitions\n */\n\nimport type { FunctionComponent } from 'preact';\n\ntype ModalOverlayProps = {\n /** Whether the overlay is visible */\n visible: boolean;\n /** Click handler for closing when clicking overlay */\n onClick?: () => void;\n /** Z-index for the overlay */\n zIndex: number;\n};\n\n/**\n * Animated overlay backdrop\n * Fades in/out with CSS transitions\n */\nexport const ModalOverlay: FunctionComponent<ModalOverlayProps> = ({ visible, onClick, zIndex }) => {\n if (!visible) return null;\n\n return (\n <div\n onClick={onClick}\n style={{\n position: 'fixed',\n inset: '0',\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n zIndex: zIndex - 1,\n animation: 'fadeIn 0.2s ease-out',\n }}\n />\n );\n};\n", "/**\n * Widget Component\n * Main Preact component - works as modal (with overlay) or dropdown (anchored)\n */\n\nimport type { FunctionComponent } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { WidgetContainer } from './WidgetContainer';\nimport { ModalOverlay } from './ModalOverlay';\nimport type { Position, AnimationType } from '../types';\n\ntype WidgetProps = {\n /** Iframe source URL */\n source: string;\n /** Position on screen (modal) or relative to anchor (dropdown) */\n position: Position;\n /** Anchor element - if provided, positions relative to it (dropdown mode) */\n anchorElement?: Element;\n /** Gap between anchor and widget (only for dropdown mode) */\n offset: number;\n /** Custom CSS styles */\n style?: Record<string, string | number>;\n /** Whether to show overlay backdrop (only for modal mode) */\n overlay: boolean;\n /** Z-index for the widget */\n zIndex: number;\n /** Animation type */\n animation: AnimationType;\n /** Whether to close on click outside (dropdown mode) */\n closeOnClickOutside: boolean;\n /** Whether to auto-resize to fit iframe content */\n fitToContent: boolean;\n /** Callback when iframe is loaded */\n onIframeLoad?: (iframe: HTMLIFrameElement) => void;\n /** Callback when widget element is ready */\n onWidgetReady?: (widgetElement: HTMLDivElement) => void;\n /** Callback when widget opens/closes */\n onOpenChange?: (isOpen: boolean) => void;\n /** External control for open state */\n isOpen?: boolean;\n /** External control for preload state */\n isPreloaded?: boolean;\n};\n\n/**\n * Main widget component\n * Modal mode: overlay + fixed positioning\n * Dropdown mode: click-outside-to-close + anchor-relative positioning\n */\nexport const Widget: FunctionComponent<WidgetProps> = ({\n source,\n position,\n anchorElement,\n offset,\n style,\n overlay,\n zIndex,\n animation,\n closeOnClickOutside,\n fitToContent,\n onIframeLoad,\n onWidgetReady,\n onOpenChange,\n isOpen = false,\n isPreloaded = false,\n}) => {\n const shouldRender = isOpen || isPreloaded;\n const isDropdownMode = Boolean(anchorElement);\n\n // Handle overlay click to close (modal mode)\n const handleOverlayClick = () => {\n if (overlay && !isDropdownMode) {\n onOpenChange?.(false);\n }\n };\n\n // Handle click outside to close (dropdown mode)\n useEffect(() => {\n if (!isOpen || !isDropdownMode || !closeOnClickOutside) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n const target = event.target as Node;\n\n // Don't close if clicking the anchor\n if (anchorElement?.contains(target)) {\n return;\n }\n\n onOpenChange?.(false);\n };\n\n // Delay to avoid immediate close from the click that opened it\n const timeoutId = setTimeout(() => {\n document.addEventListener('click', handleClickOutside, true);\n }, 0);\n\n return () => {\n clearTimeout(timeoutId);\n document.removeEventListener('click', handleClickOutside, true);\n };\n }, [isOpen, isDropdownMode, closeOnClickOutside, anchorElement, onOpenChange]);\n\n return (\n <>\n {/* Overlay only for modal mode */}\n {!isDropdownMode && overlay && (\n <ModalOverlay visible={isOpen} onClick={handleOverlayClick} zIndex={zIndex} />\n )}\n <WidgetContainer\n visible={isOpen}\n shouldRender={shouldRender}\n source={source}\n position={position}\n anchorElement={anchorElement}\n offset={offset}\n style={style}\n zIndex={zIndex}\n animation={animation}\n fitToContent={fitToContent}\n onIframeLoad={onIframeLoad}\n onWidgetReady={onWidgetReady}\n />\n </>\n );\n};\n", "/**\n * Messaging utilities\n * Functions to handle iframe postMessage communication\n */\n\nimport type { WidgetMessage } from '../types';\n\n/**\n * Send a message to an iframe\n * @param iframe - The iframe element to send the message to\n * @param message - The message data to send\n */\nexport function sendToIframe(iframe: HTMLIFrameElement | null, message: unknown): void {\n if (!iframe?.contentWindow) {\n console.warn('[Widget] Cannot send message: iframe not ready');\n return;\n }\n\n const wrappedMessage: WidgetMessage = {\n type: 'widget-message',\n payload: message,\n };\n\n // Send to iframe's origin (extracted from src)\n const targetOrigin = getIframeOrigin(iframe);\n iframe.contentWindow.postMessage(wrappedMessage, targetOrigin);\n}\n\n/**\n * Extract origin from iframe src\n * @param iframe - The iframe element\n * @returns The origin URL or '*' as fallback\n */\nfunction getIframeOrigin(iframe: HTMLIFrameElement): string {\n try {\n const url = new URL(iframe.src);\n return url.origin;\n } catch {\n return '*';\n }\n}\n\n/**\n * Listen for messages from a specific iframe\n * @param getIframe - Function that returns the iframe element to filter messages from\n * @param callback - Function to call when a message is received from the iframe\n * @returns Cleanup function to remove the listener\n */\nexport function listenToIframe(\n getIframe: () => HTMLIFrameElement | null,\n callback: (message: unknown) => void\n): () => void {\n const handler = (event: MessageEvent) => {\n const iframe = getIframe();\n\n // Only process messages from our specific iframe\n if (!iframe?.contentWindow || event.source !== iframe.contentWindow) {\n return;\n }\n\n // Validate message structure\n if (event.data && typeof event.data === 'object' && 'type' in event.data) {\n const widgetMessage = event.data as WidgetMessage;\n if (widgetMessage.type === 'widget-message') {\n callback(widgetMessage.payload);\n }\n }\n };\n\n window.addEventListener('message', handler);\n\n // Return cleanup function\n return () => {\n window.removeEventListener('message', handler);\n };\n}\n", "/**\n * Widget Web Component\n * Custom element that wraps the Preact widget - works as modal or dropdown\n */\n\nimport { animate } from 'motion';\nimport { h, render } from 'preact';\nimport { Widget } from './components/Widget';\nimport type { Position, WidgetConfig } from './types';\nimport { listenToIframe, sendToIframe } from './utils/messaging';\nimport { getDropdownPosition } from './utils/dropdown-position';\n\n/**\n * Web Component class for the widget\n * Extends HTMLElement to create a custom element\n */\nexport class WidgetElement extends HTMLElement {\n private config: WidgetConfig;\n private iframeElement: HTMLIFrameElement | null = null;\n private iframeReady = false;\n private messageQueue: unknown[] = [];\n private widgetContainerElement: HTMLDivElement | null = null;\n private openChangeCallbacks: ((isOpen: boolean) => void)[] = [];\n private isOpen = false;\n private isPreloaded = false;\n private messageListenerCleanup: (() => void) | null = null;\n\n constructor(config: WidgetConfig) {\n super();\n this.config = config;\n }\n\n private get isDropdownMode(): boolean {\n return Boolean(this.config.anchorElement);\n }\n\n /**\n * Called when element is added to DOM\n */\n connectedCallback() {\n const shadow = this.attachShadow({ mode: 'open' });\n const container = document.createElement('div');\n shadow.appendChild(container);\n\n // Set up message listener immediately\n this.setupMessageListener();\n\n this.renderComponent(container);\n }\n\n /**\n * Render the Preact component\n */\n private renderComponent(container: HTMLElement) {\n render(\n h(Widget, {\n source: this.config.source,\n position: this.config.position || (this.isDropdownMode ? 's' : 'center'),\n anchorElement: this.config.anchorElement,\n offset: this.config.offset ?? 8,\n style: this.config.style,\n overlay: this.config.overlay ?? !this.isDropdownMode,\n zIndex: this.config.zIndex || 999999,\n animation: this.config.animation || 'slide-spring',\n closeOnClickOutside: this.config.closeOnClickOutside ?? this.isDropdownMode,\n fitToContent: this.config.fitToContent ?? false,\n isOpen: this.isOpen,\n isPreloaded: this.isPreloaded,\n onIframeLoad: (iframe) => {\n this.iframeElement = iframe;\n this.iframeReady = true;\n this.sendInitialState(iframe);\n this.flushMessageQueue();\n },\n onWidgetReady: (widget) => {\n this.widgetContainerElement = widget;\n },\n onOpenChange: (isOpen) => {\n this.isOpen = isOpen;\n this.updateComponent();\n for (const callback of this.openChangeCallbacks) {\n callback(isOpen);\n }\n },\n }),\n container\n );\n }\n\n open() {\n this.isOpen = true;\n this.updateComponent();\n for (const callback of this.openChangeCallbacks) {\n callback(true);\n }\n }\n\n close() {\n console.log('[Widget] close() called');\n this.isOpen = false;\n this.updateComponent();\n for (const callback of this.openChangeCallbacks) {\n callback(false);\n }\n }\n\n preload() {\n this.isPreloaded = true;\n this.updateComponent();\n }\n\n private updateComponent() {\n const container = this.shadowRoot?.querySelector('div');\n if (container) {\n this.renderComponent(container);\n }\n }\n\n private sendInitialState(iframe: HTMLIFrameElement) {\n if (!this.config.initialState) return;\n\n setTimeout(() => {\n sendToIframe(iframe, {\n type: 'INIT_STATE',\n payload: this.config.initialState,\n });\n }, 100);\n }\n\n private flushMessageQueue() {\n if (!this.iframeReady || !this.iframeElement) return;\n\n for (const message of this.messageQueue) {\n sendToIframe(this.iframeElement, message);\n }\n this.messageQueue = [];\n }\n\n private setupMessageListener() {\n if (this.messageListenerCleanup) {\n this.messageListenerCleanup();\n }\n\n this.messageListenerCleanup = listenToIframe(\n () => this.iframeElement,\n (message) => {\n if (typeof message === 'object' && message !== null) {\n const msg = message as Record<string, unknown>;\n\n // Built-in message: close the widget\n if (msg.type === 'CLOSE_WIDGET') {\n this.close();\n return;\n }\n\n // Forward to user's onMessage handler with actions\n if (this.config.onMessage && msg.type) {\n const actions = { close: () => this.close() };\n this.config.onMessage(msg.type as string, msg, actions);\n }\n }\n });\n }\n\n disconnectedCallback() {\n if (this.messageListenerCleanup) {\n this.messageListenerCleanup();\n }\n }\n\n setSource(source: string) {\n this.config.source = source;\n if (this.iframeElement) {\n this.iframeElement.src = source;\n }\n }\n\n /**\n * Send a message to the iframe\n * Messages are queued if iframe is not ready yet\n */\n sendMessage(message: unknown) {\n if (this.iframeReady && this.iframeElement) {\n sendToIframe(this.iframeElement, message);\n } else {\n // Queue message to be sent when iframe is ready\n this.messageQueue.push(message);\n }\n }\n\n async setStyle(\n styles: Record<string, string | number>,\n options?: { duration?: number; easing?: string | number[] }\n ): Promise<void> {\n if (!this.widgetContainerElement) {\n console.warn('[Widget] Widget element not ready yet');\n return;\n }\n\n await animate(this.widgetContainerElement, styles, {\n duration: options?.duration ?? 0.3,\n ease: (options?.easing ?? 'ease-out') as import('motion').Easing,\n }).finished;\n }\n\n async setPosition(\n position: Position,\n options?: { duration?: number; easing?: string | number[] }\n ): Promise<void> {\n if (!this.widgetContainerElement) {\n console.warn('[Widget] Widget element not ready yet');\n return;\n }\n\n this.config.position = position;\n\n const rect = this.widgetContainerElement.getBoundingClientRect();\n const animationType = this.config.animation || 'slide-spring';\n const isSpring = animationType.includes('spring');\n\n const animationOptions = isSpring\n ? {\n type: 'spring' as const,\n stiffness: options?.duration ? (1 / options.duration) * 100 : 250,\n damping: 25,\n mass: 0.8,\n }\n : {\n duration: options?.duration ?? 0.25,\n easing: options?.easing ?? 'ease-out',\n };\n\n if (this.isDropdownMode && this.config.anchorElement) {\n // Dropdown mode: calculate position relative to anchor\n const newCoords = getDropdownPosition(\n this.config.anchorElement,\n { width: rect.width, height: rect.height },\n position as Exclude<Position, 'center'>,\n this.config.offset ?? 8\n );\n\n await animate(\n this.widgetContainerElement,\n { top: `${newCoords.top}px`, left: `${newCoords.left}px` },\n animationOptions\n ).finished;\n } else {\n // Modal mode: calculate viewport position\n const currentX = rect.left;\n const currentY = rect.top;\n const modalWidth = rect.width;\n const modalHeight = rect.height;\n const margin = 20;\n\n let targetX = 0;\n let targetY = 0;\n\n switch (position) {\n case 'center':\n targetX = (window.innerWidth - modalWidth) / 2;\n targetY = (window.innerHeight - modalHeight) / 2;\n break;\n case 'n':\n targetX = (window.innerWidth - modalWidth) / 2;\n targetY = margin;\n break;\n case 's':\n targetX = (window.innerWidth - modalWidth) / 2;\n targetY = window.innerHeight - modalHeight - margin;\n break;\n case 'e':\n targetX = window.innerWidth - modalWidth - margin;\n targetY = (window.innerHeight - modalHeight) / 2;\n break;\n case 'w':\n targetX = margin;\n targetY = (window.innerHeight - modalHeight) / 2;\n break;\n case 'ne':\n targetX = window.innerWidth - modalWidth - margin;\n targetY = margin;\n break;\n case 'nw':\n targetX = margin;\n targetY = margin;\n break;\n case 'se':\n targetX = window.innerWidth - modalWidth - margin;\n targetY = window.innerHeight - modalHeight - margin;\n break;\n case 'sw':\n targetX = margin;\n targetY = window.innerHeight - modalHeight - margin;\n break;\n }\n\n // Freeze current position\n const originalTransition = this.widgetContainerElement.style.transition;\n this.widgetContainerElement.style.transition = 'none';\n this.widgetContainerElement.style.left = `${currentX}px`;\n this.widgetContainerElement.style.top = `${currentY}px`;\n this.widgetContainerElement.style.right = 'auto';\n this.widgetContainerElement.style.bottom = 'auto';\n this.widgetContainerElement.style.transform = 'none';\n void this.widgetContainerElement.offsetHeight;\n this.widgetContainerElement.style.transition = originalTransition;\n\n await animate(\n this.widgetContainerElement,\n { left: `${targetX}px`, top: `${targetY}px` },\n animationOptions\n ).finished;\n }\n }\n\n updateInitialState(state: Record<string, unknown>): void {\n this.config.initialState = { ...this.config.initialState, ...state };\n\n if (this.iframeElement) {\n sendToIframe(this.iframeElement, {\n type: 'UPDATE_STATE',\n payload: state,\n });\n }\n }\n\n getIframe(): HTMLIFrameElement | null {\n return this.iframeElement;\n }\n\n onOpenChange(callback: (isOpen: boolean) => void) {\n this.openChangeCallbacks.push(callback);\n }\n}\n", "/**\n * Widget Factory\n * Creates and manages widget instances - works as modal or dropdown\n */\n\nimport { WidgetElement } from './widget-element';\nimport type { CreateWidgetParams, Widget, Position } from './types';\n\n/**\n * Resolve anchor element from Element or CSS selector\n */\nfunction resolveAnchor(anchor: Element | string | undefined): Element | undefined {\n if (!anchor) return undefined;\n\n if (typeof anchor === 'string') {\n const element = document.querySelector(anchor);\n if (!element) {\n throw new Error(`[createWidget] Anchor element not found: ${anchor}`);\n }\n return element;\n }\n return anchor;\n}\n\n/**\n * Create a widget instance\n *\n * Without anchor: Modal mode - fixed position on viewport with optional overlay\n * With anchor: Dropdown mode - positioned relative to anchor element\n *\n * @param params - Configuration for the widget\n * @returns Widget instance with control methods\n *\n * @example Modal mode\n * ```typescript\n * const modal = createWidget({\n * elementName: 'my-modal',\n * source: 'https://example.com/widget',\n * position: 'center',\n * overlay: true,\n * });\n * modal.open();\n * ```\n *\n * @example Dropdown mode\n * ```typescript\n * const dropdown = createWidget({\n * elementName: 'my-dropdown',\n * source: 'https://example.com/widget',\n * anchor: '#trigger-button',\n * position: 's',\n * });\n * dropdown.open();\n * ```\n */\nexport function createWidget(params: CreateWidgetParams): Widget {\n const { elementName, anchor, ...config } = params;\n\n // Resolve anchor element if provided\n const anchorElement = resolveAnchor(anchor);\n\n // Register custom element if not already registered\n if (!customElements.get(elementName)) {\n customElements.define(\n elementName,\n class extends WidgetElement {\n constructor() {\n super({\n ...config,\n anchorElement,\n });\n }\n }\n );\n }\n\n // Create and append element to DOM\n const element = document.createElement(elementName) as WidgetElement;\n document.body.appendChild(element);\n\n return {\n open() {\n element.open();\n },\n\n close() {\n element.close();\n },\n\n preload() {\n element.preload();\n },\n\n setSource(source: string) {\n element.setSource(source);\n },\n\n async setStyle(\n styles: Record<string, string | number>,\n options?: { duration?: number; easing?: string | number[] }\n ) {\n return element.setStyle(styles, options);\n },\n\n async setPosition(\n position: Position,\n options?: { duration?: number; easing?: string | number[] }\n ) {\n return element.setPosition(position, options);\n },\n\n updateInitialState(state: Record<string, unknown>) {\n element.updateInitialState(state);\n },\n\n sendMessage(message: unknown) {\n // Use the element's sendMessage which handles queuing\n element.sendMessage(message);\n },\n\n onOpenChange(callback: (isOpen: boolean) => void) {\n element.onOpenChange(callback);\n },\n\n destroy() {\n element.remove();\n },\n };\n}\n\n// Legacy aliases for backwards compatibility\n/** @deprecated Use createWidget instead */\nexport const createModalWidget = createWidget;\n/** @deprecated Use createWidget with anchor param instead */\nexport const createDropdownWidget = createWidget;\n", "import { createWidget, Widget, Position } from '@squeletteapp/widget-builder';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype ContentTheme = 'light' | 'dark';\n\nexport type ThemedWidget = Widget & {\n setTheme(theme: ContentTheme): void;\n};\n\ntype ThemeUpdateMessage = {\n type: 'THEME_UPDATE';\n payload: { theme: ContentTheme };\n};\n\ntype Ticket = {\n title: string;\n id: number;\n workspace: { slug: string };\n created_at: string;\n};\n\ntype CachedTicket = {\n ticket: Ticket;\n timestamp: number;\n};\n\ntype ChangelogBannerOptions = {\n base?: string;\n contentTheme?: ContentTheme;\n slug: string;\n debug?: boolean;\n};\n\ntype WidgetStore = {\n getState: () => Record<string, ThemedWidget>;\n mount: (source: string, widget: ThemedWidget) => Promise<void>;\n unmount: (source: string) => void;\n open: (source: string) => Promise<void>;\n setTheme: (theme: ContentTheme) => void;\n};\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst CACHE_DURATION_MS = 5 * 60 * 1000; // 5 minutes\nconst STORAGE_KEY = 'squelette_banner_last_ticket';\nconst DEFAULT_BASE = 'https://www.squelette.app';\n\n// ============================================================================\n// Cache Utilities\n// ============================================================================\n\nfunction getEnableCache(debug?: boolean): boolean {\n // Only disable cache when debug is explicitly true\n if (debug === true) return false;\n\n try {\n const userPreference = localStorage.getItem('squelette-enable-cache');\n if (userPreference === 'false') return false;\n\n return true;\n } catch {\n return true;\n }\n}\n\nasync function fetchLastChangelogTicket(\n base: string,\n slug: string,\n debug?: boolean\n): Promise<Ticket | null> {\n try {\n const enableCache = getEnableCache(debug);\n\n // Check cache first if enabled\n if (enableCache) {\n const cacheKey = `squelette_banner_cache_${slug}`;\n const cached = localStorage.getItem(cacheKey);\n\n if (cached) {\n const { ticket, timestamp }: CachedTicket = JSON.parse(cached);\n const isExpired = Date.now() - timestamp > CACHE_DURATION_MS;\n\n if (!isExpired) {\n return ticket;\n }\n }\n }\n\n // Fetch from API\n const url = `${base}/api/public/w/${slug}/changelog/last`;\n const response = await fetch(url);\n const json = (await response.json()) as { ticket: Ticket };\n const ticket = json?.ticket ?? null;\n\n // Store in cache if enabled\n if (enableCache && ticket) {\n const cacheKey = `squelette_banner_cache_${slug}`;\n const cachedData: CachedTicket = {\n ticket,\n timestamp: Date.now(),\n };\n localStorage.setItem(cacheKey, JSON.stringify(cachedData));\n }\n\n return ticket;\n } catch (e) {\n console.error('[SqueletteBanner] Error fetching changelog ticket:', e);\n return null;\n }\n}\n\nfunction shouldShowBanner(ticket: Ticket, debug?: boolean): boolean {\n const lastSeenCreatedAt = localStorage.getItem(STORAGE_KEY);\n\n // Show if cache is disabled, never seen before, or newer ticket\n return (\n !getEnableCache(debug) ||\n !lastSeenCreatedAt ||\n new Date(ticket.created_at) > new Date(lastSeenCreatedAt)\n );\n}\n\nfunction markTicketAsSeen(ticket: Ticket): void {\n localStorage.setItem(STORAGE_KEY, ticket.created_at);\n}\n\n/**\n * Wrap a Widget with setTheme functionality\n * Sends a THEME_UPDATE message to the iframe instead of reloading\n */\nfunction withTheme(widget: Widget): ThemedWidget {\n return {\n ...widget,\n setTheme(theme: ContentTheme) {\n const message: ThemeUpdateMessage = {\n type: 'THEME_UPDATE',\n payload: { theme },\n };\n widget.sendMessage(message);\n },\n };\n}\n\n// ============================================================================\n// Widget Store\n// ============================================================================\n\nexport function createChangelogStore(): WidgetStore {\n const widgets: Record<string, ThemedWidget> = {};\n return {\n getState: () => widgets,\n mount: async (source: string, widget: ThemedWidget) => {\n widgets[source] = widget;\n widget.preload();\n },\n open: async (source: string) => {\n const widget = widgets[source];\n if (widget) {\n widget.open();\n }\n },\n unmount: (source: string) => {\n const widget = widgets[source];\n if (widget) {\n widget.destroy();\n delete widgets[source];\n }\n },\n setTheme: (theme: ContentTheme) => {\n for (const widget of Object.values(widgets)) {\n widget.setTheme(theme);\n }\n },\n };\n}\n\n// ============================================================================\n// Widget Creators\n// ============================================================================\n\nexport function createChangelogEntryWidget(\n ticketId: string,\n options: { base?: string; contentTheme?: ContentTheme; slug?: string } = {}\n): ThemedWidget {\n const { base = DEFAULT_BASE, contentTheme = 'light', slug = 'squelette' } = options;\n\n const widget = createWidget({\n elementName: 'sq-changelog-entry-widget',\n source: `${base}/widget/${contentTheme}/${slug}/changelog/${ticketId}`,\n position: 'center',\n overlay: true,\n });\n\n return withTheme(widget);\n}\n\n/**\n * Creates and initializes a changelog banner widget.\n * - Fetches the latest changelog ticket\n * - Checks if it should be shown (not already seen)\n * - Preloads the iframe, which will send OPEN_WIDGET when ready\n * - Returns null if nothing to show\n */\nexport async function createChangelogBannerWidget(\n store: WidgetStore,\n options: ChangelogBannerOptions\n): Promise<ThemedWidget | null> {\n const { base = DEFAULT_BASE, contentTheme = 'light', slug, debug = false } = options;\n\n // Fetch the latest ticket\n const ticket = await fetchLastChangelogTicket(base, slug, debug);\n if (!ticket) {\n return null;\n }\n\n const shouldRender = shouldShowBanner(ticket, debug);\n\n // Check if we should show the banner\n if (!shouldRender) {\n return null;\n }\n\n const ticketId = String(ticket.id);\n\n // Preload the entry widget for when user clicks the banner\n store.mount(ticketId, createChangelogEntryWidget(ticketId, { base, contentTheme, slug }));\n\n const widget = createWidget({\n elementName: 'sq-changelog-banner-widget',\n source: `${base}/widget/${contentTheme}/${slug}/changelog/${ticketId}/banner`,\n position: 's',\n overlay: false,\n fitToContent: true,\n style: {\n borderRadius: 32,\n height: 32,\n },\n onMessage: (type, message, actions) => {\n // Iframe signals it's ready to be shown\n if (type === 'OPEN_WIDGET') {\n widget.open();\n }\n\n // User clicked on the banner content\n if (type === 'OPEN_CHANGELOG_ENTRY') {\n const id = (message as { payload: { ticketId: string } }).payload.ticketId;\n actions.close();\n store.open(id);\n }\n },\n });\n\n // Register callback to mark ticket as seen when banner closes\n widget.onOpenChange((isOpen) => {\n if (!isOpen) {\n markTicketAsSeen(ticket);\n }\n });\n\n // Preload the iframe - it will send OPEN_WIDGET when content is ready\n widget.preload();\n\n return withTheme(widget);\n}\n\nexport function createChangelogEntriesListDropdownWidget(\n anchor: string,\n store: WidgetStore,\n options: { base?: string; contentTheme?: ContentTheme; slug?: string; position?: Position } = {}\n): ThemedWidget {\n const { base = DEFAULT_BASE, contentTheme = 'light', slug = 'squelette', position = 'nw' } = options;\n\n const widget = createWidget({\n elementName: 'sq-changelog-entries-list-dropdown-widget',\n source: `${base}/widget/${contentTheme}/${slug}/changelog/list`,\n position,\n anchor,\n fitToContent: true,\n onMessage: (type, message, actions) => {\n if (type === 'PRELOAD_CHANGELOG_ENTRIES') {\n const ids = (message as { payload: { ids: string[] } }).payload.ids;\n for (const id of ids) {\n store.mount(\n id,\n createChangelogEntryWidget(id, { base, contentTheme, slug })\n );\n }\n }\n\n if (type === 'OPEN_CHANGELOG_ENTRY') {\n const ticketId = (message as { payload: { ticketId: string } }).payload.ticketId;\n actions.close();\n store.open(ticketId);\n }\n },\n });\n\n return withTheme(widget);\n}\n\n// ============================================================================\n// Utility\n// ============================================================================\n\n/**\n * Clear the cache for a specific workspace\n */\nexport function clearBannerCache(slug: string): void {\n try {\n localStorage.removeItem(`squelette_banner_cache_${slug}`);\n localStorage.removeItem(STORAGE_KEY);\n } catch {\n // Ignore localStorage errors\n }\n}\n"],
5
+ "mappings": ";AAAA,SAASA,GAAcC,GAAKC,GAAM;AAC1BD,IAAI,QAAQC,CAAI,MAAM,MACtBD,EAAI,KAAKC,CAAI;AACrB;AACA,SAASC,GAAWF,GAAKC,GAAM;AAC3B,QAAME,IAAQH,EAAI,QAAQC,CAAI;AAC1BE,MAAQ,MACRH,EAAI,OAAOG,GAAO,CAAC;AAC3B;ACRA,IAAMC,IAAQ,CAACC,GAAKC,GAAKC,MACjBA,IAAID,IACGA,IACPC,IAAIF,IACGA,IACJE;ACLX,SAASC,GAAmBC,GAASC,GAAW;AAC5C,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,IAAI,EAAE;AACxD,iBAAa,WAAW,WAAW;AAAA,EACrC,QAAQ;AAAA,EAER;AACF;",
6
+ "names": ["addUniqueItem", "arr", "item", "removeItem", "index", "clamp", "min", "max", "v", "formatErrorMessage", "message", "errorCode", "warning", "invariant", "check", "MotionGlobalConfig", "isNumericalString", "isObject", "value", "isZeroValueString", "memo", "callback", "result", "noop", "any", "combineFunctions", "a", "b", "pipe", "transformers", "progress", "from", "to", "toFromDifference", "SubscriptionManager", "handler", "c", "numSubscriptions", "i", "secondsToMilliseconds", "seconds", "millisecondsToSeconds", "milliseconds", "velocityPerSecond", "velocity", "frameDuration", "warned", "warnOnce", "condition", "wrap", "rangeSize", "calcBezier", "a1", "a2", "subdivisionPrecision", "subdivisionMaxIterations", "binarySubdivide", "x", "lowerBound", "upperBound", "mX1", "mX2", "currentX", "currentT", "cubicBezier", "mY1", "mY2", "getTForX", "aX", "t", "mirrorEasing", "easing", "p", "reverseEasing", "backOut", "backIn", "backInOut", "anticipate", "circIn", "circOut", "circInOut", "easeIn", "easeOut", "easeInOut", "isEasingArray", "ease", "getEasingForSegment", "isBezierDefinition", "easingLookup", "isValidEasing", "easingDefinitionToFunction", "definition", "x1", "y1", "x2", "y2", "stepsOrder", "createRenderStep", "runNextFrame", "stepName", "thisFrame", "nextFrame", "isProcessing", "flushNextFrame", "toKeepAlive", "latestFrameData", "triggerCallback", "step", "keepAlive", "immediate", "queue", "frameData", "maxElapsed", "createRenderBatcher", "scheduleNextBatch", "allowKeepAlive", "useDefaultElapsed", "state", "flagRunNextFrame", "steps", "acc", "key", "setup", "read", "resolveKeyframes", "preUpdate", "update", "preRender", "render", "postRender", "processBatch", "timestamp", "wake", "process", "frame", "cancelFrame", "now", "clearTime", "time", "newTime", "checkStringStartsWith", "token", "isCSSVariableName", "startsAsVariableToken", "isCSSVariableToken", "singleCssVariableRegex", "number", "alpha", "scale", "sanitize", "floatRegex", "isNullish", "singleColorRegex", "isColorString", "type", "testProp", "splitColor", "aName", "bName", "cName", "clampRgbUnit", "rgbUnit", "rgba", "red", "green", "blue", "alpha$1", "parseHex", "r", "g", "hex", "createUnitType", "unit", "degrees", "percent", "px", "vh", "vw", "progressPercentage", "hsla", "hue", "saturation", "lightness", "color", "parsed", "colorRegex", "test", "NUMBER_TOKEN", "COLOR_TOKEN", "VAR_TOKEN", "VAR_FUNCTION_TOKEN", "SPLIT_TOKEN", "complexRegex", "analyseComplexValue", "originalValue", "values", "indexes", "types", "split", "parsedValue", "parseComplexValue", "createTransformer", "source", "numSections", "output", "convertNumbersToZero", "getAnimatableNone", "complex", "hueToRgb", "q", "hslaToRgba", "mixImmediate", "mixNumber", "mixLinearColor", "fromExpo", "expo", "colorTypes", "getColorType", "asRGBA", "model", "mixColor", "fromRGBA", "toRGBA", "blended", "invisibleValues", "mixVisibility", "origin", "target", "mixNumber$1", "getMixer", "mixComplex", "mixArray", "mixObject", "numValues", "blendValue", "matchOrder", "orderedOrigin", "pointers", "originIndex", "originValue", "template", "originStats", "targetStats", "mix", "frameloopDriver", "passTimestamp", "generateLinearEasing", "duration", "resolution", "points", "numPoints", "maxGeneratorDuration", "calcGeneratorDuration", "generator", "timeStep", "createGeneratorEasing", "options", "createGenerator", "velocitySampleDuration", "calcGeneratorVelocity", "resolveValue", "current", "prevT", "springDefaults", "safeMin", "findSpring", "bounce", "mass", "envelope", "derivative", "dampingRatio", "undampedFreq", "exponentialDecay", "delta", "calcAngularFreq", "d", "e", "f", "initialGuess", "approximateRoot", "stiffness", "rootIterations", "durationKeys", "physicsKeys", "isSpringType", "keys", "getSpringOptions", "springOptions", "visualDuration", "root", "damping", "derived", "spring", "optionsOrVisualDuration", "restSpeed", "restDelta", "isResolvedFromDuration", "initialVelocity", "initialDelta", "undampedAngularFreq", "isGranularScale", "resolveSpring", "angularFreq", "dampedAngularFreq", "freqForT", "currentVelocity", "isBelowVelocityThreshold", "isBelowDisplacementThreshold", "calculatedDuration", "generatorOptions", "inertia", "keyframes", "power", "timeConstant", "bounceDamping", "bounceStiffness", "modifyTarget", "isOutOfBounds", "nearestBoundary", "amplitude", "ideal", "calcDelta", "calcLatest", "applyFriction", "latest", "timeReachedBoundary", "spring$1", "checkCatchBoundary", "hasUpdatedFrame", "createMixers", "customMixer", "mixers", "mixerFactory", "numMixers", "mixer", "easingFunction", "interpolate", "input", "isClamp", "inputLength", "isZeroDeltaRange", "interpolator", "progressInRange", "fillOffset", "offset", "remaining", "offsetProgress", "defaultOffset", "convertOffsetToTimes", "o", "defaultEasing", "keyframeValues", "times", "easingFunctions", "absoluteTimes", "mapTimeToKeyframe", "isNotNull", "getFinalKeyframe", "repeat", "repeatType", "finalKeyframe", "speed", "resolvedKeyframes", "transitionTypeMap", "replaceTransitionType", "transition", "WithPromise", "resolve", "onResolve", "onReject", "percentToProgress", "JSAnimation", "motionValue", "repeatDelay", "keyframes$1", "generatorFactory", "animationTime", "sample", "totalDuration", "mixKeyframes", "mirroredGenerator", "resolvedDuration", "delay", "onUpdate", "timeWithoutDelay", "isInDelayPhase", "elapsed", "frameGenerator", "currentIteration", "iterationProgress", "done", "isAnimationFinished", "reject", "newSpeed", "hasChanged", "driver", "startTime", "sampleTime", "timeline", "fillWildcards", "radToDeg", "rad", "rotate", "angle", "rebaseAngle", "matrix2dParsers", "rotateZ", "scaleX", "scaleY", "matrix3dParsers", "defaultTransformValue", "name", "parseValueFromTransform", "transform", "matrix3dMatch", "parsers", "match", "matrix2dMatch", "valueParser", "convertTransformToNumber", "readTransformValue", "instance", "transformPropOrder", "transformProps", "isNumOrPxType", "transformKeys", "nonTranslationalTransformKeys", "removeNonTranslationalTransform", "visualElement", "removedTransforms", "positionalValues", "paddingLeft", "paddingRight", "y", "paddingTop", "paddingBottom", "_bbox", "top", "left", "toResolve", "isScheduled", "anyNeedsMeasurement", "isForced", "measureAllKeyframes", "resolversToMeasure", "resolver", "elementsToMeasure", "transformsToRestore", "element", "restore", "readAllKeyframes", "flushKeyframeResolvers", "KeyframeResolver", "unresolvedKeyframes", "onComplete", "isAsync", "currentValue", "valueAsRead", "isForcedComplete", "isCSSVar", "setStyle", "supportsScrollTimeline", "supportsFlags", "memoSupports", "supportsFlag", "memoized", "supportsLinearEasing", "cubicBezierAsString", "supportedWaapiEasing", "mapEasingToNativeEasing", "segmentEasing", "startWaapiAnimation", "valueName", "pseudoElement", "keyframeOptions", "isGenerator", "applyGeneratorOptions", "NativeAnimation", "allowFlatten", "keyframe", "newStartTime", "observe", "unsupportedEasingFunctions", "isUnsupportedEase", "replaceStringEasing", "sampleDelta", "NativeAnimationExtended", "sampleAnimation", "isAnimatable", "hasKeyframesChanged", "canAnimate", "originKeyframe", "targetKeyframe", "isOriginAnimatable", "isTargetAnimatable", "makeAnimationInstant", "acceleratedValues", "supportsWaapi", "supportsBrowserAnimation", "transformTemplate", "MAX_RESOLVE_DELAY", "AsyncMotionValueAnimation", "autoplay", "optionsWithDefaults", "KeyframeResolver$1", "forced", "sync", "isHandoff", "resolvedOptions", "animation", "_onReject", "GroupAnimation", "animations", "propName", "newValue", "subscriptions", "cancel", "getMax", "methodName", "controls", "GroupAnimationWithThen", "splitCSSVariableRegex", "parseCSSVariable", "token1", "token2", "fallback", "maxDepth", "getVariableValue", "depth", "resolved", "trimmed", "getValueTransition", "positionalKeys", "auto", "testValueType", "dimensionValueTypes", "findDimensionValueType", "isNone", "maxDefaults", "applyDefaultFilter", "defaultValue", "functionRegex", "filter", "functions", "int", "transformValueTypes", "numberValueTypes", "defaultValueTypes", "getDefaultValueType", "defaultValueType", "invalidTemplates", "makeNoneKeyframesAnimatable", "noneKeyframeIndexes", "animatableTemplate", "noneIndex", "DOMKeyframesResolver", "originType", "targetType", "measureKeyframe", "finalKeyframeIndex", "unsetTransformName", "unsetTransformValue", "resolveElements", "elementOrSelector", "scope", "selectorCache", "elements", "getValueAsType", "MAX_VELOCITY_DELTA", "isFloat", "MotionValue", "init", "currentTime", "dependent", "prevFrameValue", "subscription", "eventName", "unsubscribe", "eventManagers", "passiveEffect", "stopPassiveEffect", "prev", "endAnimation", "startAnimation", "microtask", "isSVGElement", "isSVGSVGElement", "isMotionValue", "valueTypes", "findValueType", "isDOMKeyframes", "resolveSubjects", "subject", "calculateRepeatDuration", "_repeatDelay", "calcNextTime", "next", "labels", "eraseKeyframes", "sequence", "endTime", "addKeyframes", "normalizeTimes", "compareByTime", "defaultSegmentEasing", "MAX_REPEAT", "createAnimationsFromSequence", "defaultTransition", "sequenceTransition", "generators", "defaultDuration", "animationDefinitions", "sequences", "elementCache", "timeLabels", "prevTime", "segment", "maxDuration", "resolveValueSequence", "valueKeyframes", "valueTransition", "valueSequence", "elementIndex", "numSubjects", "valueKeyframesAsList", "keyframesAsList", "remainingTransition", "calculatedDelay", "numKeyframes", "absoluteDelta", "isNumberKeyframesArray", "springTransition", "springEasing", "remainder", "originalKeyframes", "originalTimes", "originalEase", "repeatIndex", "keyframeIndex", "targetTime", "subjectSequence", "getSubjectSequence", "getValueSequence", "subjects", "subjectIndex", "thisSubject", "valueSequences", "valueOffset", "valueEasing", "at", "isNumber", "visualElementStore", "isKeyframesTarget", "getValueState", "resolveVariantFromProps", "props", "custom", "resolveVariant", "setMotionValue", "resolveFinalValueInKeyframes", "setTarget", "transitionEnd", "isWillChangeMotionValue", "addValueToWillChange", "willChange", "newWillChange", "camelToDash", "str", "optimizedAppearDataId", "optimizedAppearDataAttribute", "getOptimisedAppearId", "underDampedSpring", "criticallyDampedSpring", "keyframesTransition", "getDefaultTransition", "valueKey", "isTransitionDefined", "when", "_delay", "delayChildren", "staggerChildren", "staggerDirection", "animateMotionValue", "shouldSkip", "shouldBlockAnimation", "protectedKeys", "needsAnimating", "shouldBlock", "animateTarget", "targetAndTransition", "transitionOverride", "animationTypeState", "valueTarget", "appearId", "convertBoundingBoxToBox", "right", "bottom", "transformBoxPoints", "point", "transformPoint", "topLeft", "bottomRight", "measureViewportBox", "featureProps", "featureDefinitions", "createAxis", "createBox", "isBrowser", "prefersReducedMotion", "hasReducedMotionListener", "initPrefersReducedMotion", "motionMediaQuery", "setReducedMotionPreferences", "isAnimationControls", "isVariantLabel", "variantPriorityOrder", "variantProps", "isControllingVariants", "isVariantNode", "updateMotionValuesFromProps", "nextValue", "prevValue", "existingValue", "latestValue", "propEventHandlers", "VisualElement", "_props", "_prevProps", "_visualElement", "parent", "presenceContext", "reducedMotionConfig", "blockInitialAnimation", "visualState", "latestValues", "renderState", "initialMotionValues", "remove", "feature", "child", "valueIsTransform", "removeOnChange", "removeSyncCheck", "other", "featureDefinition", "isEnabled", "FeatureConstructor", "listenerName", "listener", "closestVariantNode", "initial", "valueFromInitial", "variant", "args", "DOMVisualElement", "vars", "style", "children", "translateAlias", "numTransforms", "buildTransform", "transformString", "transformIsDefault", "valueIsDefault", "valueAsType", "transformName", "buildHTMLStyles", "transformOrigin", "hasTransform", "hasTransformOrigin", "originX", "originY", "originZ", "renderHTML", "styleProp", "projection", "elementStyle", "scaleCorrectors", "isForcedMotionValue", "layout", "layoutId", "scrapeMotionValuesFromProps", "prevProps", "newValues", "getComputedStyle", "HTMLVisualElement", "computedStyle", "transformPagePoint", "isObjectKey", "object", "ObjectVisualElement", "dashKeys", "camelKeys", "buildSVGPath", "attrs", "length", "spacing", "useDashCase", "pathLength", "pathSpacing", "buildSVGAttrs", "attrX", "attrY", "attrScale", "pathOffset", "isSVGTag", "camelCaseAttributes", "tag", "renderSVG", "_styleProp", "scrapeMotionValuesFromProps$1", "targetKey", "SVGVisualElement", "defaultType", "createDOMVisualElement", "node", "createObjectVisualElement", "animateSingleValue", "motionValue$1", "isSingleValue", "animateSubject", "createVisualElement", "animateSequence", "isSequence", "createScopedAnimate", "scopedAnimate", "subjectOrSequence", "optionsOrKeyframes", "animationOnComplete", "rest", "animate", "n", "l", "u", "s", "w", "_", "m", "k", "S", "C", "M", "$", "O", "N", "I", "P", "B", "A", "L", "D", "T", "j", "F", "h", "H", "E", "V", "z", "G", "getPositionStyles", "position", "positions", "getSlideTransform", "isVisible", "slideDistance", "slide", "getScaleTransform", "positionTransform", "getSpringTransition", "getLinearTransition", "getAnimationStyle", "animationType", "hasAnimated", "getDropdownPosition", "anchor", "dropdown", "anchorRect", "scrollX", "scrollY", "anchorTop", "anchorLeft", "anchorWidth", "anchorHeight", "anchorCenterX", "anchorCenterY", "dropdownWidth", "dropdownHeight", "getDropdownSlideTransform", "getDropdownScaleTransform", "isChangeDimensionsMessage", "data", "listenToDimensionChanges", "onSizeChange", "expectedSource", "handleMessage", "event", "getDropdownAnimationStyles", "effectiveVisible", "WidgetContainer", "visible", "shouldRender", "anchorElement", "zIndex", "fitToContent", "onIframeLoad", "onWidgetReady", "iframeRef", "useRef", "widgetRef", "setHasAnimated", "useState", "dropdownCoords", "setDropdownCoords", "contentSize", "setContentSize", "isDropdownMode", "baseWidth", "baseHeight", "width", "height", "numericWidth", "numericHeight", "useEffect", "size", "updateDropdownPosition", "newCoords", "handleUpdate", "iframe", "handleLoad", "widget", "positioningStyles", "animationStyles", "modalPositionStyles", "positionStylesWithoutTransform", "_w", "_h", "styleWithoutDimensions", "finalStyle", "jsx", "ModalOverlay", "onClick", "Widget", "overlay", "closeOnClickOutside", "onOpenChange", "isOpen", "isPreloaded", "handleOverlayClick", "handleClickOutside", "timeoutId", "jsxs", "Fragment", "sendToIframe", "wrappedMessage", "targetOrigin", "getIframeOrigin", "listenToIframe", "getIframe", "widgetMessage", "WidgetElement", "config", "shadow", "container", "msg", "actions", "styles", "rect", "animationOptions", "currentY", "modalWidth", "modalHeight", "margin", "targetX", "targetY", "originalTransition", "resolveAnchor", "createWidget", "params", "elementName", "ticket"]
7
+ }