{"version":3,"file":"hero-section-BRdQapq3.js","sources":["../../../node_modules/@sentry/remix/build/esm/utils/vendor/response.js","../../../node_modules/@sentry/remix/build/esm/client/errors.js","../../../node_modules/clsx/dist/clsx.mjs","../../../node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../node_modules/framer-motion/dist/es/utils/use-constant.mjs","../../../node_modules/framer-motion/dist/es/context/PresenceContext.mjs","../../../node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../node_modules/framer-motion/dist/es/utils/is-browser.mjs","../../../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../node_modules/motion-utils/dist/es/noop.mjs","../../../node_modules/motion-utils/dist/es/errors.mjs","../../../node_modules/motion-utils/dist/es/memo.mjs","../../../node_modules/motion-utils/dist/es/progress.mjs","../../../node_modules/motion-utils/dist/es/time-conversion.mjs","../../../node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs","../../../node_modules/framer-motion/dist/es/frameloop/render-step.mjs","../../../node_modules/framer-motion/dist/es/frameloop/batcher.mjs","../../../node_modules/framer-motion/dist/es/frameloop/frame.mjs","../../../node_modules/framer-motion/dist/es/context/LazyContext.mjs","../../../node_modules/framer-motion/dist/es/motion/features/definitions.mjs","../../../node_modules/framer-motion/dist/es/motion/features/load-features.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs","../../../node_modules/framer-motion/dist/es/render/components/create-proxy.mjs","../../../node_modules/framer-motion/dist/es/context/MotionContext/index.mjs","../../../node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs","../../../node_modules/framer-motion/dist/es/render/utils/variant-props.mjs","../../../node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs","../../../node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs","../../../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/symbol.mjs","../../../node_modules/framer-motion/dist/es/utils/is-ref-object.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs","../../../node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs","../../../node_modules/framer-motion/dist/es/frameloop/microtask.mjs","../../../node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs","../../../node_modules/framer-motion/dist/es/motion/index.mjs","../../../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","../../../node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs","../../../node_modules/framer-motion/dist/es/utils/resolve-value.mjs","../../../node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs","../../../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/keys-transform.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs","../../../node_modules/framer-motion/dist/es/utils/clamp.mjs","../../../node_modules/framer-motion/dist/es/value/types/numbers/index.mjs","../../../node_modules/framer-motion/dist/es/value/types/numbers/units.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/number-browser.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/transform.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/path.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/render.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/render.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs","../../../node_modules/framer-motion/dist/es/render/svg/config-motion.mjs","../../../node_modules/framer-motion/dist/es/render/html/config-motion.mjs","../../../node_modules/framer-motion/dist/es/render/html/use-props.mjs","../../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs","../../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs","../../../node_modules/framer-motion/dist/es/render/components/create-factory.mjs","../../../node_modules/framer-motion/dist/es/utils/shallow-compare.mjs","../../../node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs","../../../node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../../node_modules/motion-dom/dist/es/animation/controls/BaseGroup.mjs","../../../node_modules/motion-dom/dist/es/animation/controls/Group.mjs","../../../node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../../node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../../node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../../node_modules/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs","../../../node_modules/motion-dom/dist/es/utils/is-bezier-definition.mjs","../../../node_modules/motion-dom/dist/es/utils/supports/flags.mjs","../../../node_modules/motion-dom/dist/es/utils/supports/memo.mjs","../../../node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs","../../../node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../../node_modules/motion-dom/dist/es/animation/waapi/utils/easing.mjs","../../../node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs","../../../node_modules/motion-dom/dist/es/utils/resolve-elements.mjs","../../../node_modules/motion-dom/dist/es/gestures/utils/setup.mjs","../../../node_modules/motion-dom/dist/es/gestures/hover.mjs","../../../node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs","../../../node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs","../../../node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs","../../../node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs","../../../node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs","../../../node_modules/motion-dom/dist/es/gestures/press/index.mjs","../../../node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/keys-position.mjs","../../../node_modules/framer-motion/dist/es/frameloop/sync-time.mjs","../../../node_modules/framer-motion/dist/es/utils/array.mjs","../../../node_modules/framer-motion/dist/es/utils/subscription-manager.mjs","../../../node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs","../../../node_modules/framer-motion/dist/es/value/index.mjs","../../../node_modules/framer-motion/dist/es/render/utils/setters.mjs","../../../node_modules/framer-motion/dist/es/value/use-will-change/is.mjs","../../../node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs","../../../node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs","../../../node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs","../../../node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs","../../../node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs","../../../node_modules/framer-motion/dist/es/easing/back.mjs","../../../node_modules/framer-motion/dist/es/easing/anticipate.mjs","../../../node_modules/framer-motion/dist/es/easing/circ.mjs","../../../node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-none.mjs","../../../node_modules/framer-motion/dist/es/value/types/utils/sanitize.mjs","../../../node_modules/framer-motion/dist/es/value/types/utils/float-regex.mjs","../../../node_modules/framer-motion/dist/es/value/types/utils/is-nullish.mjs","../../../node_modules/framer-motion/dist/es/value/types/utils/single-color-regex.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/utils.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/rgba.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/hex.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/hsla.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/index.mjs","../../../node_modules/framer-motion/dist/es/value/types/utils/color-regex.mjs","../../../node_modules/framer-motion/dist/es/value/types/complex/index.mjs","../../../node_modules/framer-motion/dist/es/value/types/complex/filter.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs","../../../node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs","../../../node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs","../../../node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/number.mjs","../../../node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/immediate.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/color.mjs","../../../node_modules/framer-motion/dist/es/utils/pipe.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/visibility.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/complex.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/index.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/spring/defaults.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/inertia.mjs","../../../node_modules/framer-motion/dist/es/easing/ease.mjs","../../../node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs","../../../node_modules/framer-motion/dist/es/easing/utils/map.mjs","../../../node_modules/framer-motion/dist/es/utils/interpolate.mjs","../../../node_modules/framer-motion/dist/es/utils/offsets/fill.mjs","../../../node_modules/framer-motion/dist/es/utils/offsets/default.mjs","../../../node_modules/framer-motion/dist/es/utils/offsets/time.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs","../../../node_modules/framer-motion/dist/es/render/utils/get-variant-context.mjs","../../../node_modules/framer-motion/dist/es/render/utils/animation-state.mjs","../../../node_modules/framer-motion/dist/es/motion/features/Feature.mjs","../../../node_modules/framer-motion/dist/es/motion/features/animation/index.mjs","../../../node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs","../../../node_modules/framer-motion/dist/es/motion/features/animations.mjs","../../../node_modules/framer-motion/dist/es/events/add-dom-event.mjs","../../../node_modules/framer-motion/dist/es/events/event-info.mjs","../../../node_modules/framer-motion/dist/es/events/add-pointer-event.mjs","../../../node_modules/framer-motion/dist/es/utils/distance.mjs","../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs","../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/models.mjs","../../../node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs","../../../node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs","../../../node_modules/framer-motion/dist/es/projection/utils/measure.mjs","../../../node_modules/framer-motion/dist/es/utils/get-context-window.mjs","../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","../../../node_modules/framer-motion/dist/es/gestures/drag/index.mjs","../../../node_modules/framer-motion/dist/es/gestures/pan/index.mjs","../../../node_modules/framer-motion/dist/es/projection/node/state.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs","../../../node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","../../../node_modules/framer-motion/dist/es/animation/animate/single-value.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs","../../../node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs","../../../node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs","../../../node_modules/framer-motion/dist/es/utils/delay.mjs","../../../node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/copy.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/utils.mjs","../../../node_modules/framer-motion/dist/es/projection/shared/stack.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/transform.mjs","../../../node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs","../../../node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs","../../../node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs","../../../node_modules/framer-motion/dist/es/motion/features/drag.mjs","../../../node_modules/framer-motion/dist/es/gestures/hover.mjs","../../../node_modules/framer-motion/dist/es/gestures/focus.mjs","../../../node_modules/framer-motion/dist/es/gestures/press.mjs","../../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs","../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs","../../../node_modules/framer-motion/dist/es/motion/features/gestures.mjs","../../../node_modules/framer-motion/dist/es/motion/features/layout.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs","../../../node_modules/framer-motion/dist/es/render/store.mjs","../../../node_modules/framer-motion/dist/es/render/utils/motion-values.mjs","../../../node_modules/framer-motion/dist/es/render/VisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs","../../../node_modules/framer-motion/dist/es/render/components/motion/create.mjs","../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs","../../../app/components/hooks/use-element-state.tsx","../../../app/components/icons.tsx","../../../app/components/typography.tsx","../../../app/components/arrow-button.tsx","../../../node_modules/@cld-apis/utils/dist/esm/constants/condition.js","../../../node_modules/@cld-apis/utils/dist/esm/constants/delivery.js","../../../node_modules/@cld-apis/utils/dist/esm/constants/variable.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/index.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/arithmetic.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/condition.js","../../../node_modules/cloudinary-build-url/dist/esm/utils.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/condition.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/effect.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/variable.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/expression.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/flags.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/rawTransformation.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/variables.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/video/fps.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/video/offset.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/resize.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/border.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/position.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/index.js","../../../node_modules/cloudinary-build-url/dist/esm/url.js","../../../node_modules/cloudinary-build-url/dist/esm/index.js","../../../node_modules/emoji-regex/index.mjs","../../../node_modules/md5-hash/dist/index.js","../../../app/utils/misc.tsx","../../../node_modules/@cloudinary/url-gen/config/BaseConfig.js","../../../node_modules/@cloudinary/url-gen/internal/internalConstants.js","../../../node_modules/@cloudinary/url-gen/config/URLConfig.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/qualifier/QualifierValue.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/unsupportedError.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/qualifierToJson.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/QualifierModel.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/qualifier/Qualifier.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/flag/FlagQualifier.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/dataStructureUtils.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/actionToJson.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/ActionModel.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/Action.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/prepareColor.js","../../../node_modules/@cloudinary/transformation-builder-sdk/actions/background/actions/BackgroundColor.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/RawAction.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/IErrorObject.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/flag.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/format/FormatQualifier.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/objectFlip.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/internalConstants.js","../../../node_modules/@cloudinary/transformation-builder-sdk/actions/delivery/DeliveryAction.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/progressive.js","../../../node_modules/@cloudinary/transformation-builder-sdk/actions/delivery/DeliveryFormatAction.js","../../../node_modules/@cloudinary/transformation-builder-sdk/transformation/Transformation.js","../../../node_modules/@cloudinary/transformation-builder-sdk/transformation/ImageTransformation.js","../../../node_modules/@cloudinary/transformation-builder-sdk/transformation/VideoTransformation.js","../../../node_modules/@cloudinary/url-gen/internal/url/urlUtils/isUrl.js","../../../node_modules/@cloudinary/url-gen/internal/url/urlUtils/isFileName.js","../../../node_modules/@cloudinary/url-gen/internal/url/urlUtils/publicIDContainsVersion.js","../../../node_modules/@cloudinary/url-gen/internal/url/cloudinaryURL.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/stringPad.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/base64Map.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/reverseVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/padVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/encodeVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/getAnalyticsOptions.js","../../../node_modules/@cloudinary/url-gen/internal/utils/packageVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/encodeOSVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/getSDKAnalyticsSignature.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryFile.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryTransformable.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryImage.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryVideo.js","../../../node_modules/@cloudinary/url-gen/instance/Cloudinary.js","../../../app/images.tsx","../../../app/components/grid.tsx","../../../app/utils/animations.ts","../../../app/components/sections/hero-section.tsx"],"sourcesContent":["import { _optionalChain } from '@sentry/core';\nimport { matchRoutes } from '@remix-run/router';\n\n/**\n * Based on Remix Implementation\n *\n * https://github.com/remix-run/remix/blob/7688da5c75190a2e29496c78721456d6e12e3abe/packages/remix-server-runtime/data.ts#L131-L145\n */\nasync function extractData(response) {\n const contentType = response.headers.get('Content-Type');\n\n // Cloning the response to avoid consuming the original body stream\n const responseClone = response.clone();\n\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n return responseClone.json();\n }\n\n return responseClone.text();\n}\n\n/**\n * Taken from Remix Implementation\n *\n * https://github.com/remix-run/remix/blob/32300ec6e6e8025602cea63e17a2201989589eab/packages/remix-server-runtime/responses.ts#L60-L77\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isResponse(value) {\n return (\n value != null &&\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n typeof value.status === 'number' &&\n typeof value.statusText === 'string' &&\n typeof value.headers === 'object' &&\n typeof value.body !== 'undefined'\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n );\n}\n\n// https://github.com/remix-run/remix/blob/7688da5c75190a2e29496c78721456d6e12e3abe/packages/remix-server-runtime/responses.ts#L1-L4\n\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n *\n * @see https://remix.run/api/remix#json\n *\n * https://github.com/remix-run/remix/blob/7688da5c75190a2e29496c78721456d6e12e3abe/packages/remix-server-runtime/responses.ts#L12-L24\n */\nconst json = (data, init = {}) => {\n const responseInit = typeof init === 'number' ? { status: init } : init;\n const headers = new Headers(responseInit.headers);\n if (!headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json; charset=utf-8');\n }\n return new Response(JSON.stringify(data), {\n ...responseInit,\n headers,\n });\n};\n\n/**\n * Remix Implementation:\n * https://github.com/remix-run/remix/blob/38e127b1d97485900b9c220d93503de0deb1fc81/packages/remix-server-runtime/routeMatching.ts#L12-L24\n *\n * Changed so that `matchRoutes` function is passed in.\n */\nfunction matchServerRoutes(\n routes,\n pathname,\n) {\n const matches = matchRoutes(routes, pathname);\n\n if (!matches) {\n return null;\n }\n\n return matches.map(match => ({\n params: match.params,\n pathname: match.pathname,\n route: match.route,\n pathnameBase: match.pathnameBase,\n }));\n}\n\n/**\n * https://github.com/remix-run/remix/blob/97999d02493e8114c39d48b76944069d58526e8d/packages/remix-server-runtime/server.ts#L573-L586\n */\nfunction isIndexRequestUrl(url) {\n for (const param of url.searchParams.getAll('index')) {\n // only use bare `?index` params without a value\n // ✅ /foo?index\n // ✅ /foo?index&index=123\n // ✅ /foo?index=123&index\n // ❌ /foo?index=123\n if (param === '') {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * https://github.com/remix-run/remix/blob/97999d02493e8114c39d48b76944069d58526e8d/packages/remix-server-runtime/server.ts#L588-L596\n */\nfunction getRequestMatch(\n url,\n matches,\n) {\n const match = matches.slice(-1)[0] ;\n\n if (!isIndexRequestUrl(url) && _optionalChain([match, 'access', _ => _.route, 'access', _2 => _2.id, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4('/index')])) {\n return matches.slice(-2)[0] ;\n }\n\n return match;\n}\n\n/**\n * https://github.com/remix-run/remix/blob/3e589152bc717d04e2054c31bea5a1056080d4b9/packages/remix-server-runtime/responses.ts#L75-L85\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isDeferredData(value) {\n const deferred = value;\n return (\n deferred &&\n typeof deferred === 'object' &&\n typeof deferred.data === 'object' &&\n typeof deferred.subscribe === 'function' &&\n typeof deferred.cancel === 'function' &&\n typeof deferred.resolveData === 'function'\n );\n}\n\n/**\n * https://github.com/remix-run/react-router/blob/f9b3dbd9cbf513366c456b33d95227f42f36da63/packages/router/utils.ts#L1574\n *\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isRouteErrorResponse(value) {\n const error = value;\n\n return (\n error != null &&\n typeof error.status === 'number' &&\n typeof error.statusText === 'string' &&\n typeof error.internal === 'boolean' &&\n 'data' in error\n );\n}\n\nexport { extractData, getRequestMatch, isDeferredData, isIndexRequestUrl, isResponse, isRouteErrorResponse, json, matchServerRoutes };\n//# sourceMappingURL=response.js.map\n","import { isNodeEnv, captureException } from '@sentry/core';\nimport { isResponse } from '../utils/vendor/response.js';\n\n/**\n * Captures an error that is thrown inside a Remix ErrorBoundary.\n *\n * @param error The error to capture.\n * @returns void\n */\nfunction captureRemixErrorBoundaryError(error) {\n // Server-side errors also appear here without their stacktraces.\n // So, we only capture client-side runtime errors here.\n // ErrorResponses that are 5xx errors captured at loader / action level by `captureRemixRouteError` function,\n // And other server-side errors captured in `handleError` function where stacktraces are available.\n //\n // We don't want to capture:\n // - Response Errors / Objects [They are originated and handled on the server-side]\n // - SSR Errors [They are originated and handled on the server-side]\n // - Anything without a stacktrace [Remix trims the stacktrace of the errors that are thrown on the server-side]\n if (isResponse(error) || isNodeEnv() || !(error instanceof Error)) {\n return;\n }\n\n return captureException(error, {\n mechanism: {\n type: 'instrument',\n handled: false,\n data: {\n function: 'ReactError',\n },\n },\n });\n}\n\nexport { captureRemixErrorBoundaryError };\n//# sourceMappingURL=errors.js.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n","import { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe)\n register(id);\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n","const isBrowser = typeof window !== \"undefined\";\n\nexport { isBrowser };\n","import { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n","import { noop } from './noop.mjs';\n\nlet warning = noop;\nlet invariant = noop;\nif (process.env.NODE_ENV !== \"production\") {\n warning = (check, message) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(message);\n }\n };\n invariant = (check, message) => {\n if (!check) {\n throw new Error(message);\n }\n };\n}\n\nexport { invariant, warning };\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","/*\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","/**\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","const MotionGlobalConfig = {\n skipAnimations: false,\n useManualTiming: false,\n};\n\nexport { MotionGlobalConfig };\n","function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n 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 // 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 '../utils/GlobalConfig.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst stepsOrder = [\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { read, resolveKeyframes, update, preRender, render, postRender } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n read.process(state);\n resolveKeyframes.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, stepsOrder };\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n","\"use client\";\nimport { createContext } from 'react';\n\nconst LazyContext = createContext({ strict: false });\n\nexport { LazyContext };\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","import { featureDefinitions } from './definitions.mjs';\n\nfunction loadFeatures(features) {\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n}\n\nexport { loadFeatures };\n","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nfunction isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n\nexport { isValidMotionProp };\n","import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\nlet shouldForward = (key) => !isValidMotionProp(key);\nfunction loadExternalIsValidProp(isValidProp) {\n if (!isValidProp)\n return;\n // Explicitly filter our events\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n}\ncatch (_a) {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nfunction filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n\nexport { filterProps, loadExternalIsValidProp };\n","import { warnOnce } from '../../utils/warn-once.mjs';\n\nfunction createDOMMotionComponentProxy(componentFactory) {\n if (typeof Proxy === \"undefined\") {\n return componentFactory;\n }\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map();\n const deprecatedFactoryFunction = (...args) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, \"motion() is deprecated. Use motion.create() instead.\");\n }\n return componentFactory(...args);\n };\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key) => {\n if (key === \"create\")\n return componentFactory;\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(key, componentFactory(key));\n }\n return componentCache.get(key);\n },\n });\n}\n\nexport { createDOMMotionComponentProxy };\n","\"use client\";\nimport { createContext } from 'react';\n\nconst MotionContext = createContext({});\n\nexport { MotionContext };\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","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\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 { isVariantLabel } from '../../render/utils/is-variant-label.mjs';\nimport { isControllingVariants } from '../../render/utils/is-controlling-variants.mjs';\n\nfunction getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n\nexport { getCurrentTreeVariants };\n","import { useContext, useMemo } from 'react';\nimport { MotionContext } from './index.mjs';\nimport { getCurrentTreeVariants } from './utils.mjs';\n\nfunction useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n\nexport { useCreateMotionContext };\n","const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n\nexport { motionComponentSymbol };\n","function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n\nexport { isRefObject };\n","import { useCallback } from 'react';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nfunction useMotionRef(visualState, visualElement, externalRef) {\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount && visualState.onMount(instance);\n }\n if (visualElement) {\n if (instance) {\n visualElement.mount(instance);\n }\n else {\n visualElement.unmount();\n }\n }\n if (externalRef) {\n if (typeof externalRef === \"function\") {\n externalRef(instance);\n }\n else if (isRefObject(externalRef)) {\n externalRef.current = instance;\n }\n }\n }, \n /**\n * Only pass a new ref callback to React if we've received a visual element\n * factory. Otherwise we'll be mounting/remounting every time externalRef\n * or other dependencies change.\n */\n [visualElement]);\n}\n\nexport { useMotionRef };\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 { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * Internal, exported only for usage in Framer\n */\nconst SwitchLayoutGroupContext = createContext({});\n\nexport { SwitchLayoutGroupContext };\n","import { useContext, useRef, useInsertionEffect, useEffect } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { optimizedAppearDataAttribute } from '../../animation/optimized-appear/data-id.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';\n\nfunction useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {\n var _a, _b;\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const reducedMotionConfig = useContext(MotionConfigContext).reducedMotion;\n const visualElementRef = useRef(null);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement = createVisualElement || lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n });\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n !((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) &&\n ((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId)));\n useIsomorphicLayoutEffect(() => {\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n microtask.render(visualElement.render);\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n var _a;\n (_a = window.MotionHandoffMarkAsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n layoutScroll,\n layoutRoot,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n\nexport { useVisualElement };\n","\"use client\";\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { warning, invariant } from 'motion-utils';\nimport { forwardRef, useContext } from 'react';\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\nimport { LazyContext } from '../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\nimport { isBrowser } from '../utils/is-browser.mjs';\nimport { featureDefinitions } from './features/definitions.mjs';\nimport { loadFeatures } from './features/load-features.mjs';\nimport { motionComponentSymbol } from './utils/symbol.mjs';\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\nimport { useVisualElement } from './utils/use-visual-element.mjs';\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nfunction createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {\n var _a, _b;\n preloadedFeatures && loadFeatures(preloadedFeatures);\n function MotionComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }));\n }\n MotionComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage)\n : invariant(false, strictMessage);\n }\n}\nfunction getProjectionFunctionality(props) {\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: (drag === null || drag === void 0 ? void 0 : drag.isEnabled(props)) || (layout === null || layout === void 0 ? void 0 : layout.isEnabled(props))\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n\nexport { createRendererMotionComponent };\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nconst lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n\nexport { lowercaseSVGElements };\n","import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs';\n\nfunction isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n\nexport { isSVGComponent };\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement === null || visualElement === void 0 ? void 0 : 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","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n","import { isKeyframesTarget } from '../animation/utils/is-keyframes-target.mjs';\n\nconst isCustomValue = (v) => {\n return Boolean(v && typeof v === \"object\" && v.mix && v.toValue);\n};\nconst resolveFinalValueInKeyframes = (v) => {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n};\n\nexport { isCustomValue, resolveFinalValueInKeyframes };\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n","import { isCustomValue } from '../../utils/resolve-value.mjs';\nimport { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n *\n * TODO: Remove and move to library\n */\nfunction resolveMotionValue(value) {\n const unwrappedValue = isMotionValue(value) ? value.get() : value;\n return isCustomValue(unwrappedValue)\n ? unwrappedValue.toValue()\n : unwrappedValue;\n}\n\nexport { resolveMotionValue };\n","import { useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { isControllingVariants, isVariantNode } from '../../render/utils/is-controlling-variants.mjs';\nimport { resolveVariantFromProps } from '../../render/utils/resolve-variants.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\n\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, onUpdate, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n if (onUpdate) {\n /**\n * onMount works without the VisualElement because it could be\n * called before the VisualElement payload has been hydrated.\n * (e.g. if someone is using m components )\n */\n state.onMount = (instance) => onUpdate({ props, current: instance, ...state });\n state.onUpdate = (visualElement) => onUpdate(visualElement);\n }\n return state;\n}\nconst makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants$1 = isControllingVariants(props);\n const isVariantNode$1 = isVariantNode(props);\n if (context &&\n isVariantNode$1 &&\n !isControllingVariants$1 &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\n\nexport { makeUseVisualState };\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 = new Set(transformPropOrder);\n\nexport { transformPropOrder, transformProps };\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","/**\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","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","import { clamp } from '../../../utils/clamp.mjs';\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","const 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 = {\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 { px } from '../../../value/types/numbers/units.mjs';\n\nconst browserNumberValueTypes = {\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};\n\nexport { browserNumberValueTypes };\n","import { scale, alpha } from '../../../value/types/numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../../../value/types/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 { number } from '../../../value/types/numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n","import { alpha } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\nimport { browserNumberValueTypes } from './number-browser.mjs';\nimport { transformValueTypes } from './transform.mjs';\nimport { int } from './type-int.mjs';\n\nconst numberValueTypes = {\n ...browserNumberValueTypes,\n ...transformValueTypes,\n zIndex: int,\n size: px,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n","import { getValueAsType } from '../../dom/value-types/get-as-type.mjs';\nimport { numberValueTypes } from '../../dom/value-types/number.mjs';\nimport { transformPropOrder } from './keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n 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 { isCSSVariableName } from '../../dom/utils/is-css-variable.mjs';\nimport { getValueAsType } from '../../dom/value-types/get-as-type.mjs';\nimport { numberValueTypes } from '../../dom/value-types/number.mjs';\nimport { buildTransform } from './build-transform.mjs';\nimport { transformProps } from './keys-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","import { px } from '../../../value/types/numbers/units.mjs';\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 { px } from '../../../value/types/numbers/units.mjs';\n\nfunction calcOrigin(origin, offset, size) {\n return typeof origin === \"string\"\n ? origin\n : px.transform(offset + size * origin);\n}\n/**\n * The SVG transform origin defaults are different to CSS and is less intuitive,\n * so we use the measured dimensions of the SVG to reconcile these.\n */\nfunction calcSVGTransformOrigin(dimensions, originX, originY) {\n const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);\n const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);\n return `${pxOriginX} ${pxOriginY}`;\n}\n\nexport { calcSVGTransformOrigin };\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\nimport { calcSVGTransformOrigin } from './transform-origin.mjs';\n\n/**\n * Build SVG visual attrbutes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate) {\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, dimensions } = state;\n /**\n * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs\n * and copy it into style.\n */\n if (attrs.transform) {\n if (dimensions)\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n // Parse transformOrigin\n if (dimensions &&\n (originX !== undefined || originY !== undefined || style.transform)) {\n style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);\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","const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n\nexport { createHtmlRenderState };\n","import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs';\n\nconst createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n\nexport { createSvgRenderState };\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));\n // Loop over any CSS variables and assign those.\n for (const key in vars) {\n element.style.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\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","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","const scaleCorrectors = {};\nfunction addScaleCorrector(correctors) {\n Object.assign(scaleCorrectors, correctors);\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n","import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nimport { transformProps } from '../../render/html/utils/keys-transform.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 { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';\nimport { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n var _a;\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 ((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../html/utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","import { frame } from '../../frameloop/frame.mjs';\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { transformProps } from '../html/utils/keys-transform.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction updateSVGDimensions(instance, renderState) {\n try {\n renderState.dimensions =\n typeof instance.getBBox === \"function\"\n ? instance.getBBox()\n : instance.getBoundingClientRect();\n }\n catch (e) {\n // Most likely trying to measure an unrendered element under Firefox\n renderState.dimensions = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n}\nconst layoutProps = [\"x\", \"y\", \"width\", \"height\", \"cx\", \"cy\", \"r\"];\nconst svgMotionConfig = {\n useVisualState: makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n onUpdate: ({ props, prevProps, current, renderState, latestValues, }) => {\n if (!current)\n return;\n let hasTransform = !!props.drag;\n if (!hasTransform) {\n for (const key in latestValues) {\n if (transformProps.has(key)) {\n hasTransform = true;\n break;\n }\n }\n }\n if (!hasTransform)\n return;\n let needsMeasure = !prevProps;\n if (prevProps) {\n /**\n * Check the layout props for changes, if any are found we need to\n * measure the element again.\n */\n for (let i = 0; i < layoutProps.length; i++) {\n const key = layoutProps[i];\n if (props[key] !==\n prevProps[key]) {\n needsMeasure = true;\n }\n }\n }\n if (!needsMeasure)\n return;\n frame.read(() => {\n updateSVGDimensions(current, renderState);\n frame.render(() => {\n buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);\n renderSVG(current, renderState);\n });\n });\n },\n }),\n};\n\nexport { svgMotionConfig };\n","import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nconst htmlMotionConfig = {\n useVisualState: makeUseVisualState({\n scrapeMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n }),\n};\n\nexport { htmlMotionConfig };\n","import { useMemo } from 'react';\nimport { isForcedMotionValue } from '../../motion/utils/is-forced-motion-value.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nfunction copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nfunction useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n\nexport { copyRawValuesOnly, useHTMLProps };\n","import { useMemo } from 'react';\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\n\nfunction useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n\nexport { useSVGProps };\n","import { Fragment, useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction createUseRender(forwardMotionProps = false) {\n const useRender = (Component, props, ref, { latestValues }, isStatic) => {\n const useVisualProps = isSVGComponent(Component)\n ? useSVGProps\n : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n const elementProps = Component !== Fragment\n ? { ...filteredProps, ...visualProps, ref }\n : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n };\n return useRender;\n}\n\nexport { createUseRender };\n","import { createRendererMotionComponent } from '../../motion/index.mjs';\nimport { isSVGComponent } from '../dom/utils/is-svg-component.mjs';\nimport { svgMotionConfig } from '../svg/config-motion.mjs';\nimport { htmlMotionConfig } from '../html/config-motion.mjs';\nimport { createUseRender } from '../dom/use-render.mjs';\n\nfunction createMotionComponentFactory(preloadedFeatures, createVisualElement) {\n return function createMotionComponent(Component, { forwardMotionProps } = { forwardMotionProps: false }) {\n const baseConfig = isSVGComponent(Component)\n ? svgMotionConfig\n : htmlMotionConfig;\n const config = {\n ...baseConfig,\n preloadedFeatures,\n useRender: createUseRender(forwardMotionProps),\n createVisualElement,\n Component,\n };\n return createRendererMotionComponent(config);\n };\n}\n\nexport { createMotionComponentFactory };\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n","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 { memo } from 'motion-utils';\n\nconst supportsScrollTimeline = memo(() => window.ScrollTimeline !== undefined);\n\nexport { supportsScrollTimeline };\n","import { supportsScrollTimeline } from '../../utils/supports/scroll-timeline.mjs';\n\nclass BaseGroupPlaybackControls {\n constructor(animations) {\n // Bound to accomodate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n // Support for new finished Promise and legacy thennable API\n return Promise.all(this.animations.map((animation) => \"finished\" in animation ? animation.finished : animation));\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, fallback) {\n const subscriptions = this.animations.map((animation) => {\n if (supportsScrollTimeline() && animation.attachTimeline) {\n return animation.attachTimeline(timeline);\n }\n else if (typeof fallback === \"function\") {\n return fallback(animation);\n }\n });\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 startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n let max = 0;\n for (let i = 0; i < this.animations.length; i++) {\n max = Math.max(max, this.animations[i].duration);\n }\n return max;\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n flatten() {\n this.runAll(\"flatten\");\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}\n\nexport { BaseGroupPlaybackControls };\n","import { BaseGroupPlaybackControls } from './BaseGroup.mjs';\n\n/**\n * TODO: This is a temporary class to support the legacy\n * thennable API\n */\nclass GroupPlaybackControls extends BaseGroupPlaybackControls {\n then(onResolve, onReject) {\n return Promise.all(this.animations).then(onResolve).catch(onReject);\n }\n}\n\nexport { GroupPlaybackControls };\n","function getValueTransition(transition, key) {\n return transition\n ? transition[key] ||\n transition[\"default\"] ||\n transition\n : undefined;\n}\n\nexport { getValueTransition };\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","function isGenerator(type) {\n return typeof type === \"function\";\n}\n\nexport { isGenerator };\n","function attachTimeline(animation, timeline) {\n animation.timeline = timeline;\n animation.onfinish = null;\n}\n\nexport { attachTimeline };\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {\n linearEasing: undefined,\n};\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 () => { var _a; return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : 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","import { progress } from 'motion-utils';\n\nconst 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 += easing(progress(0, numPoints - 1, i)) + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n","import { isBezierDefinition } from '../../../utils/is-bezier-definition.mjs';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from './linear.mjs';\n\nfunction isWaapiSupportedEasing(easing) {\n return Boolean((typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));\n}\nconst cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\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};\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\" && supportsLinearEasing()) {\n return generateLinearEasing(easing, duration);\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 { cubicBezierAsString, isWaapiSupportedEasing, mapEasingToNativeEasing, supportedWaapiEasing };\n","const isDragging = {\n x: false,\n y: false,\n};\nfunction isDragActive() {\n return isDragging.x || isDragging.y;\n}\n\nexport { isDragActive, isDragging };\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n var _a;\n if (elementOrSelector instanceof Element) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n // TODO: Refactor to utils package\n // invariant(\n // Boolean(scope.current),\n // \"Scope provided, but no element detected.\"\n // )\n root = scope.current;\n }\n const elements = (_a = selectorCache === null || selectorCache === void 0 ? void 0 : selectorCache[elementOrSelector]) !== null && _a !== void 0 ? _a : root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector);\n}\n\nexport { resolveElements };\n","import { resolveElements } from '../../utils/resolve-elements.mjs';\n\nfunction setupGesture(elementOrSelector, options) {\n const elements = resolveElements(elementOrSelector);\n const gestureAbortController = new AbortController();\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n };\n const cancel = () => gestureAbortController.abort();\n return [elements, eventOptions, cancel];\n}\n\nexport { setupGesture };\n","import { isDragActive } from './drag/state/is-active.mjs';\nimport { setupGesture } from './utils/setup.mjs';\n\n/**\n * Filter out events that are not pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.pointerType === \"touch\" || isDragActive())\n return;\n callback(event);\n };\n}\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nfunction hover(elementOrSelector, onHoverStart, options = {}) {\n const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);\n const onPointerEnter = filterEvents((enterEvent) => {\n const { target } = enterEvent;\n const onHoverEnd = onHoverStart(enterEvent);\n if (typeof onHoverEnd !== \"function\" || !target)\n return;\n const onPointerLeave = filterEvents((leaveEvent) => {\n onHoverEnd(leaveEvent);\n target.removeEventListener(\"pointerleave\", onPointerLeave);\n });\n target.addEventListener(\"pointerleave\", onPointerLeave, eventOptions);\n });\n elements.forEach((element) => {\n element.addEventListener(\"pointerenter\", onPointerEnter, eventOptions);\n });\n return cancel;\n}\n\nexport { hover };\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n","const focusableElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n]);\nfunction isElementKeyboardAccessible(element) {\n return (focusableElements.has(element.tagName) ||\n element.tabIndex !== -1);\n}\n\nexport { isElementKeyboardAccessible };\n","const isPressing = new WeakSet();\n\nexport { isPressing };\n","import { isPressing } from './state.mjs';\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.key !== \"Enter\")\n return;\n callback(event);\n };\n}\nfunction firePointerEvent(target, type) {\n target.dispatchEvent(new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true }));\n}\nconst enableKeyboardPress = (focusEvent, eventOptions) => {\n const element = focusEvent.currentTarget;\n if (!element)\n return;\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element))\n return;\n firePointerEvent(element, \"down\");\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\");\n });\n const handleBlur = () => firePointerEvent(element, \"cancel\");\n element.addEventListener(\"keyup\", handleKeyup, eventOptions);\n element.addEventListener(\"blur\", handleBlur, eventOptions);\n });\n element.addEventListener(\"keydown\", handleKeydown, eventOptions);\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\"blur\", () => element.removeEventListener(\"keydown\", handleKeydown), eventOptions);\n};\n\nexport { enableKeyboardPress };\n","import { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(elementOrSelector, onPressStart, options = {}) {\n const [elements, eventOptions, cancelEvents] = setupGesture(elementOrSelector, options);\n const startPress = (startEvent) => {\n const element = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent) || isPressing.has(element))\n return;\n isPressing.add(element);\n const onPressEnd = onPressStart(startEvent);\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerCancel);\n if (!isValidPressEvent(endEvent) || !isPressing.has(element)) {\n return;\n }\n isPressing.delete(element);\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, options.useGlobalTarget ||\n isNodeOrChild(element, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions);\n };\n elements.forEach((element) => {\n if (!isElementKeyboardAccessible(element) &&\n element.getAttribute(\"tabindex\") === null) {\n element.tabIndex = 0;\n }\n const target = options.useGlobalTarget ? window : element;\n target.addEventListener(\"pointerdown\", startPress, eventOptions);\n element.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions), eventOptions);\n });\n return cancelEvents;\n}\n\nexport { press };\n","import { isDragging } from './is-active.mjs';\n\nfunction setDragLock(axis) {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null;\n }\n else {\n isDragging[axis] = true;\n return () => {\n isDragging[axis] = false;\n };\n }\n }\n else {\n if (isDragging.x || isDragging.y) {\n return null;\n }\n else {\n isDragging.x = isDragging.y = true;\n return () => {\n isDragging.x = isDragging.y = false;\n };\n }\n }\n}\n\nexport { setDragLock };\n","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","import { MotionGlobalConfig } from '../utils/GlobalConfig.mjs';\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","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","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 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 { time } from '../frameloop/sync-time.mjs';\nimport { SubscriptionManager } from '../utils/subscription-manager.mjs';\nimport { velocityPerSecond } from '../utils/velocity-per-second.mjs';\nimport { warnOnce } from '../utils/warn-once.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 * @internal\n */\n constructor(init, options = {}) {\n /**\n * This will be replaced by the build step with the latest version number.\n * When MotionValues are provided to motion components, warn if versions are mixed.\n */\n this.version = \"11.18.2\";\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, render = true) => {\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 && this.events.change) {\n this.events.change.notify(this.current);\n }\n // Update render subscribers\n if (render && this.events.renderRequest) {\n this.events.renderRequest.notify(this.current);\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n *\n * @internal\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, render = true) {\n if (!render || !this.passiveEffect) {\n this.updateAndNotify(v, render);\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 /**\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 * @internal\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.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 { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';\nimport { motionValue } from '../../value/index.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 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 '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n","import { 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}\n\nexport { addValueToWillChange };\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n","import { noop } from 'motion-utils';\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 noticiably 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","/**\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","import { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\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","// 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 '../../../utils/clamp.mjs';\nimport { alpha, number } 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","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};\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 var _a, _b;\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +\n (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.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 : 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","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 { color } from '../../../value/types/color/index.mjs';\nimport { filter } from '../../../value/types/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 '../../../value/types/complex/index.mjs';\nimport { filter } from '../../../value/types/complex/filter.mjs';\nimport { getDefaultValueType } from './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 '../../dom/value-types/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 { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\nimport { transformPropOrder } from '../../html/utils/keys-transform.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(\", \")[pos]);\nconst getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {\n if (transform === \"none\" || !transform)\n return 0;\n const matrix3d = transform.match(/^matrix3d\\((.+)\\)$/u);\n if (matrix3d) {\n return getPosFromMatrix(matrix3d[1], pos3);\n }\n else {\n const matrix = transform.match(/^matrix\\((.+)\\)$/u);\n if (matrix) {\n return getPosFromMatrix(matrix[1], pos2);\n }\n else {\n return 0;\n }\n }\n};\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: getTranslateFromMatrix(4, 13),\n y: getTranslateFromMatrix(5, 14),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n","import { removeNonTranslationalTransform } from '../dom/utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = 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 var _a;\n (_a = element.getValue(key)) === null || _a === void 0 ? void 0 : _a.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());\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 readAllKeyframes();\n measureAllKeyframes();\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n /**\n * Track whether this resolver has completed. Once complete, it never\n * needs to attempt keyframe resolution again.\n */\n this.isComplete = false;\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 /**\n * Track whether this resolver is currently scheduled to resolve\n * to allow it to be cancelled and resumed externally.\n */\n this.isScheduled = 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.isScheduled = true;\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 /**\n * If a keyframe is null, we hydrate it either by reading it from\n * the instance, or propagating from previous keyframes.\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null) {\n /**\n * If the first keyframe is null, we need to find its value by sampling the element\n */\n if (i === 0) {\n const currentValue = motionValue === null || motionValue === void 0 ? void 0 : motionValue.get();\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 else {\n unresolvedKeyframes[i] = unresolvedKeyframes[i - 1];\n }\n }\n }\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete() {\n this.isComplete = true;\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe);\n toResolve.delete(this);\n }\n cancel() {\n if (!this.isComplete) {\n this.isScheduled = false;\n toResolve.delete(this);\n }\n }\n resume() {\n if (!this.isComplete)\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\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","import { invariant } from 'motion-utils';\nimport { isNumericalString } from '../../../utils/is-numerical-string.mjs';\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 !== null && token1 !== void 0 ? 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.`);\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","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n","import { number } from '../../../value/types/numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from '../../../value/types/numbers/units.mjs';\nimport { testValueType } from './test.mjs';\nimport { auto } from './type-auto.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 { isNone } from '../../animation/utils/is-none.mjs';\nimport { positionalKeys } from '../html/utils/keys-position.mjs';\nimport { makeNoneKeyframesAnimatable } from '../html/utils/make-none-animatable.mjs';\nimport { KeyframeResolver } from '../utils/KeyframesResolver.mjs';\nimport { getVariableValue } from './utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken } from './utils/is-css-variable.mjs';\nimport { isNumOrPxType, positionalValues } from './utils/unit-conversion.mjs';\nimport { findDimensionValueType } from './value-types/dimensions.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 {\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 (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 var _a;\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 ((_a = this.removedTransforms) === null || _a === void 0 ? void 0 : _a.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","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 tat 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 { isGenerator } from 'motion-dom';\nimport { warning } from 'motion-utils';\nimport { isAnimatable } from '../../utils/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}\". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \\`style\\` property.`);\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","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 { time } from '../../frameloop/sync-time.mjs';\nimport { flushKeyframeResolvers } from '../../render/utils/KeyframesResolver.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.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 BaseAnimation {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", ...options }) {\n // Track whether the animation has been stopped. Stopped animations won't restart.\n this.isStopped = false;\n this.hasAttemptedResolve = false;\n this.createdAt = time.now();\n this.options = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n ...options,\n };\n this.updateFinishedPromise();\n }\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 calcStartTime() {\n if (!this.resolvedAt)\n return this.createdAt;\n return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt;\n }\n /**\n * A getter for resolved data. If keyframes are not yet resolved, accessing\n * this.resolved will synchronously flush all pending keyframe resolvers.\n * This is a deoptimisation, but at its worst still batches read/writes.\n */\n get resolved() {\n if (!this._resolved && !this.hasAttemptedResolve) {\n flushKeyframeResolvers();\n }\n return this._resolved;\n }\n /**\n * A method to be called when the keyframes resolver completes. This method\n * will check if its possible to run the animation and, if not, skip it.\n * Otherwise, it will call initPlayback on the implementing class.\n */\n onKeyframesResolved(keyframes, finalKeyframe) {\n this.resolvedAt = time.now();\n this.hasAttemptedResolve = true;\n const { name, type, velocity, delay, onComplete, onUpdate, isGenerator, } = this.options;\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!isGenerator && !canAnimate(keyframes, name, type, velocity)) {\n // Finish immediately\n if (instantAnimationState.current || !delay) {\n onUpdate &&\n onUpdate(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete && onComplete();\n this.resolveFinishedPromise();\n return;\n }\n // Finish after a delay\n else {\n this.options.duration = 0;\n }\n }\n const resolvedAnimation = this.initPlayback(keyframes, finalKeyframe);\n if (resolvedAnimation === false)\n return;\n this._resolved = {\n keyframes,\n finalKeyframe,\n ...resolvedAnimation,\n };\n this.onPostResolved();\n }\n onPostResolved() { }\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.currentFinishedPromise.then(resolve, reject);\n }\n flatten() {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n }\n updateFinishedPromise() {\n this.currentFinishedPromise = new Promise((resolve) => {\n this.resolveFinishedPromise = resolve;\n });\n }\n}\n\nexport { BaseAnimation };\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","// 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","import { mixNumber } from './number.mjs';\nimport { warning } from 'motion-utils';\nimport { hslaToRgba } from '../hsla-to-rgba.mjs';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { mixImmediate } from './immediate.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.`);\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","/**\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","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 { mixNumber as mixNumber$1 } from './number.mjs';\nimport { mixColor } from './color.mjs';\nimport { pipe } from '../pipe.mjs';\nimport { warning } from 'motion-utils';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { isCSSVariableToken } from '../../render/dom/utils/is-css-variable.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\nimport { mixImmediate } from './immediate.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 var _a;\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 = (_a = origin.values[originIndex]) !== null && _a !== void 0 ? _a : 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.`);\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 { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';\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, millisecondsToSeconds } from 'motion-utils';\nimport { clamp } from '../../../utils/clamp.mjs';\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\");\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 { calcGeneratorDuration, maxGeneratorDuration, generateLinearEasing } from 'motion-dom';\nimport { millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { clamp } from '../../../utils/clamp.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 = 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 };\n return generator;\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 { 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 { isBezierDefinition } from 'motion-dom';\nimport { invariant, noop } from 'motion-utils';\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';\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 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.`);\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (typeof definition === \"string\") {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`);\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n","import { invariant, noop, progress } from 'motion-utils';\nimport { clamp } from './clamp.mjs';\nimport { mix } from './mix/index.mjs';\nimport { pipe } from './pipe.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || 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 Revist 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\");\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 '../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 } from '../../easing/ease.mjs';\nimport { isEasingArray } from '../../easing/utils/is-easing-array.mjs';\nimport { easingDefinitionToFunction } from '../../easing/utils/map.mjs';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../../utils/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../../utils/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","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: () => frame.update(passTimestamp, true),\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","import { isGenerator, calcGeneratorDuration } from 'motion-dom';\nimport { invariant, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { KeyframeResolver } from '../../render/utils/KeyframesResolver.mjs';\nimport { clamp } from '../../utils/clamp.mjs';\nimport { mix } from '../../utils/mix/index.mjs';\nimport { pipe } from '../../utils/pipe.mjs';\nimport { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { frameloopDriver } from './drivers/driver-frameloop.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\nconst generators = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nconst percentToProgress = (percent) => percent / 100;\n/**\n * Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of\n * features we expose publically. Mostly the compatibility is to ensure visual identity\n * between both WAAPI and main thread animations.\n */\nclass MainThreadAnimation extends BaseAnimation {\n constructor(options) {\n super(options);\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * The time at which the animation was cancelled.\n */\n this.cancelTime = null;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * The state of the animation to apply when the animation is resolved. This\n * allows calls to the public API to control the animation before it is resolved,\n * without us having to resolve it first.\n */\n this.pendingPlayState = \"running\";\n /**\n * The time at which the animation was started.\n */\n this.startTime = null;\n this.state = \"idle\";\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 this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n const { onStop } = this.options;\n onStop && onStop();\n };\n const { name, motionValue, element, keyframes } = this.options;\n const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver;\n const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);\n this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue, element);\n this.resolver.scheduleResolve();\n }\n flatten() {\n super.flatten();\n // If we've already resolved the animation, re-initialise it\n if (this._resolved) {\n Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));\n }\n }\n initPlayback(keyframes$1) {\n const { type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;\n const generatorFactory = isGenerator(type)\n ? type\n : generators[type] || keyframes;\n /**\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n let mapPercentToKeyframes;\n let mirroredGenerator;\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);\n }\n mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...this.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 mirroredGenerator = generatorFactory({\n ...this.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 const resolvedDuration = calculatedDuration + repeatDelay;\n const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;\n return {\n generator,\n mirroredGenerator,\n mapPercentToKeyframes,\n calculatedDuration,\n resolvedDuration,\n totalDuration,\n };\n }\n onPostResolved() {\n const { autoplay = true } = this.options;\n this.play();\n if (this.pendingPlayState === \"paused\" || !autoplay) {\n this.pause();\n }\n else {\n this.state = this.pendingPlayState;\n }\n }\n tick(timestamp, sample = false) {\n const { resolved } = this;\n // If the animations has failed to resolve, return the final keyframe.\n if (!resolved) {\n const { keyframes } = this.options;\n return { done: true, value: keyframes[keyframes.length - 1] };\n }\n const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;\n if (this.startTime === null)\n return generator.next(0);\n const { delay, repeat, repeatType, repeatDelay, onUpdate } = 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 // Update currentTime\n if (sample) {\n this.currentTime = timestamp;\n }\n else 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 =\n Math.round(timestamp - this.startTime) * this.speed;\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1);\n const isInDelayPhase = this.speed >= 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 (mapPercentToKeyframes) {\n state.value = mapPercentToKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.speed >= 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 if (isAnimationFinished && finalKeyframe !== undefined) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n get duration() {\n const { resolved } = this;\n return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;\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.holdTime !== null || this.speed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.speed;\n }\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\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.resolver.isScheduled) {\n this.resolver.resume();\n }\n if (!this._resolved) {\n this.pendingPlayState = \"running\";\n return;\n }\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, onPlay, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n onPlay && onPlay();\n const now = this.driver.now();\n if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();\n }\n else if (this.state === \"finished\") {\n this.startTime = now;\n }\n if (this.state === \"finished\") {\n this.updateFinishedPromise();\n }\n this.cancelTime = this.startTime;\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 var _a;\n if (!this._resolved) {\n this.pendingPlayState = \"paused\";\n return;\n }\n this.state = \"paused\";\n this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.pendingPlayState = this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.teardown();\n this.state = \"finished\";\n const { onComplete } = this.options;\n onComplete && onComplete();\n }\n cancel() {\n if (this.cancelTime !== null) {\n this.tick(this.cancelTime);\n }\n this.teardown();\n this.updateFinishedPromise();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.resolveFinishedPromise();\n this.updateFinishedPromise();\n this.startTime = this.cancelTime = null;\n this.resolver.cancel();\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(time) {\n this.startTime = 0;\n return this.tick(time, true);\n }\n}\n// Legacy interface\nfunction animateValue(options) {\n return new MainThreadAnimation(options);\n}\n\nexport { MainThreadAnimation, animateValue };\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: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved\n // or until we implement support for linear() easing.\n // \"background-color\"\n]);\n\nexport { acceleratedValues };\n","import { mapEasingToNativeEasing } from 'motion-dom';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeInOut\", times, } = {}) {\n const keyframeOptions = { [valueName]: keyframes };\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 return element.animate(keyframeOptions, {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n });\n}\n\nexport { startWaapiAnimation };\n","import { memo } from 'motion-utils';\n\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\n\nexport { supportsWaapi };\n","import { supportsLinearEasing, attachTimeline, isGenerator, isWaapiSupportedEasing } from 'motion-dom';\nimport { millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { anticipate } from '../../easing/anticipate.mjs';\nimport { backInOut } from '../../easing/back.mjs';\nimport { circInOut } from '../../easing/circ.mjs';\nimport { DOMKeyframesResolver } from '../../render/dom/DOMKeyframesResolver.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { MainThreadAnimation } from './MainThreadAnimation.mjs';\nimport { acceleratedValues } from './utils/accelerated-values.mjs';\nimport { startWaapiAnimation } from './waapi/index.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\nimport { supportsWaapi } from './waapi/utils/supports-waapi.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\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxDuration = 20000;\n/**\n * Check if an animation can run natively via WAAPI or requires pregenerated keyframes.\n * WAAPI doesn't support spring or function easings so we run these as JS animation before\n * handing off.\n */\nfunction requiresPregeneratedKeyframes(options) {\n return (isGenerator(options.type) ||\n options.type === \"spring\" ||\n !isWaapiSupportedEasing(options.ease));\n}\nfunction pregenerateKeyframes(keyframes, options) {\n /**\n * Create a main-thread animation to pregenerate keyframes.\n * We sample this at regular intervals to generate keyframes that we then\n * linearly interpolate between.\n */\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n repeat: 0,\n delay: 0,\n isGenerator: true,\n });\n let state = { done: false, value: keyframes[0] };\n const pregeneratedKeyframes = [];\n /**\n * Bail after 20 seconds of pre-generated keyframes as it's likely\n * we're heading for an infinite loop.\n */\n let t = 0;\n while (!state.done && t < maxDuration) {\n state = sampleAnimation.sample(t);\n pregeneratedKeyframes.push(state.value);\n t += sampleDelta;\n }\n return {\n times: undefined,\n keyframes: pregeneratedKeyframes,\n duration: t - sampleDelta,\n ease: \"linear\",\n };\n}\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nclass AcceleratedAnimation extends BaseAnimation {\n constructor(options) {\n super(options);\n const { name, motionValue, element, keyframes } = this.options;\n this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue, element);\n this.resolver.scheduleResolve();\n }\n initPlayback(keyframes, finalKeyframe) {\n let { duration = 300, times, ease, type, motionValue, name, startTime, } = this.options;\n /**\n * If element has since been unmounted, return false to indicate\n * the animation failed to initialised.\n */\n if (!motionValue.owner || !motionValue.owner.current) {\n return false;\n }\n /**\n * If the user has provided an easing function name that isn't supported\n * by WAAPI (like \"anticipate\"), we need to provide the corressponding\n * function. This will later get converted to a linear() easing function.\n */\n if (typeof ease === \"string\" &&\n supportsLinearEasing() &&\n isUnsupportedEase(ease)) {\n ease = unsupportedEasingFunctions[ease];\n }\n /**\n * If this animation needs pre-generated keyframes then generate.\n */\n if (requiresPregeneratedKeyframes(this.options)) {\n const { onComplete, onUpdate, motionValue, element, ...options } = this.options;\n const pregeneratedAnimation = pregenerateKeyframes(keyframes, options);\n keyframes = pregeneratedAnimation.keyframes;\n // If this is a very short animation, ensure we have\n // at least two keyframes to animate between as older browsers\n // can't animate between a single keyframe.\n if (keyframes.length === 1) {\n keyframes[1] = keyframes[0];\n }\n duration = pregeneratedAnimation.duration;\n times = pregeneratedAnimation.times;\n ease = pregeneratedAnimation.ease;\n type = \"keyframes\";\n }\n const animation = startWaapiAnimation(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease });\n // Override the browser calculated startTime with one synchronised to other JS\n // and WAAPI animations starting this event loop.\n animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();\n if (this.pendingTimeline) {\n attachTimeline(animation, this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n else {\n /**\n * Prefer the `onfinish` prop as it's more widely supported than\n * the `finished` promise.\n *\n * Here, we synchronously set the provided MotionValue to the end\n * keyframe. If we didn't, when the WAAPI animation is finished it would\n * be removed from the element which would then revert to its old styles.\n */\n animation.onfinish = () => {\n const { onComplete } = this.options;\n motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete && onComplete();\n this.cancel();\n this.resolveFinishedPromise();\n };\n }\n return {\n animation,\n duration,\n times,\n type,\n ease,\n keyframes: keyframes,\n };\n }\n get duration() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { duration } = resolved;\n return millisecondsToSeconds(duration);\n }\n get time() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { animation } = resolved;\n return millisecondsToSeconds(animation.currentTime || 0);\n }\n set time(newTime) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.currentTime = secondsToMilliseconds(newTime);\n }\n get speed() {\n const { resolved } = this;\n if (!resolved)\n return 1;\n const { animation } = resolved;\n return animation.playbackRate;\n }\n set speed(newSpeed) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.playbackRate = newSpeed;\n }\n get state() {\n const { resolved } = this;\n if (!resolved)\n return \"idle\";\n const { animation } = resolved;\n return animation.playState;\n }\n get startTime() {\n const { resolved } = this;\n if (!resolved)\n return null;\n const { animation } = resolved;\n // Coerce to number as TypeScript incorrectly types this\n // as CSSNumberish\n return animation.startTime;\n }\n /**\n * Replace the default DocumentTimeline with another AnimationTimeline.\n * Currently used for scroll animations.\n */\n attachTimeline(timeline) {\n if (!this._resolved) {\n this.pendingTimeline = timeline;\n }\n else {\n const { resolved } = this;\n if (!resolved)\n return noop;\n const { animation } = resolved;\n attachTimeline(animation, timeline);\n }\n return noop;\n }\n play() {\n if (this.isStopped)\n return;\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n if (animation.playState === \"finished\") {\n this.updateFinishedPromise();\n }\n animation.play();\n }\n pause() {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.pause();\n }\n stop() {\n this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.resolveFinishedPromise();\n this.updateFinishedPromise();\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation, keyframes, duration, type, ease, times } = resolved;\n if (animation.playState === \"idle\" ||\n animation.playState === \"finished\") {\n return;\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 if (this.time) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n duration,\n type,\n ease,\n times,\n isGenerator: true,\n });\n const sampleTime = secondsToMilliseconds(this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n }\n const { onStop } = this.options;\n onStop && onStop();\n this.cancel();\n }\n complete() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.finish();\n }\n cancel() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.cancel();\n }\n static supports(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n if (!motionValue ||\n !motionValue.owner ||\n !(motionValue.owner.current instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\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 !transformTemplate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n }\n}\n\nexport { AcceleratedAnimation };\n","import { transformProps } from '../../render/html/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n","/**\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, GroupPlaybackControls } from 'motion-dom';\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { frame } from '../../frameloop/frame.mjs';\nimport { MotionGlobalConfig } from '../../utils/GlobalConfig.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { AcceleratedAnimation } from '../animators/AcceleratedAnimation.mjs';\nimport { MainThreadAnimation } from '../animators/MainThreadAnimation.mjs';\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 let 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 * unqiue transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n options = {\n ...options,\n ...getDefaultTransition(name, options),\n };\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n if (options.duration) {\n options.duration = secondsToMilliseconds(options.duration);\n }\n if (options.repeatDelay) {\n options.repeatDelay = secondsToMilliseconds(options.repeatDelay);\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 options.duration = 0;\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (instantAnimationState.current ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n options.duration = 0;\n options.delay = 0;\n }\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n // We still want to return some animation controls here rather\n // than returning undefined\n return new GroupPlaybackControls([]);\n }\n }\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n if (!isHandoff && AcceleratedAnimation.supports(options)) {\n return new AcceleratedAnimation(options);\n }\n else {\n return new MainThreadAnimation(options);\n }\n};\n\nexport { animateMotionValue };\n","import { getValueTransition } from 'motion-dom';\nimport { positionalKeys } from '../../render/html/utils/keys-position.mjs';\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';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n var _a;\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, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : 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 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","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n var _a;\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n const generateStaggerDuration = staggerDirection === 1\n ? (i = 0) => i * staggerChildren\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach((child, i) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delayChildren + generateStaggerDuration(i),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\n\nexport { animateVariant, sortByTreeOrder };\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n","import { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nconst numVariantProps = variantProps.length;\nfunction getVariantContext(visualElement) {\n if (!visualElement)\n return undefined;\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {};\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial;\n }\n return context;\n }\n const context = {};\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i];\n const prop = visualElement.props[name];\n if (isVariantLabel(prop) || prop === false) {\n context[name] = prop;\n }\n }\n return context;\n}\n\nexport { getVariantContext };\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\nimport { shallowCompare } from '../../utils/shallow-compare.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\nimport { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\nimport { getVariantContext } from './get-variant-context.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\nconst numAnimationTypes = variantPriorityOrder.length;\nfunction animateList(visualElement) {\n return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n}\nfunction createAnimationState(visualElement) {\n let animate = animateList(visualElement);\n let state = createState();\n let isInitialRender = true;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues = (type) => (acc, definition) => {\n var _a;\n const resolved = resolveVariant(visualElement, definition, type === \"exit\"\n ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom\n : undefined);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n acc = { ...acc, ...target, ...transitionEnd };\n }\n return acc;\n };\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType) {\n const { props } = visualElement;\n const context = getVariantContext(visualElement.parent) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity;\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i];\n const typeState = state[type];\n const prop = props[type] !== undefined\n ? props[type]\n : context[type];\n const propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited = prop === context[type] &&\n prop !== props[type] &&\n propIsVariant;\n /**\n *\n */\n if (isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys };\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n continue;\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n let handledRemovedValues = false;\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState;\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n };\n const markToAnimate = (key) => {\n shouldAnimateType = true;\n if (removedKeys.has(key)) {\n handledRemovedValues = true;\n removedKeys.delete(key);\n }\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n };\n for (const key in allKeys) {\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false;\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev);\n }\n else {\n valueHasChanged = next !== prev;\n }\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n /**\n *\n */\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange;\n const needsAnimating = !willAnimateViaParent || handledRemovedValues;\n if (shouldAnimateType && needsAnimating) {\n animations.push(...definitionList.map((animation) => ({\n animation: animation,\n options: { type },\n })));\n }\n }\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation = {};\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key);\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;\n });\n animations.push({ animation: fallbackAnimation });\n }\n let shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n var _a;\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState();\n isInitialRender = true;\n },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive = false) {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n };\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n","class Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n","import { isAnimationControls } from '../../../animation/utils/is-animation-controls.mjs';\nimport { createAnimationState } from '../../../render/utils/animation-state.mjs';\nimport { Feature } from '../Feature.mjs';\n\nclass AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() {\n var _a;\n this.node.animationState.reset();\n (_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n}\n\nexport { AnimationFeature };\n","import { Feature } from '../Feature.mjs';\n\nlet id = 0;\nclass ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n }\n update() {\n if (!this.node.presenceContext)\n return;\n const { isPresent, onExitComplete } = this.node.presenceContext;\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return;\n }\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent);\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => onExitComplete(this.id));\n }\n }\n mount() {\n const { register } = this.node.presenceContext || {};\n if (register) {\n this.unmount = register(this.id);\n }\n }\n unmount() { }\n}\n\nexport { ExitAnimationFeature };\n","import { AnimationFeature } from './animation/index.mjs';\nimport { ExitAnimationFeature } from './animation/exit.mjs';\n\nconst animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n\nexport { animations };\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler);\n}\n\nexport { addDomEvent };\n","import { isPrimaryPointer } from 'motion-dom';\n\nfunction extractEventInfo(event) {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n };\n}\nconst addPointerInfo = (handler) => {\n return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n};\n\nexport { addPointerInfo, extractEventInfo };\n","import { addDomEvent } from './add-dom-event.mjs';\nimport { addPointerInfo } from './event-info.mjs';\n\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n\nexport { addPointerEvent };\n","const distance = (a, b) => Math.abs(a - b);\nfunction distance2D(a, b) {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x);\n const yDelta = distance(a.y, b.y);\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\n}\n\nexport { distance, distance2D };\n","import { isPrimaryPointer } from 'motion-dom';\nimport { secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\nimport { pipe } from '../../utils/pipe.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursoe.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n if (this.dragSnapToOrigin)\n resumeAnimation && resumeAnimation();\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n","import { mixNumber } from '../../utils/mix/number.mjs';\n\nconst SCALE_PRECISION = 0.0001;\nconst SCALE_MIN = 1 - SCALE_PRECISION;\nconst SCALE_MAX = 1 + SCALE_PRECISION;\nconst TRANSLATE_PRECISION = 0.01;\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target, maxDistance) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)) {\n delta.scale = 1.0;\n }\n if ((delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)) {\n delta.translate = 0.0;\n }\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent) {\n target.min = parent.min + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent) {\n calcRelativeAxis(target.x, relative.x, parent.x);\n calcRelativeAxis(target.y, relative.y, parent.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent) {\n target.min = layout.min - parent.min;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n","import { progress } from 'motion-utils';\nimport { calcLength } from '../../../projection/geometry/delta-calc.mjs';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\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","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\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","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale({ scale, scaleX, scaleY }) {\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY);\n}\nfunction has2DTranslate(values) {\n return is2DTranslate(values.x) || is2DTranslate(values.y);\n}\nfunction is2DTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { has2DTranslate, hasScale, hasTransform };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n const distanceFromOrigin = point - originPoint;\n const scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, { x, y }) {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\nconst TREE_SCALE_SNAP_MIN = 0.999999999999;\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001;\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\n const treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n let node;\n let delta;\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options;\n if (visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\") {\n continue;\n }\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (delta) {\n // Incoporate each ancestor's scale into a culmulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues);\n }\n }\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN) {\n treeScale.x = 1.0;\n }\n if (treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN) {\n treeScale.y = 1.0;\n }\n}\nfunction translateAxis(axis, distance) {\n axis.min = axis.min + distance;\n axis.max = axis.max + distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);\n}\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform) {\n transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX);\n transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\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","// Fixes https://github.com/motiondivision/motion/issues/2270\nconst getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n\nexport { getContextWindow };\n","import { invariant } from 'motion-utils';\nimport { setDragLock } from 'motion-dom';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { eachAxis } from '../../projection/utils/each-axis.mjs';\nimport { measurePageBox } from '../../projection/utils/measure.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { calcLength } from '../../projection/geometry/delta-calc.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst elementDragControls = new WeakMap();\n/**\n *\n */\n// let latestPointerEvent: PointerEvent\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n const { dragSnapToOrigin } = this.getProps();\n // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch\n // the component.\n dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.postRender(() => onDragStart(event, info));\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n // latestPointerEvent = event\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info);\n };\n const onSessionEnd = (event, info) => this.stop(event, info);\n const resumeAnimation = () => eachAxis((axis) => {\n var _a;\n return this.getAnimationState(axis) === \"paused\" &&\n ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());\n });\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n contextWindow: getContextWindow(this.visualElement),\n });\n }\n stop(event, info) {\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging)\n return;\n const { velocity } = info;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(event, info));\n }\n }\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n var _a;\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative.\n */\n if (prevConstraints !== this.constraints &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n pauseAnimation() {\n eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });\n }\n getAnimationState(axis) {\n var _a;\n return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial\n ? props.initial[axis]\n : undefined) || 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n axisValue.set(point[axis] - mixNumber(min, max, 0.5));\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n drag && dragListener && this.start(event);\n });\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n","import { Feature } from '../../motion/features/Feature.mjs';\nimport { noop } from 'motion-utils';\nimport { VisualElementDragControls } from './VisualElementDragControls.mjs';\n\nclass DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n }\n}\n\nexport { DragGesture };\n","import { PanSession } from './PanSession.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { Feature } from '../../motion/features/Feature.mjs';\nimport { noop } from 'motion-utils';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.postRender(() => handler(event, info));\n }\n};\nclass PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: onPan,\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n\nexport { PanGesture };\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { complex } from '../../value/types/complex/index.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { useContext, Component } from 'react';\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';\nimport { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';\nimport { globalProjectionState } from '../../../projection/node/state.mjs';\nimport { correctBorderRadius } from '../../../projection/styles/scale-border-radius.mjs';\nimport { correctBoxShadow } from '../../../projection/styles/scale-box-shadow.mjs';\nimport { addScaleCorrector } from '../../../projection/styles/scale-correction.mjs';\nimport { microtask } from '../../../frameloop/microtask.mjs';\nimport { frame } from '../../../frameloop/frame.mjs';\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n addScaleCorrector(defaultScaleCorrectors);\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n projection.root.didUpdate();\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const projection = visualElement.projection;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { projection } = this.props.visualElement;\n if (projection) {\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nfunction MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\nconst defaultScaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\n\nexport { MeasureLayout };\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\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","function isSVGElement(element) {\n return element instanceof SVGElement && element.tagName !== \"svg\";\n}\n\nexport { isSVGElement };\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n","import { secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.read(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\nfunction delayInSeconds(callback, timeout) {\n return delay(callback, secondsToMilliseconds(timeout));\n}\n\nexport { delay, delayInSeconds };\n","import { progress, noop } from 'motion-utils';\nimport { circOut } from '../../easing/circ.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\nconst numBorders = borders.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, \n // TODO Reinstate this if only child\n lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`;\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\n// /**\n// * We only want to mix the background color if there's a follow element\n// * that we're not crossfading opacity between. For instance with switch\n// * AnimateSharedLayout animations, this helps the illusion of a continuous\n// * element being animated but also cuts down on the number of paints triggered\n// * for elements where opacity is doing that work for us.\n// */\n// if (\n// !hasFollowElement &&\n// latestLeadValues.backgroundColor &&\n// latestFollowValues.backgroundColor\n// ) {\n// /**\n// * This isn't ideal performance-wise as mixColor is creating a new function every frame.\n// * We could probably create a mixer that runs at the start of the animation but\n// * the idea behind the crossfader is that it runs dynamically between two potentially\n// * changing targets (ie opacity or borderRadius may be animating independently via variants)\n// */\n// leadState.backgroundColor = followState.backgroundColor = mixColor(\n// latestFollowValues.backgroundColor as string,\n// latestLeadValues.backgroundColor as string\n// )(p)\n// }\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisDeltaInto(delta, originDelta) {\n delta.translate = originDelta.translate;\n delta.scale = originDelta.scale;\n delta.originPoint = originDelta.originPoint;\n delta.origin = originDelta.origin;\n}\n\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction axisEquals(a, b) {\n return a.min === b.min && a.max === b.max;\n}\nfunction boxEquals(a, b) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);\n}\nfunction axisEqualsRounded(a, b) {\n return (Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max));\n}\nfunction boxEqualsRounded(a, b) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\nfunction axisDeltaEquals(a, b) {\n return (a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint);\n}\n\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead) {\n this.prevLead = undefined;\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead) {\n this.promote(prevLead);\n }\n }\n }\n relegate(node) {\n const indexOfNode = this.members.findIndex((member) => node === member);\n if (indexOfNode === 0)\n return false;\n /**\n * Find the next projection node that is present\n */\n let prevLead;\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i];\n if (member.isPresent !== false) {\n prevLead = member;\n break;\n }\n }\n if (prevLead) {\n this.promote(prevLead);\n return true;\n }\n else {\n return false;\n }\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender();\n node.scheduleRender();\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true;\n }\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true;\n }\n const { crossfade } = node.options;\n if (crossfade === false) {\n prevLead.hide();\n }\n /**\n * TODO:\n * - Test border radius when previous node was deleted\n * - boxShadow mixing\n * - Shared between element A in scrolled container and element B (scroll stays the same or changes)\n * - Shared between element A in transformed container and element B (transform stays the same or changes)\n * - Shared between element A in scrolled page and element B (scroll stays the same or changes)\n * ---\n * - Crossfade opacity of root nodes\n * - layoutId changes after animation\n * - layoutId changes mid animation\n */\n }\n }\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node;\n options.onExitComplete && options.onExitComplete();\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete();\n }\n });\n }\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false);\n });\n }\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined;\n }\n }\n}\n\nexport { NodeStack };\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n","import { getValueTransition } from 'motion-dom';\nimport { noop } from 'motion-utils';\nimport { animateSingleValue } from '../../animation/animate/single-value.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\nimport { cancelFrame, frameData, frameSteps, frame } from '../../frameloop/frame.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\nimport { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\nimport { FlatTree } from '../../render/utils/flat-tree.mjs';\nimport { clamp } from '../../utils/clamp.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { SubscriptionManager } from '../../utils/subscription-manager.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcRelativePosition, calcRelativeBox, calcBoxDelta, calcLength, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { boxEqualsRounded, isDeltaZero, axisDeltaEquals, aspectRatio, boxEquals } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { globalProjectionState } from './state.mjs';\n\nconst metrics = {\n type: \"projectionFrame\",\n totalNodes: 0,\n resolvedTargetDeltas: 0,\n recalculatedProjection: 0,\n};\nconst isDebug = typeof window !== \"undefined\" && window.MotionDebug !== undefined;\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\nconst hiddenVisibility = { visibility: \"hidden\" };\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction cancelTreeOptimisedTransformAnimations(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return;\n const { visualElement } = projectionNode.options;\n if (!visualElement)\n return;\n const appearId = getOptimisedAppearId(visualElement);\n if (window.MotionHasOptimisedAnimation(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options;\n window.MotionCancelOptimisedAnimation(appearId, \"transform\", frame, !(layout || layoutId));\n }\n const { parent } = projectionNode;\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent);\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.scheduleUpdate = () => this.update();\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (isDebug) {\n metrics.totalNodes =\n metrics.resolvedTargetDeltas =\n metrics.recalculatedProjection =\n 0;\n }\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n if (isDebug) {\n window.MotionDebug.record(metrics);\n }\n };\n /**\n * Frame calculations\n */\n this.resolvedRelativeTargetAt = 0.0;\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (isLayoutDirty && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n attachResizeListener(instance, () => {\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const targetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout) ||\n hasRelativeTargetChanged;\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;\n if (this.options.layoutRoot ||\n (this.resumeFrom && this.resumeFrom.instance) ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (targetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never commited to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(this);\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate();\n this.clearAllSnapshots();\n this.nodes.forEach(clearMeasurements);\n return;\n }\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n this.isUpdating = false;\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n frameSteps.update.process(frameData);\n frameSteps.preRender.process(frameData);\n frameSteps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(this.scheduleUpdate);\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n }\n updateLayout() {\n if (!this.instance)\n return;\n // TODO: Incorporate into a forwarded scroll offset\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement) {\n const isRoot = checkIsScrollRoot(this.instance);\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n var _a;\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot);\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n }\n return box;\n }\n removeElementScroll(box) {\n var _a;\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) {\n return boxWithoutScroll;\n }\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box);\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false) {\n const withTransforms = createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!node.instance)\n continue;\n if (!hasTransform(node.latestValues))\n continue;\n hasScale(node.latestValues) && node.updateSnapshot();\n const sourceBox = createBox();\n const nodeBox = node.measurePageBox();\n copyBoxInto(sourceBox, nodeBox);\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n var _a;\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n relativeParent.layout &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n if (isDebug) {\n metrics.resolvedTargetDeltas++;\n }\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n calcProjection() {\n var _a;\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas();\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas();\n }\n else {\n copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);\n copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);\n }\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n if (this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||\n !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n if (isDebug) {\n metrics.recalculatedProjection++;\n }\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n var _a;\n (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta();\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot\n ? snapshot.latestValues\n : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n mixAxisDelta(targetDelta.x, delta.x, progress);\n mixAxisDelta(targetDelta.y, delta.y, progress);\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation && this.currentAnimation.stop();\n if (this.resumingFrom && this.resumingFrom.currentAnimation) {\n this.resumingFrom.currentAnimation.stop();\n }\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n this.currentAnimation = animateSingleValue(0, animationTarget, {\n ...options,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onComplete: () => {\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n var _a;\n const { layoutId } = this.options;\n return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;\n }\n getPrevLead() {\n var _a;\n const { layoutId } = this.options;\n return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n getProjectionStyles(styleProp) {\n var _a, _b;\n if (!this.instance || this.isSVG)\n return undefined;\n if (!this.isVisible) {\n return hiddenVisibility;\n }\n const styles = {\n visibility: \"\",\n };\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n styles.opacity = \"\";\n styles.pointerEvents =\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\n styles.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return styles;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n const emptyStyles = {};\n if (this.options.layoutId) {\n emptyStyles.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n emptyStyles.pointerEvents =\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n emptyStyles.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return emptyStyles;\n }\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n styles.transform = transformTemplate(valuesToRender, styles.transform);\n }\n const { x, y } = this.projectionDelta;\n styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n styles.opacity =\n lead === this\n ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n styles.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = styles.transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n styles[applyTo[i]] = corrected;\n }\n }\n else {\n styles[key] = corrected;\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n styles.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\"\n : \"none\";\n }\n return styles;\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n var _a;\n const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeTargetChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeTargetChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeTargetChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (isDebug) {\n metrics.totalNodes++;\n }\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDelta(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\nfunction checkNodeWasScrollRoot(node) {\n var _a;\n return node !== node.root && ((_a = node.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot);\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body.scrollLeft,\n y: document.documentElement.scrollTop || document.body.scrollTop,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n","import { DragGesture } from '../../gestures/drag/index.mjs';\nimport { PanGesture } from '../../gestures/pan/index.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\nimport { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\n\nconst drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { drag };\n","import { Feature } from '../motion/features/Feature.mjs';\nimport { hover } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\nfunction handleHoverEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\");\n }\n const eventName = (\"onHover\" + lifecycle);\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass HoverGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = hover(current, (startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\");\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\");\n });\n }\n unmount() { }\n}\n\nexport { HoverGesture };\n","import { addDomEvent } from '../events/add-dom-event.mjs';\nimport { Feature } from '../motion/features/Feature.mjs';\nimport { pipe } from '../utils/pipe.mjs';\n\nclass FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n\nexport { FocusGesture };\n","import { Feature } from '../motion/features/Feature.mjs';\nimport { press } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = press(current, (startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, { useGlobalTarget: this.node.props.globalTapTarget });\n }\n unmount() { }\n}\n\nexport { PressGesture };\n","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n","import { Feature } from '../Feature.mjs';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.unmount();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n return observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() { }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n","import { HoverGesture } from '../../gestures/hover.mjs';\nimport { FocusGesture } from '../../gestures/focus.mjs';\nimport { PressGesture } from '../../gestures/press.mjs';\nimport { InViewFeature } from './viewport/index.mjs';\n\nconst gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n\nexport { gestureAnimations };\n","import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\n\nconst layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { layout };\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.addListener(setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { initPrefersReducedMotion };\n","import { color } from '../../../value/types/color/index.mjs';\nimport { complex } from '../../../value/types/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","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n","import { warnOnce } from '../../utils/warn-once.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\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 * Check the version of the incoming motion value with this version\n * and warn against mismatches.\n */\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(nextValue.version === \"11.18.2\", `Attempting to mix Motion versions ${nextValue.version} with 11.18.2 may not work as expected.`);\n }\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 { time } from '../frameloop/sync-time.mjs';\nimport { featureDefinitions } from '../motion/features/definitions.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { isNumericalString } from '../utils/is-numerical-string.mjs';\nimport { isZeroValueString } from '../utils/is-zero-value-string.mjs';\nimport { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';\nimport { SubscriptionManager } from '../utils/subscription-manager.mjs';\nimport { warnOnce } from '../utils/warn-once.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { getAnimatableNone } from './dom/value-types/animatable-none.mjs';\nimport { findValueType } from './dom/value-types/find.mjs';\nimport { transformProps } from './html/utils/keys-transform.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { KeyframeResolver } from './utils/KeyframesResolver.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * 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, onUpdate } = visualState;\n this.onUpdate = onUpdate;\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], false);\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.\");\n }\n if (this.parent)\n this.parent.children.add(this);\n this.update(this.props, this.presenceContext);\n }\n unmount() {\n visualElementStore.delete(this.current);\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 && this.parent.children.delete(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 bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n const valueIsTransform = transformProps.has(key);\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 });\n const removeOnRenderRequest = value.on(\"renderRequest\", this.scheduleRender);\n let removeSyncCheck;\n if (window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n removeOnRenderRequest();\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 this.onUpdate && this.onUpdate(this);\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 var _a;\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : 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 var _a;\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) === null || _a === void 0 ? void 0 : _a.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}\n\nexport { VisualElement };\n","import { VisualElement } from '../VisualElement.mjs';\nimport { DOMKeyframesResolver } from './DOMKeyframesResolver.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.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 { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { isCSSVariableName } from '../dom/utils/is-css-variable.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { transformProps } from './utils/keys-transform.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 const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\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 { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\nimport { transformProps } from '../html/utils/keys-transform.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);\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 { Fragment } from 'react';\nimport { HTMLVisualElement } from '../html/HTMLVisualElement.mjs';\nimport { SVGVisualElement } from '../svg/SVGVisualElement.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nconst createDomVisualElement = (Component, options) => {\n return isSVGComponent(Component)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n });\n};\n\nexport { createDomVisualElement };\n","import { animations } from '../../../motion/features/animations.mjs';\nimport { drag } from '../../../motion/features/drag.mjs';\nimport { gestureAnimations } from '../../../motion/features/gestures.mjs';\nimport { layout } from '../../../motion/features/layout.mjs';\nimport { createMotionComponentFactory } from '../create-factory.mjs';\nimport { createDomVisualElement } from '../../dom/create-visual-element.mjs';\n\nconst createMotionComponent = /*@__PURE__*/ createMotionComponentFactory({\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}, createDomVisualElement);\n\nexport { createMotionComponent };\n","import { createDOMMotionComponentProxy } from '../create-proxy.mjs';\nimport { createMotionComponent } from './create.mjs';\n\nconst motion = /*@__PURE__*/ createDOMMotionComponentProxy(createMotionComponent);\n\nexport { motion };\n","import { useState } from 'react';\nimport { initPrefersReducedMotion } from './index.mjs';\nimport { warnOnce } from '../warn-once.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nfunction useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion();\n const [shouldReduceMotion] = useState(prefersReducedMotion.current);\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\");\n }\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n return shouldReduceMotion;\n}\n\nexport { useReducedMotion };\n","import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type RefCallback,\n} from 'react'\n\nexport type ElementState = 'active' | 'focus' | 'hover' | 'initial'\n\n// This started as a work around for https://github.com/framer/motion/issues/1221,\n// but it's so much more now. The variants in framer motion support hover, focus\n// and tap, while this effect also listens to the keypress, so that `Enter`\n// results in an active state as well.\nfunction useElementState(): [RefCallback, ElementState] {\n const ref = useRef(null)\n const [state, setState] = useState({\n focus: false,\n hover: false,\n active: false,\n })\n\n const setRef: RefCallback = useCallback(element => {\n ref.current = element\n }, [])\n\n useEffect(() => {\n const el = ref.current\n if (!el) return\n\n const pointerenter = () => setState(s => ({ ...s, hover: true }))\n const pointerleave = () => setState(s => ({ ...s, hover: false }))\n const focus = () => setState(s => ({ ...s, focus: true }))\n const blur = () => setState(s => ({ ...s, focus: false }))\n const pointerdown = () => {\n setState(s => ({ ...s, active: true }))\n\n // pointer events can be cancelled due to which el would never receive\n // a pointerup nor pointercancel event. Listen on the window for those\n // after we received the pointerdown event, and only catch it once. But\n // not with { once: true }, because we want te remove both of them, once\n // of them has been received.\n const pointerup = () => {\n setState(s => ({ ...s, active: false }))\n window.removeEventListener('pointerup', pointerup)\n window.removeEventListener('pointercancel', pointerup)\n }\n\n window.addEventListener('pointerup', pointerup)\n window.addEventListener('pointercancel', pointerup)\n }\n\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== 'Enter') {\n return\n }\n\n setState(s => ({ ...s, active: true }))\n\n // when clicking a link, the keyup doesn't need to come from the keydown\n // element. We listen on the window instead, but only once.\n const keyup = () => setState(s => ({ ...s, active: false }))\n window.addEventListener('keyup', keyup, { once: true })\n }\n\n el.addEventListener('pointerenter', pointerenter)\n el.addEventListener('pointerleave', pointerleave)\n el.addEventListener('focus', focus)\n el.addEventListener('blur', blur)\n el.addEventListener('pointerdown', pointerdown)\n el.addEventListener('keydown', keydown)\n\n return () => {\n el.removeEventListener('pointerenter', pointerenter)\n el.removeEventListener('pointerleave', pointerleave)\n el.removeEventListener('focus', focus)\n el.removeEventListener('blur', blur)\n el.removeEventListener('pointerdown', pointerdown)\n el.removeEventListener('keydown', keydown)\n }\n }, [])\n\n const status: ElementState = state.active\n ? 'active'\n : state.focus\n ? 'focus'\n : state.hover\n ? 'hover'\n : 'initial'\n\n return [setRef, status]\n}\n\nexport { useElementState }\n","import { clsx } from 'clsx'\n\nconst arrowRotationMap = {\n up: 'rotate-180',\n right: '-rotate-90',\n down: 'rotate-0',\n left: 'rotate-90',\n 'top-right': '-rotate-135',\n}\n\nexport function ArrowIcon({\n direction,\n size = 32,\n className,\n}: {\n direction: 'up' | 'right' | 'down' | 'left' | 'top-right'\n size?: number\n className?: string\n}) {\n return (\n \n \n \n )\n}\n\nexport function CheckIcon() {\n return (\n \n \n \n )\n}\n\nexport function CopyIcon() {\n return (\n \n \n \n \n )\n}\n\nexport function GithubIcon({\n size = 24,\n title = 'GitHub',\n}: {\n size?: number\n title?: string\n}) {\n return (\n \n {title}\n \n \n )\n}\n\nexport function LaptopIcon({ size = 24 }: { size?: number } = {}) {\n return (\n \n \n \n )\n}\n\nexport function MoonIcon() {\n return (\n \n \n \n )\n}\n\nexport function PlayIcon() {\n return (\n \n \n \n \n )\n}\n\nexport function PlusIcon() {\n return (\n \n \n \n \n )\n}\n\nexport function RssIcon({\n size = 24,\n title = 'RSS',\n className,\n}: {\n size?: number\n title?: string\n className?: string\n}) {\n return (\n \n {title}\n \n \n \n \n )\n}\n\nexport function SearchIcon() {\n return (\n \n \n \n )\n}\n\nexport function SpinnerIcon({\n size = 24,\n ...svgProps\n}: { size?: number } & React.SVGProps) {\n return (\n \n \n \n \n )\n}\n\nexport function SunIcon() {\n return (\n \n \n \n \n \n \n \n \n \n \n \n )\n}\n\nexport function XIcon({\n size = 24,\n title = '𝕏',\n}: {\n size?: number\n title?: string\n}) {\n return (\n \n {title}\n \n \n )\n}\n","import { clsx } from 'clsx'\nimport * as React from 'react'\n\ntype TitleProps = {\n variant?: 'primary' | 'secondary'\n as?: React.ElementType\n className?: string\n id?: string\n style?: React.CSSProperties\n} & (\n | { children: React.ReactNode }\n | {\n dangerouslySetInnerHTML: {\n __html: string\n }\n }\n)\n\nconst fontSize = {\n h1: 'leading-tight text-4xl md:text-5xl',\n h2: 'leading-tight text-3xl md:text-4xl',\n h3: 'text-2xl font-medium md:text-3xl',\n h4: 'text-xl font-medium md:text-2xl',\n h5: 'text-lg font-medium md:text-xl',\n h6: 'text-lg font-medium',\n}\n\nconst titleColors = {\n primary: 'text-black dark:text-white',\n secondary: 'text-gray-600 dark:text-slate-500',\n}\n\nfunction Title({\n variant = 'primary',\n size,\n as,\n className,\n ...rest\n}: TitleProps & { size: keyof typeof fontSize }) {\n const Tag = as ?? size\n return (\n \n )\n}\n\nfunction H1(props: TitleProps) {\n return \n}\n\nfunction H2(props: TitleProps) {\n return <Title {...props} size=\"h2\" />\n}\n\nfunction H3(props: TitleProps) {\n return <Title {...props} size=\"h3\" />\n}\n\nfunction H4(props: TitleProps) {\n return <Title {...props} size=\"h4\" />\n}\n\nfunction H5(props: TitleProps) {\n return <Title {...props} size=\"h5\" />\n}\n\nfunction H6(props: TitleProps) {\n return <Title {...props} size=\"h6\" />\n}\n\ntype ParagraphProps = {\n className?: string\n prose?: boolean\n textColorClassName?: string\n as?: React.ElementType\n} & (\n | { children: React.ReactNode }\n | { dangerouslySetInnerHTML: { __html: string } }\n)\n\nfunction Paragraph({\n className,\n prose = true,\n as = 'p',\n textColorClassName = 'text-secondary',\n ...rest\n}: ParagraphProps) {\n return React.createElement(as, {\n className: clsx('max-w-full text-lg', textColorClassName, className, {\n 'prose prose-light dark:prose-dark': prose,\n }),\n ...rest,\n })\n}\n\nexport { H1, H2, H3, H4, H5, H6, Paragraph }\n","import { Link, type LinkProps } from '@remix-run/react'\nimport { clsx } from 'clsx'\nimport { motion, useReducedMotion, type Variant } from 'framer-motion'\nimport {\n useElementState,\n type ElementState,\n} from './hooks/use-element-state.tsx'\nimport { ArrowIcon } from './icons.tsx'\nimport { H6 } from './typography.tsx'\n\ntype ArrowIconProps = React.ComponentProps<typeof ArrowIcon>\n\nconst arrowVariants: Record<\n ArrowIconProps['direction'],\n Record<ElementState, Variant>\n> = {\n down: {\n initial: { y: 0 },\n hover: { y: 4 },\n focus: {\n y: [0, 4, 0],\n transition: { repeat: Infinity },\n },\n active: { y: 12 },\n },\n up: {\n initial: { y: 0 },\n hover: { y: -4 },\n focus: {\n y: [0, -4, 0],\n transition: { repeat: Infinity },\n },\n active: { y: -12 },\n },\n left: {\n initial: { x: 0 },\n hover: { x: -4 },\n focus: {\n x: [0, -4, 0],\n transition: { repeat: Infinity },\n },\n active: { x: -12 },\n },\n right: {\n initial: { x: 0 },\n hover: { x: 4 },\n focus: {\n x: [0, 4, 0],\n transition: { repeat: Infinity },\n },\n active: { x: 12 },\n },\n 'top-right': {\n initial: { x: 0, y: 0 },\n hover: { x: 4, y: -4 },\n focus: {\n x: [0, 4, 0],\n y: [0, -4, 0],\n transition: { repeat: Infinity },\n },\n active: { x: 12, y: -12 },\n },\n}\n\ntype ArrowButtonBaseProps = {\n direction?: ArrowIconProps['direction']\n children?: React.ReactNode | React.ReactNode[]\n className?: string\n textSize?: 'small' | 'medium'\n}\n\ntype ArrowLinkProps = {\n direction?: ArrowIconProps['direction']\n} & ({ href?: string; to?: never } | { href?: never; to: LinkProps['to'] }) &\n ArrowButtonBaseProps & { prefetch?: 'intent' | 'render' | 'none' }\n\ntype ArrowButtonProps = {\n onClick?: JSX.IntrinsicElements['button']['onClick']\n type?: JSX.IntrinsicElements['button']['type']\n} & ArrowButtonBaseProps\n\n// whileFocus takes precedence over whileTap, so while we can't move the arrow\n// on focus (or on tap), we can still color and animate the circle.\n// See: https://github.com/framer/motion/issues/1221\nfunction getBaseProps({ textSize, className }: ArrowButtonBaseProps) {\n return {\n className: clsx(\n 'text-primary inline-flex items-center text-left font-medium focus:outline-none cursor-pointer transition',\n {\n 'text-xl': textSize === 'medium',\n 'text-lg': textSize === 'small',\n },\n className,\n ),\n }\n}\n\nfunction ArrowButtonContent({\n children,\n direction = 'right',\n}: Pick<ArrowButtonBaseProps, 'children' | 'direction'>) {\n const shouldReduceMotion = useReducedMotion()\n\n return (\n <>\n {children &&\n (direction === 'right' ||\n direction === 'up' ||\n direction === 'top-right') ? (\n <span className=\"text-xl font-medium\">{children}</span>\n ) : null}\n\n <div className=\"relative inline-flex h-14 w-14 flex-none items-center justify-center p-1\">\n <motion.span\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n variants={shouldReduceMotion ? {} : arrowVariants[direction]}\n >\n <ArrowIcon direction={direction} />\n </motion.span>\n </div>\n\n {children && (direction === 'left' || direction === 'down') ? (\n <span className=\"ml-8 text-xl font-medium\">{children}</span>\n ) : null}\n </>\n )\n}\n\nfunction ArrowButton({ onClick, type, ...props }: ArrowButtonProps) {\n const [ref, state] = useElementState()\n const shouldReduceMotion = useReducedMotion()\n\n return (\n <motion.button\n onClick={onClick}\n type={type}\n {...getBaseProps(props)}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowButtonContent {...props} />\n </motion.button>\n )\n}\n\nconst MotionLink = motion(Link)\n\nfunction ArrowLink({ to, href, ...props }: ArrowLinkProps) {\n const [ref, state] = useElementState()\n const shouldReduceMotion = useReducedMotion()\n\n if (href) {\n return (\n <motion.a\n href={href}\n {...getBaseProps(props)}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowButtonContent {...props} />\n </motion.a>\n )\n } else if (to) {\n return (\n <MotionLink\n to={to}\n {...getBaseProps(props)}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowButtonContent {...props} />\n </MotionLink>\n )\n }\n throw new Error('Must provide either to or href to ArrowLink')\n}\n\nfunction BackLink({\n to,\n className,\n children,\n}: { to: LinkProps['to'] } & Pick<ArrowLinkProps, 'className' | 'children'>) {\n const [ref, state] = useElementState()\n const shouldReduceMotion = useReducedMotion()\n return (\n <MotionLink\n to={to}\n className={clsx(\n 'text-primary flex space-x-4 focus:outline-none',\n className,\n )}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <motion.span\n variants={shouldReduceMotion ? {} : arrowVariants.left}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowIcon direction=\"left\" />\n </motion.span>\n <H6 as=\"span\">{children}</H6>\n </MotionLink>\n )\n}\n\nexport { ArrowButton, ArrowLink, BackLink }\n","export var ConditionOperators = {\n equal: \"eq\",\n notEqual: \"ne\",\n lessThan: \"lt\",\n greaterThan: \"gt\",\n lessOrEqual: \"lte\",\n greaterOrEqual: \"gte\",\n include: \"in\",\n notInclude: \"nin\",\n};\n","export var STORAGE_TYPES = {\n UPLOAD: 'upload',\n FETCH: 'fetch',\n PRIVATE: 'private',\n AUTHENTICATED: 'authenticated',\n SPRITE: 'sprite',\n FACEBOOK: 'facebook',\n TWITTER: 'twitter',\n YOUTUBE: 'youtube',\n VIMEO: 'vimeo',\n MULTI: 'multi',\n INSTAGRAM: 'instagram',\n HULU: 'hulu',\n ANIMOTO: 'animoto',\n DAILYMOTION: 'dailymotion'\n};\nexport var RESOURCE_TYPES = {\n IMAGE: 'image',\n VIDEO: 'video',\n RAW: 'raw'\n};\nexport var VIDEO_SOURCE_TYPES = {\n WEBM: 'webm',\n MP4: 'mp4',\n OGV: 'ogv',\n FLV: 'flv',\n M3U8: 'm3u8',\n TS: 'ts',\n MOV: 'mov',\n MKV: 'mkv',\n MPD: 'mpd'\n};\nexport var ImageFormats = {\n GIF: \"gif\",\n PNG: \"png\",\n JPG: \"jpg\",\n BMP: \"bmp\",\n ICO: \"ico\",\n PDF: \"pdf\",\n TIFF: \"tiff\",\n EPS: \"eps\",\n JPC: \"jpc\",\n JP2: \"jp2\",\n PSD: \"psd\",\n WEBP: \"webp\",\n ZIP: \"zip\",\n SVG: \"svg\",\n WDP: \"wdp\",\n HDX: \"hpx\",\n DJVU: \"djvu\",\n AI: \"ai\",\n FLIF: \"flif\",\n BPG: \"bpg\",\n MIFF: \"miff\",\n TGA: \"tga\",\n HEIC: \"heic\",\n};\n","export var ValueAssignable = {\n context: \"ctx\",\n structureMetadata: \"md\"\n};\nexport var VariableFormats = {\n integer: 'integer',\n float: 'float'\n};\n","export var SEO_TYPES = {\n \"image/upload\": \"images\",\n \"image/private\": \"private_images\",\n \"image/authenticated\": \"authenticated_images\",\n \"raw/upload\": \"files\",\n \"video/upload\": \"videos\"\n};\nexport var TRANSFORMERS = {\n angle: 'a',\n rotate: 'a',\n background: 'b',\n color: 'co',\n colorSpace: 'cs',\n customFunction: 'fn',\n defaultImage: 'd',\n density: 'dn',\n dpr: 'dpr',\n opacity: 'o',\n format: 'f',\n gravity: 'g',\n overlay: 'l',\n page: 'pg',\n prefix: 'p',\n quality: 'q',\n radius: 'r',\n bitRate: 'br',\n keyframeInterval: 'ki',\n audioCodec: 'ac',\n audioFrequency: 'af',\n delay: 'dl',\n ocr: 'ocr',\n streamingProfile: 'sp',\n transformation: 't',\n underlay: 'u',\n videoCodec: 'vc',\n videoSampling: 'vs',\n zoom: 'z'\n};\n","export var ArithmeticExpression = {\n \"=\": 'eq',\n \"!=\": 'ne',\n \"<\": 'lt',\n \">\": 'gt',\n \"<=\": 'lte',\n \">=\": 'gte',\n \"&&\": 'and',\n \"||\": 'or',\n \"*\": \"mul\",\n \"/\": \"div\",\n \"+\": \"add\",\n \"-\": \"sub\",\n \"^\": \"pow\",\n};\nexport var PredefinedVariables = {\n width: 'w',\n height: 'h',\n x: 'x',\n y: 'y',\n quality: 'q',\n if: 'if',\n aspectRatio: 'ar',\n rotate: 'a',\n opacity: 'o',\n radius: 'r',\n dpr: 'dpr',\n effect: 'e',\n border: 'bo',\n currentPage: 'cp',\n preview: 'preview:duration',\n duration: 'du',\n faceCount: 'fc',\n initialAspectRatio: 'iar',\n initialDuration: 'idu',\n initialHeight: 'ih',\n initialWidth: 'iw',\n pageCount: 'pc',\n pageX: 'px',\n pageY: 'py',\n tags: 'tags',\n};\nexport var Prefix = '$';\nexport var PreDefinedPatterns = \"(\" + Object.keys(PredefinedVariables).join('|') + \")\";\nexport var AcceptNumbericVars = ['quality', 'if', 'rotate', 'zoom', 'opacity', 'radius', 'effect', 'dpr'];\n","export var ConditionalParams = {\n width: 'w',\n initialWidth: 'iw',\n height: 'h',\n initialHeight: 'ih',\n aspectRatio: 'ar',\n intialAspectRatio: 'iar',\n context: 'ctx',\n metadata: 'md',\n tags: 'tags',\n trimmedAspectRatio: 'tar',\n currentPage: 'cp',\n faceCount: 'fc',\n pageCount: 'pc',\n pageXOffset: 'px',\n pageYOffset: 'py',\n initialDensity: 'idn',\n illustration: 'ils',\n pageNames: 'pgnames'\n};\n","export var toString = function (arr, separation) {\n if (separation === void 0) { separation = ':'; }\n return arr.filter(Boolean).join(separation);\n};\nexport var cleanText = function (text) { return encodeURIComponent(text).replace(/%(23|2C|2F|3F|5C)/g, '%25$1'); };\n","import transform, { toTransformationStr } from \".\";\nimport { ConditionOperators } from \"@cld-apis/utils\";\nimport { ConditionalParams } from '../constants/condition';\nimport { toString } from \"../utils\";\nexport var computeCondition = function (conditionObj) {\n var expression = conditionObj.expression ? toString(conditionObj.expression.map(function (exp) { return computeConditionExpression(exp); }), '_and_') : '';\n var transformations = conditionObj.transformations.map(function (transformation) { return toTransformationStr(transform(transformation)); });\n return {\n expression: expression,\n transformations: toString(transformations, '/')\n };\n};\nexport var mapCharacteristic = function (expression) { return ConditionalParams[expression] || expression; };\nexport var computeConditionExpression = function (expression) {\n var characteristic = Array.isArray(expression.characteristic) ? toString(expression.characteristic.map(mapCharacteristic)) : mapCharacteristic(expression.characteristic);\n var operator = ConditionOperators[expression.operator];\n var value = isNaN(expression.value) ? \"!\" + expression.value + \"!\" : expression.value;\n return toString([characteristic, operator, value], '_');\n};\nexport var condition = function (conditionObj) {\n if (!conditionObj || !conditionObj.if || !conditionObj.if.expression)\n return '';\n var ifCondition = computeCondition(conditionObj.if);\n var elseCondition = conditionObj.else ? computeCondition(conditionObj.else) : null;\n var formattedIf = toString([\"if_\" + ifCondition.expression, ifCondition.transformations], '/');\n var formattedElse = elseCondition ? toString(['if_else', elseCondition.transformations], '/') : '';\n return [toString([formattedIf, formattedElse, 'if_end'], '/')];\n};\n","import { toString } from '../utils';\nexport var effect = function (obj) {\n var isString = typeof obj === 'string';\n if (!obj || (!isString && !obj.name))\n return '';\n if (isString || !obj.value)\n return \"e_\" + (obj.name || obj);\n var value = Array.isArray(obj.value) ? obj.value.join(':') : obj.value;\n var effectValue = toString([obj.name, value]);\n return \"e_\" + effectValue;\n};\n","export var Prefix = '$';\nexport var StringBound = '!';\nexport var ValueAssignable = {\n context: \"ctx\",\n structureMetadata: \"md\"\n};\nexport var Formats = {\n integer: 'to_i',\n float: 'to_f'\n};\n","import { ArithmeticExpression, PreDefinedPatterns, PredefinedVariables } from '../constants/arithmetic';\nimport { Prefix } from '../constants/variable';\nvar OPERATORS_REGEX = \"((\\\\|\\\\||>=|<=|&&|!=|>|=|<|/|-|\\\\+|\\\\*|\\\\^)(?=[ _]))\";\nvar mapArithmeticExpression = function (orgExpression) {\n var regex = new RegExp(OPERATORS_REGEX, 'g');\n return orgExpression.replace(regex, function (match) { return ArithmeticExpression[match]; });\n};\nvar mapPredefinedVariables = function (orgExpression) {\n var regex = new RegExp(PreDefinedPatterns, 'g');\n return orgExpression.replace(regex, function (match, p, index) { return orgExpression[index - 1] === Prefix ? match : PredefinedVariables[match]; });\n};\nexport var formatValue = function (value) { return isNaN(value) ? convert(value) : value; };\nexport var convert = function (expression) {\n if (!expression)\n return '';\n var mappedArithmetic = mapArithmeticExpression(expression);\n var converted = mapPredefinedVariables(mappedArithmetic);\n return converted.replace(/[ _]+/g, '_');\n};\nexport var hasArithmeticExpression = function (expression) {\n var regex = new RegExp(OPERATORS_REGEX, 'g');\n return regex.test(expression);\n};\n","export var flags = function (value) {\n if (!value || value.length === 0)\n return '';\n var flagValue = typeof value === 'string' ? value : value.join(':');\n return \"fl_\" + flagValue;\n};\n","export var rawTransformation = function (value) { return value; };\n","import { Formats, Prefix } from \"../constants/variable\";\nimport { ValueAssignable } from '@cld-apis/utils';\nimport { toString } from \"../utils\";\nimport { convert, hasArithmeticExpression } from \"./expression\";\nexport var convertStringValueType = function (value) {\n if (!value || !value.expression)\n return '';\n var expression = Array.isArray(value.expression) ? toString(value.expression) : value.expression;\n var isArithmetic = hasArithmeticExpression(expression);\n var convertedExpression = convert(expression);\n var format = Formats[value.formatAs] || '';\n var mappedExpression = convertedExpression && !isArithmetic ? \"!\" + convertedExpression + \"!\" : convertedExpression;\n return toString([mappedExpression, format], '_');\n};\nexport var computeVariable = function (variable) {\n var name = \"\" + Prefix + variable.name;\n var value = variable.value;\n if (isNaN(variable.value)) {\n if (Array.isArray(variable.value)) {\n value = toString(variable.value);\n }\n else {\n value = convertStringValueType(variable.value);\n }\n }\n var varValue = toString([ValueAssignable[variable.assignFrom], value], ':');\n return varValue ? toString([name, varValue], '_') : '';\n};\nexport var variables = function (value) {\n if (!value)\n return '';\n if (!Array.isArray(value))\n return computeVariable(value);\n return toString(value.map(function (variable) { return computeVariable(variable); }), ',');\n};\n","import { toString } from \"../../utils\";\nexport var fps = function (value) {\n var isObj = typeof value === 'object';\n if (!value || (isObj && !value.min))\n return '';\n var range = isObj ? toString([value.min, value.max], '-') : value;\n return \"fps_\" + range;\n};\n","export var offset = function (obj) {\n if (!obj)\n return '';\n var start = obj.start ? \"so_\" + obj.start : '';\n var end = obj.end ? \"eo_\" + obj.end : '';\n var duration = obj.duration ? \"du_\" + obj.duration : '';\n return [start, end, duration].filter(Boolean).join(',');\n};\n","import { formatValue } from \"./expression\";\nexport var resize = function (_a) {\n var type = _a.type, width = _a.width, height = _a.height, aspectRatio = _a.aspectRatio;\n var w = width ? \"w_\" + formatValue(width) : '';\n var h = height ? \"h_\" + formatValue(height) : '';\n var crop = type ? \"c_\" + type : '';\n var ar = aspectRatio ? \"ar_\" + formatValue(aspectRatio) : '';\n return [crop, w, h, ar].filter(Boolean).join();\n};\n","import { convert } from './expression';\nexport var border = function (_a) {\n var _b = _a.type, type = _b === void 0 ? 'solid' : _b, _c = _a.color, color = _c === void 0 ? 'black' : _c, width = _a.width;\n if (!width)\n return '';\n var formattedValue = isNaN(width) ? convert(width) : width + \"px\";\n return \"bo_\" + formattedValue + \"_\" + type + \"_\" + color;\n};\n","import { formatValue } from './expression';\nexport var position = function (_a) {\n var x = _a.x, y = _a.y;\n var xAxis = x ? \"x_\" + formatValue(x) : '';\n var yAxis = y ? \"y_\" + formatValue(y) : '';\n return [xAxis, yAxis].filter(Boolean).join();\n};\n","import { TRANSFORMERS } from '../constants';\nimport { AcceptNumbericVars } from '../constants/arithmetic';\nimport { condition } from './condition';\nimport { effect } from './effect';\nimport { formatValue } from './expression';\nimport { flags } from './flags';\nimport { rawTransformation } from './rawTransformation';\nimport { variables } from './variables';\nimport { fps } from './video/fps';\nimport { offset } from './video/offset';\nimport { resize } from './resize';\nimport { border } from './border';\nimport { position } from './position';\nexport var getResize = function (options) {\n var hasResize = options.resize || options.width || options.height || options.aspectRatio;\n if (!hasResize)\n return '';\n return resize(options.resize || { width: options.width, height: options.height, type: options.crop, aspectRatio: options.aspectRatio });\n};\nexport var getBorder = function (options) {\n if (!options.border)\n return '';\n var borderModification = (typeof options.border === 'string') ? \"bo_\" + options.border : border(options.border);\n return borderModification;\n};\nexport var getPosition = function (options) {\n if (!options.x && !options.y && !options.position)\n return '';\n return position(options.position || { x: options.x, y: options.y });\n};\nexport var getTransformations = function (options) {\n var result = [];\n result.push(variables(options.variables));\n result.push(getResize(options));\n result.push(getBorder(options));\n result.push(getPosition(options));\n result.push(fps(options.fps));\n result.push(offset(options.offset));\n for (var modifier in options) {\n var value = options[modifier];\n var mapping = TRANSFORMERS[modifier];\n if (!mapping || !value)\n continue;\n var isAcceptedNumberic = AcceptNumbericVars.includes(modifier);\n result.push(mapping + \"_\" + (isAcceptedNumberic ? formatValue(value) : value));\n }\n result.push(effect(options.effect));\n result.push(flags(options.flags));\n result.push(rawTransformation(options.rawTransformation));\n result.push(condition(options.condition));\n return result.filter(Boolean);\n};\nexport var transform = function (options) {\n var transformations = getTransformations(options);\n var chainedTransformations = options.transformation || options.chaining;\n if (chainedTransformations && Array.isArray(chainedTransformations)) {\n chainedTransformations.forEach(function (chained) {\n var chainedTransformation = getTransformations(chained);\n chainedTransformation.length > 0 && transformations.push(chainedTransformation);\n });\n }\n return transformations.filter(Boolean);\n};\nexport var toTransformationStr = function (transformations) { return transformations.reduce(function (str, transformation) {\n var isChained = Array.isArray(transformation);\n var separation = isChained ? '/' : ',';\n return \"\" + str + (str ? separation : '') + transformation.toString();\n}, ''); };\nexport default transform;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { SEO_TYPES } from \"./constants\";\nimport { RESOURCE_TYPES, STORAGE_TYPES } from '@cld-apis/utils';\nimport { toTransformationStr, transform } from './transformers';\nvar SHARED_CDNS = [\"cloudinary-a.akamaihd.net\", \"res.cloudinary.com\"];\nvar CLOUDINARY_REGEX = /^.+\\.cloudinary\\.com\\/(?:[^\\/]+\\/)(?:(image|video|raw)\\/)?(?:(upload|fetch|private|authenticated|sprite|facebook|twitter|youtube|vimeo)\\/)?(?:(?:[^_/]+_[^,/]+,?)*\\/)?(?:v(\\d+|\\w{1,2})\\/)?([^\\.^\\s]+)(?:\\.(.+))?$/;\nexport var extractPublicId = function (link) {\n if (!link)\n return '';\n var parts = CLOUDINARY_REGEX.exec(link);\n return parts && parts.length > 2 ? parts[parts.length - 2] : link;\n};\nexport var getSignature = function (signature) {\n if (!signature)\n return '';\n var isFormatted = signature.indexOf('s--') === 0 && signature.endsWith('--');\n return isFormatted ? signature : \"s--\" + signature + \"--\";\n};\nvar doesPathNeedVersion = function (publicId) { return !publicId.match(/^v[0-9]+/) && !publicId.match(/^https?:\\//); };\nexport var encodePublicId = function (publicId) { return encodeURIComponent(publicId).replace(/%3A/g, ':').replace(/%2F/g, '/'); };\nexport var getVersion = function (publicId, _a) {\n var _b = _a.forceVersion, forceVersion = _b === void 0 ? false : _b, _c = _a.version, version = _c === void 0 ? 1 : _c;\n var needVersion = doesPathNeedVersion(publicId) && forceVersion;\n return needVersion ? \"v\" + version : '';\n};\nexport var getSubDomain = function (publicId, _a) {\n var _b = _a.cdnSubdomain, cdnSubdomain = _b === void 0 ? false : _b, cname = _a.cname;\n if (!cname)\n return \"res\" + (cdnSubdomain ? \"-\" + publicId : '');\n return cdnSubdomain ? \"a\" + publicId + \".\" : '';\n};\nexport var getPrefix = function (publicId, _a) {\n var cloudName = _a.cloudName, _b = _a.privateCdn, privateCdn = _b === void 0 ? false : _b, _c = _a.cdnSubdomain, cdnSubdomain = _c === void 0 ? false : _c, secureDistribution = _a.secureDistribution, cname = _a.cname, _d = _a.secure, secure = _d === void 0 ? true : _d;\n var hasSecureDistribution = secure && secureDistribution && !SHARED_CDNS.includes(secureDistribution);\n var protocol = \"http\" + (secure ? 's' : '') + \"://\";\n var cdn = privateCdn && !hasSecureDistribution ? cloudName + \"-\" : '';\n var accountPath = privateCdn ? '' : \"/\" + cloudName;\n var subDomain = hasSecureDistribution ? '' : getSubDomain(publicId, { cdnSubdomain: cdnSubdomain, cname: cname });\n var host = hasSecureDistribution ? secureDistribution : (cname || '.cloudinary.com');\n return \"\" + protocol + cdn + subDomain + host + accountPath;\n};\nexport var getResourceType = function (_a) {\n var _b = _a.resourceType, resourceType = _b === void 0 ? RESOURCE_TYPES.IMAGE : _b, _c = _a.storageType, storageType = _c === void 0 ? STORAGE_TYPES.UPLOAD : _c, urlSuffix = _a.urlSuffix, useRootPath = _a.useRootPath, shortern = _a.shortern;\n var isUploadImage = resourceType === RESOURCE_TYPES.IMAGE && storageType === STORAGE_TYPES.UPLOAD;\n var useRootForNonUploadedImages = useRootPath && !isUploadImage;\n var shortenForUploadedImages = shortern && isUploadImage;\n var typePath = resourceType + \"/\" + storageType;\n if (useRootForNonUploadedImages) {\n throw new Error(\"Root path only supported for image/upload\");\n }\n if (useRootPath)\n return \"\" + (shortenForUploadedImages ? 'iu' : '');\n if (urlSuffix) {\n var seo = SEO_TYPES[typePath];\n if (seo) {\n return seo;\n }\n throw new Error(\"URL Suffix only supported for \" + Object.keys(SEO_TYPES).join(', '));\n }\n return typePath;\n};\nvar isUrl = function (str) { return str && !!str.match(/^https?:\\//); };\nexport var getPathToAsset = function (publicId, _a) {\n var _b = _a.urlSuffix, urlSuffix = _b === void 0 ? '' : _b;\n if (isUrl(publicId))\n return encodePublicId(publicId);\n var path = [publicId, urlSuffix].filter(Boolean).join('/');\n return encodePublicId(path);\n};\nexport var url = function (publicId, cloud, options) {\n if (cloud === void 0) { cloud = { cloudName: '' }; }\n if (!cloud.cloudName) {\n throw Error('cloudName is required!');\n }\n var _publicId = isUrl(publicId) ? extractPublicId(publicId) : publicId;\n var version = getVersion(_publicId, cloud);\n var prefix = getPrefix(_publicId, cloud);\n var signature = getSignature(cloud.signature);\n var typePath = getResourceType(cloud);\n var pathToAsset = getPathToAsset(_publicId, { urlSuffix: cloud.urlSuffix });\n var format = options.fetchFormat || options.format || 'auto';\n var $options = __assign(__assign({ quality: 'auto' }, options), { format: format });\n var trans = toTransformationStr(transform($options));\n return [prefix, typePath, signature, trans, version, pathToAsset].filter(Boolean).join('/').replace(' ', '%20');\n};\nexport default url;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { RESOURCE_TYPES } from '@cld-apis/utils';\nimport { url, extractPublicId } from './url';\nimport { transform, toTransformationStr } from './transformers';\nvar config = {};\nexport var getConfig = function () { return Object.freeze(config); };\nexport var setConfig = function (options) { return config = __assign(__assign({}, config), options); };\nexport var buildUrl = function (publicId, _a) {\n var _b = _a.cloud, cloud = _b === void 0 ? {} : _b, _c = _a.transformations, transformations = _c === void 0 ? {} : _c;\n var cloudConfig = __assign(__assign({}, config), cloud);\n return url(publicId, cloudConfig, transformations);\n};\nexport var buildImageUrl = function (publicId, _a) {\n var _b = _a.cloud, cloud = _b === void 0 ? {} : _b, _c = _a.transformations, transformations = _c === void 0 ? {} : _c;\n return buildUrl(publicId, {\n cloud: __assign(__assign({}, cloud), { resourceType: RESOURCE_TYPES.IMAGE }),\n transformations: transformations\n });\n};\nexport var buildVideoUrl = function (publicId, _a) {\n var _b = _a.cloud, cloud = _b === void 0 ? {} : _b, _c = _a.transformations, transformations = _c === void 0 ? {} : _c;\n return buildUrl(publicId, {\n cloud: __assign(__assign({}, cloud), { resourceType: RESOURCE_TYPES.VIDEO }),\n transformations: transformations\n });\n};\nvar Transformer = { transform: transform, toString: toTransformationStr };\nexport { extractPublicId, Transformer };\nexport default buildUrl;\n","export default () => {\n\t// https://mths.be/emoji\n\treturn /[#*0-9]\\uFE0F?\\u20E3|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26AA\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C8\\u26CF\\u26D1\\u26E9\\u26F0-\\u26F5\\u26F7\\u26F8\\u26FA\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B55\\u3030\\u303D\\u3297\\u3299]\\uFE0F?|[\\u261D\\u270C\\u270D](?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|[\\u270A\\u270B](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u2693\\u26A1\\u26AB\\u26C5\\u26CE\\u26D4\\u26EA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2795-\\u2797\\u27B0\\u27BF\\u2B50]|\\u26D3\\uFE0F?(?:\\u200D\\uD83D\\uDCA5)?|\\u26F9(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\u2764\\uFE0F?(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\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C68|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDC68\\uDC69]\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDC69(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?[\\uDC68\\uDC69]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|\\uDC69\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?))|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDC6F(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDD75(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDE2E(?:\\u200D\\uD83D\\uDCA8)?|\\uDE35(?:\\u200D\\uD83D\\uDCAB)?|\\uDE36(?:\\u200D\\uD83C\\uDF2B\\uFE0F?)?|\\uDE42(?:\\u200D[\\u2194\\u2195]\\uFE0F?)?|\\uDEB6(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?)|\\uD83E(?:[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5\\uDEC3-\\uDEC5\\uDEF0\\uDEF2-\\uDEF8](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD\\uDDCF\\uDDD4\\uDDD6-\\uDDDD](?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDDDE\\uDDDF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCC\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE7C\\uDE80-\\uDE89\\uDE8F-\\uDEC2\\uDEC6\\uDECE-\\uDEDC\\uDEDF-\\uDEE9]|\\uDD3C(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF])?|\\uDDCE(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?|\\uDDD1(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1|\\uDDD1\\u200D\\uD83E\\uDDD2(?:\\u200D\\uD83E\\uDDD2)?|\\uDDD2(?:\\u200D\\uD83E\\uDDD2)?))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\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?)/g;\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar md5 = function md5(str) {\n /**\n * bitwise left shift or zero fill right shift\n * @param {*} k\n * @param {*} d\n */\n var L = function L(k, d) {\n return k << d | k >>> 32 - d;\n };\n\n var K = function K(G, k) {\n var I = void 0,\n d = void 0,\n F = void 0,\n H = void 0,\n x = void 0;\n\n F = G & 2147483648;\n H = k & 2147483648;\n I = G & 1073741824;\n d = k & 1073741824;\n x = (G & 1073741823) + (k & 1073741823);\n\n if (I & d) return x ^ 2147483648 ^ F ^ H;\n\n if (I | d) {\n if (x & 1073741824) return x ^ 3221225472 ^ F ^ H;else return x ^ 1073741824 ^ F ^ H;\n } else return x ^ F ^ H;\n };\n\n var r = function r(d, F, k) {\n return d & F | ~d & k;\n };\n\n var q = function q(d, F, k) {\n return d & k | F & ~k;\n };\n\n var p = function p(d, F, k) {\n return d ^ F ^ k;\n };\n\n var n = function n(d, F, k) {\n return F ^ (d | ~k);\n };\n\n var u = function u(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(r(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var f = function f(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(q(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var D = function D(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(p(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var t = function t(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(n(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var e = function e(G) {\n var Z = void 0;\n var F = G.length;\n var x = F + 8;\n var k = (x - x % 64) / 64;\n var I = (k + 1) * 16;\n var aa = Array(I - 1);\n var d = 0;\n var H = 0;\n\n while (H < F) {\n Z = (H - H % 4) / 4;\n d = H % 4 * 8;\n aa[Z] = aa[Z] | G.charCodeAt(H) << d;\n H++;\n }\n\n Z = (H - H % 4) / 4;\n d = H % 4 * 8;\n aa[Z] = aa[Z] | 128 << d;\n aa[I - 2] = F << 3;\n aa[I - 1] = F >>> 29;\n\n return aa;\n };\n\n var B = function B(x) {\n var k = \"\",\n F = \"\",\n G = void 0,\n d = void 0;\n\n for (d = 0; d <= 3; d++) {\n G = x >>> d * 8 & 255;\n F = \"0\" + G.toString(16);\n k = k + F.substr(F.length - 2, 2);\n }\n\n return k;\n };\n\n var J = function J(k) {\n k = k.replace(/rn/g, \"n\");\n var d = \"\";\n for (var F = 0; F < k.length; F++) {\n var x = k.charCodeAt(F);\n if (x < 128) {\n d += String.fromCharCode(x);\n } else {\n if (x > 127 && x < 2048) {\n d += String.fromCharCode(x >> 6 | 192);\n d += String.fromCharCode(x & 63 | 128);\n } else {\n d += String.fromCharCode(x >> 12 | 224);\n d += String.fromCharCode(x >> 6 & 63 | 128);\n d += String.fromCharCode(x & 63 | 128);\n }\n }\n }\n return d;\n };\n\n var C = Array();\n var P = void 0,\n h = void 0,\n E = void 0,\n v = void 0,\n g = void 0,\n Y = void 0,\n X = void 0,\n W = void 0,\n V = void 0;\n var S = 7,\n Q = 12,\n N = 17,\n M = 22;\n var A = 5,\n z = 9,\n y = 14,\n w = 20;\n var o = 4,\n m = 11,\n l = 16,\n j = 23;\n var U = 6,\n T = 10,\n R = 15,\n O = 21;\n\n str = J(str);\n C = e(str);\n Y = 1732584193;\n X = 4023233417;\n W = 2562383102;\n V = 271733878;\n\n for (P = 0; P < C.length; P += 16) {\n h = Y;\n E = X;\n v = W;\n g = V;\n Y = u(Y, X, W, V, C[P + 0], S, 3614090360);\n V = u(V, Y, X, W, C[P + 1], Q, 3905402710);\n W = u(W, V, Y, X, C[P + 2], N, 606105819);\n X = u(X, W, V, Y, C[P + 3], M, 3250441966);\n Y = u(Y, X, W, V, C[P + 4], S, 4118548399);\n V = u(V, Y, X, W, C[P + 5], Q, 1200080426);\n W = u(W, V, Y, X, C[P + 6], N, 2821735955);\n X = u(X, W, V, Y, C[P + 7], M, 4249261313);\n Y = u(Y, X, W, V, C[P + 8], S, 1770035416);\n V = u(V, Y, X, W, C[P + 9], Q, 2336552879);\n W = u(W, V, Y, X, C[P + 10], N, 4294925233);\n X = u(X, W, V, Y, C[P + 11], M, 2304563134);\n Y = u(Y, X, W, V, C[P + 12], S, 1804603682);\n V = u(V, Y, X, W, C[P + 13], Q, 4254626195);\n W = u(W, V, Y, X, C[P + 14], N, 2792965006);\n X = u(X, W, V, Y, C[P + 15], M, 1236535329);\n Y = f(Y, X, W, V, C[P + 1], A, 4129170786);\n V = f(V, Y, X, W, C[P + 6], z, 3225465664);\n W = f(W, V, Y, X, C[P + 11], y, 643717713);\n X = f(X, W, V, Y, C[P + 0], w, 3921069994);\n Y = f(Y, X, W, V, C[P + 5], A, 3593408605);\n V = f(V, Y, X, W, C[P + 10], z, 38016083);\n W = f(W, V, Y, X, C[P + 15], y, 3634488961);\n X = f(X, W, V, Y, C[P + 4], w, 3889429448);\n Y = f(Y, X, W, V, C[P + 9], A, 568446438);\n V = f(V, Y, X, W, C[P + 14], z, 3275163606);\n W = f(W, V, Y, X, C[P + 3], y, 4107603335);\n X = f(X, W, V, Y, C[P + 8], w, 1163531501);\n Y = f(Y, X, W, V, C[P + 13], A, 2850285829);\n V = f(V, Y, X, W, C[P + 2], z, 4243563512);\n W = f(W, V, Y, X, C[P + 7], y, 1735328473);\n X = f(X, W, V, Y, C[P + 12], w, 2368359562);\n Y = D(Y, X, W, V, C[P + 5], o, 4294588738);\n V = D(V, Y, X, W, C[P + 8], m, 2272392833);\n W = D(W, V, Y, X, C[P + 11], l, 1839030562);\n X = D(X, W, V, Y, C[P + 14], j, 4259657740);\n Y = D(Y, X, W, V, C[P + 1], o, 2763975236);\n V = D(V, Y, X, W, C[P + 4], m, 1272893353);\n W = D(W, V, Y, X, C[P + 7], l, 4139469664);\n X = D(X, W, V, Y, C[P + 10], j, 3200236656);\n Y = D(Y, X, W, V, C[P + 13], o, 681279174);\n V = D(V, Y, X, W, C[P + 0], m, 3936430074);\n W = D(W, V, Y, X, C[P + 3], l, 3572445317);\n X = D(X, W, V, Y, C[P + 6], j, 76029189);\n Y = D(Y, X, W, V, C[P + 9], o, 3654602809);\n V = D(V, Y, X, W, C[P + 12], m, 3873151461);\n W = D(W, V, Y, X, C[P + 15], l, 530742520);\n X = D(X, W, V, Y, C[P + 2], j, 3299628645);\n Y = t(Y, X, W, V, C[P + 0], U, 4096336452);\n V = t(V, Y, X, W, C[P + 7], T, 1126891415);\n W = t(W, V, Y, X, C[P + 14], R, 2878612391);\n X = t(X, W, V, Y, C[P + 5], O, 4237533241);\n Y = t(Y, X, W, V, C[P + 12], U, 1700485571);\n V = t(V, Y, X, W, C[P + 3], T, 2399980690);\n W = t(W, V, Y, X, C[P + 10], R, 4293915773);\n X = t(X, W, V, Y, C[P + 1], O, 2240044497);\n Y = t(Y, X, W, V, C[P + 8], U, 1873313359);\n V = t(V, Y, X, W, C[P + 15], T, 4264355552);\n W = t(W, V, Y, X, C[P + 6], R, 2734768916);\n X = t(X, W, V, Y, C[P + 13], O, 1309151649);\n Y = t(Y, X, W, V, C[P + 4], U, 4149444226);\n V = t(V, Y, X, W, C[P + 11], T, 3174756917);\n W = t(W, V, Y, X, C[P + 2], R, 718787259);\n X = t(X, W, V, Y, C[P + 9], O, 3951481745);\n Y = K(Y, h);\n X = K(X, E);\n W = K(W, v);\n V = K(V, g);\n\n var i = B(Y) + B(X) + B(W) + B(V);\n return i.toLowerCase();\n }\n};\n\nexports.default = md5;","import { type HeadersFunction } from '@remix-run/node'\nimport { captureRemixErrorBoundaryError } from '@sentry/remix'\nimport { Link, useRouteError, type LinkProps } from '@remix-run/react'\nimport * as dateFns from 'date-fns'\nimport md5 from 'md5-hash'\nimport * as React from 'react'\nimport { type NonNullProperties, type User } from '~/types.ts'\nimport { type getEnv } from './env.server.ts'\n\nconst defaultAvatarSize = 128\nfunction getAvatar(\n email: string,\n { size = defaultAvatarSize }: { size?: number; origin?: string | null } = {},\n) {\n const hash = md5(email)\n const url = new URL(`https://www.gravatar.com/avatar/${hash}`)\n url.searchParams.set('size', String(size))\n return url.toString()\n}\n\nfunction getAvatarForUser(\n { email, firstName }: Pick<User, 'email' | 'firstName'>,\n { size = defaultAvatarSize, origin }: { size?: number; origin?: string } = {},\n) {\n return {\n src: getAvatar(email, {\n size,\n origin,\n }),\n alt: firstName,\n }\n}\n\nconst useSSRLayoutEffect =\n typeof window === 'undefined' ? () => {} : React.useLayoutEffect\n\ntype AnchorProps = React.DetailedHTMLProps<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n>\n\nconst AnchorOrLink = React.forwardRef<\n HTMLAnchorElement,\n AnchorProps & {\n reload?: boolean\n to?: LinkProps['to']\n prefetch?: LinkProps['prefetch']\n }\n>(function AnchorOrLink(props, ref) {\n const {\n to,\n href,\n download,\n reload = false,\n prefetch,\n children,\n ...rest\n } = props\n let toUrl = ''\n let shouldUserRegularAnchor = reload || download\n\n if (!shouldUserRegularAnchor && typeof href === 'string') {\n shouldUserRegularAnchor = href.includes(':') || href.startsWith('#')\n }\n\n if (!shouldUserRegularAnchor && typeof to === 'string') {\n toUrl = to\n shouldUserRegularAnchor = to.includes(':')\n }\n\n if (!shouldUserRegularAnchor && typeof to === 'object') {\n toUrl = `${to.pathname ?? ''}${to.hash ? `#${to.hash}` : ''}${\n to.search ? `?${to.search}` : ''\n }`\n shouldUserRegularAnchor = to.pathname?.includes(':')\n }\n\n if (shouldUserRegularAnchor) {\n return (\n <a {...rest} download={download} href={href ?? toUrl} ref={ref}>\n {children}\n </a>\n )\n } else {\n return (\n <Link prefetch={prefetch} to={to ?? href ?? ''} {...rest} ref={ref}>\n {children}\n </Link>\n )\n }\n})\n\nfunction formatDuration(seconds: number) {\n const mins = Math.floor(seconds / 60)\n .toString()\n .padStart(2, '0')\n const secs = (seconds % 60).toFixed().toString().padStart(2, '0')\n return `${mins}:${secs}`\n}\n\nconst formatNumber = (num: number) => new Intl.NumberFormat().format(num)\n\nfunction formatAbbreviatedNumber(num: number) {\n return num < 1_000\n ? formatNumber(num)\n : num < 1_000_000\n ? `${formatNumber(Number((num / 1_000).toFixed(2)))}k`\n : num < 1_000_000_000\n ? `${formatNumber(Number((num / 1_000_000).toFixed(2)))}m`\n : num < 1_000_000_000_000\n ? `${formatNumber(Number((num / 1_000_000_000).toFixed(2)))}b`\n : 'a lot'\n}\n\nfunction formatDate(dateString: string | Date, format = 'PPP') {\n if (typeof dateString !== 'string') {\n dateString = dateString.toISOString()\n }\n return dateFns.format(parseDate(dateString), format)\n}\n\nfunction parseDate(dateString: string) {\n return dateFns.add(dateFns.parseISO(dateString), {\n minutes: new Date().getTimezoneOffset(),\n })\n}\n\nfunction getErrorMessage(error: unknown, fallback: string = 'Unknown Error') {\n if (typeof error === 'string') return error\n if (error instanceof Error) return error.message\n return fallback\n}\n\nfunction getErrorStack(error: unknown, fallback: string = 'Unknown Error') {\n if (typeof error === 'string') return error\n if (error instanceof Error) return error.stack\n return fallback\n}\n\nfunction getNonNull<Type extends Record<string, null | undefined | unknown>>(\n obj: Type,\n): NonNullProperties<Type> {\n for (const [key, val] of Object.entries(obj)) {\n assertNonNull(val, `The value of ${key} is null but it should not be.`)\n }\n return obj as NonNullProperties<Type>\n}\n\nfunction typedBoolean<T>(\n value: T,\n): value is Exclude<T, '' | 0 | false | null | undefined> {\n return Boolean(value)\n}\n\nfunction assertNonNull<PossibleNullType>(\n possibleNull: PossibleNullType,\n errorMessage: string,\n): asserts possibleNull is Exclude<PossibleNullType, null | undefined> {\n if (possibleNull == null) throw new Error(errorMessage)\n}\n\nfunction getRequiredEnvVarFromObj(\n obj: Record<string, string | undefined>,\n key: string,\n devValue: string = `${key}-dev-value`,\n) {\n let value = devValue\n const envVal = obj[key]\n if (envVal) {\n value = envVal\n } else if (obj.NODE_ENV === 'production') {\n throw new Error(`${key} is a required env variable`)\n }\n return value\n}\n\nfunction getRequiredServerEnvVar(key: string, devValue?: string) {\n return getRequiredEnvVarFromObj(process.env, key, devValue)\n}\n\nfunction getRequiredGlobalEnvVar(\n key: keyof ReturnType<typeof getEnv>,\n devValue?: string,\n) {\n return getRequiredEnvVarFromObj(ENV, key, devValue)\n}\n\nfunction getDomainUrl(request: Request) {\n const host =\n request.headers.get('X-Forwarded-Host') ?? request.headers.get('host')\n if (!host) {\n throw new Error('Could not determine domain URL.')\n }\n const protocol = host.includes('localhost') ? 'http' : 'https'\n return `${protocol}://${host}`\n}\n\nexport function isResponse(response: unknown): response is Response {\n return (\n typeof response === 'object' &&\n response !== null &&\n 'status' in response &&\n 'headers' in response &&\n 'body' in response\n )\n}\n\nfunction removeTrailingSlash(s: string) {\n return s.endsWith('/') ? s.slice(0, -1) : s\n}\n\nfunction getDisplayUrl(requestInfo?: { origin: string; path: string }) {\n return getUrl(requestInfo).replace(/^https?:\\/\\//, '')\n}\n\nfunction getOrigin(requestInfo?: { origin?: string; path: string }) {\n return requestInfo?.origin ?? 'https://vinhnguyen.xyz'\n}\n\nfunction getUrl(requestInfo?: { origin: string; path: string }) {\n return removeTrailingSlash(\n `${getOrigin(requestInfo)}${requestInfo?.path ?? ''}`,\n )\n}\n\nfunction toBase64(string: string) {\n if (typeof window === 'undefined') {\n return Buffer.from(string).toString('base64')\n } else {\n return window.btoa(string)\n }\n}\n\nfunction useUpdateQueryStringValueWithoutNavigation(\n queryKey: string,\n queryValue: string,\n) {\n React.useEffect(() => {\n const currentSearchParams = new URLSearchParams(window.location.search)\n const oldQuery = currentSearchParams.get(queryKey) ?? ''\n if (queryValue === oldQuery) return\n\n if (queryValue) {\n currentSearchParams.set(queryKey, queryValue)\n } else {\n currentSearchParams.delete(queryKey)\n }\n const newUrl = [window.location.pathname, currentSearchParams.toString()]\n .filter(Boolean)\n .join('?')\n // alright, let's talk about this...\n // Normally with remix, you'd update the params via useSearchParams from react-router-dom\n // and updating the search params will trigger the search to update for you.\n // However, it also triggers a navigation to the new url, which will trigger\n // the loader to run which we do not want because all our data is already\n // on the client and we're just doing client-side filtering of data we\n // already have. So we manually call `window.history.pushState` to avoid\n // the router from triggering the loader.\n window.history.replaceState(null, '', newUrl)\n }, [queryKey, queryValue])\n}\n\nfunction debounce<Callback extends (...args: Parameters<Callback>) => void>(\n fn: Callback,\n delay: number,\n) {\n let timer: ReturnType<typeof setTimeout> | null = null\n return (...args: Parameters<Callback>) => {\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n fn(...args)\n }, delay)\n }\n}\n\nfunction useDebounce<\n Callback extends (...args: Parameters<Callback>) => ReturnType<Callback>,\n>(callback: Callback, delay: number) {\n const callbackRef = React.useRef(callback)\n React.useEffect(() => {\n callbackRef.current = callback\n })\n return React.useMemo(\n () =>\n debounce(\n (...args: Parameters<Callback>) => callbackRef.current(...args),\n delay,\n ),\n [delay],\n )\n}\n\nconst reuseUsefulLoaderHeaders: HeadersFunction = ({\n loaderHeaders,\n parentHeaders,\n}) => {\n const headers = new Headers()\n const usefulHeaders = ['Cache-Control', 'Vary', 'Server-Timing']\n for (const headerName of usefulHeaders) {\n if (loaderHeaders.has(headerName)) {\n headers.set(headerName, loaderHeaders.get(headerName)!)\n }\n }\n const appendHeaders = ['Server-Timing']\n for (const headerName of appendHeaders) {\n if (parentHeaders.has(headerName)) {\n headers.append(headerName, parentHeaders.get(headerName)!)\n }\n }\n const useIfNotExistsHeaders = ['Cache-Control', 'Vary']\n for (const headerName of useIfNotExistsHeaders) {\n if (!headers.has(headerName) && parentHeaders.has(headerName)) {\n headers.set(headerName, parentHeaders.get(headerName)!)\n }\n }\n\n return headers\n}\n\nfunction callAll<Args extends Array<unknown>>(\n ...fns: Array<((...args: Args) => unknown) | undefined>\n) {\n return (...args: Args) => fns.forEach(fn => fn?.(...args))\n}\n\nfunction useDoubleCheck() {\n const [doubleCheck, setDoubleCheck] = React.useState(false)\n\n function getButtonProps(props?: JSX.IntrinsicElements['button']) {\n const onBlur: JSX.IntrinsicElements['button']['onBlur'] = () =>\n setDoubleCheck(false)\n\n const onClick: JSX.IntrinsicElements['button']['onClick'] = doubleCheck\n ? undefined\n : e => {\n e.preventDefault()\n setDoubleCheck(true)\n }\n\n return {\n ...props,\n onBlur: callAll(onBlur, props?.onBlur),\n onClick: callAll(onClick, props?.onClick),\n }\n }\n\n return { doubleCheck, getButtonProps }\n}\n\n/**\n * Provide a condition and if that condition is falsey, this throws an error\n * with the given message.\n *\n * inspired by invariant from 'tiny-invariant' except will still include the\n * message in production.\n *\n * @example\n * invariant(typeof value === 'string', `value must be a string`)\n *\n * @param condition The condition to check\n * @param message The message to throw (or a callback to generate the message)\n * @param responseInit Additional response init options if a response is thrown\n *\n * @throws {Error} if condition is falsey\n */\nexport function invariant(\n condition: any,\n message: string | (() => string),\n): asserts condition {\n if (!condition) {\n throw new Error(typeof message === 'function' ? message() : message)\n }\n}\n\n/**\n * Provide a condition and if that condition is falsey, this throws a 400\n * Response with the given message.\n *\n * inspired by invariant from 'tiny-invariant'\n *\n * @example\n * invariantResponse(typeof value === 'string', `value must be a string`)\n *\n * @param condition The condition to check\n * @param message The message to throw (or a callback to generate the message)\n * @param responseInit Additional response init options if a response is thrown\n *\n * @throws {Response} if condition is falsey\n */\nexport function invariantResponse(\n condition: any,\n message: string | (() => string),\n responseInit?: ResponseInit,\n): asserts condition {\n if (!condition) {\n throw new Response(typeof message === 'function' ? message() : message, {\n status: 400,\n ...responseInit,\n })\n }\n}\n\nexport function useCapturedRouteError() {\n const error = useRouteError()\n captureRemixErrorBoundaryError(error)\n return error\n}\n\nexport function requireValidSlug(slug: unknown): asserts slug is string {\n if (typeof slug !== 'string' || !/^[a-zA-Z0-9-_.]+$/.test(slug)) {\n throw new Response(`This is not a valid slug: \"${slug}\"`, { status: 400 })\n }\n}\n\nexport { listify } from './listify.ts'\nexport {\n getAvatar,\n getAvatarForUser,\n AnchorOrLink,\n getErrorMessage,\n getErrorStack,\n getNonNull,\n assertNonNull,\n useUpdateQueryStringValueWithoutNavigation,\n useSSRLayoutEffect,\n useDoubleCheck,\n useDebounce,\n typedBoolean,\n getRequiredServerEnvVar,\n getRequiredGlobalEnvVar,\n getDomainUrl,\n getUrl,\n getDisplayUrl,\n getOrigin,\n toBase64,\n removeTrailingSlash,\n reuseUsefulLoaderHeaders,\n parseDate,\n formatDate,\n formatDuration,\n formatNumber,\n formatAbbreviatedNumber,\n}\n","/**\n *\n * @private\n * @param {any} a\n */\nfunction isObject(a) {\n if (typeof a !== 'object' || a instanceof Array) {\n return false;\n }\n else {\n return true;\n }\n}\nclass Config {\n filterOutNonSupportedKeys(userProvidedConfig, validKeys) {\n const obj = Object.create({});\n if (isObject(userProvidedConfig)) {\n Object.keys(userProvidedConfig).forEach((key) => {\n if (validKeys.indexOf(key) >= 0) {\n obj[key] = userProvidedConfig[key];\n }\n else {\n console.warn('Warning - unsupported key provided to configuration: ', key);\n }\n });\n return obj;\n }\n else {\n return Object.create({});\n }\n }\n}\nexport default Config;\n","/**\n * This file is for internal constants only.\n * It is not intended for public use and is not part of the public API\n */\n/**\n * @private\n */\nexport const ALLOWED_URL_CONFIG = [\n 'cname',\n 'secureDistribution',\n 'privateCdn',\n 'signUrl',\n 'longUrlSignature',\n 'shorten',\n 'useRootPath',\n 'secure',\n 'forceVersion',\n 'analytics',\n 'queryParams'\n];\n/**\n * @private\n */\nexport const ALLOWED_CLOUD_CONFIG = [\n 'cloudName',\n 'apiKey',\n 'apiSecret',\n 'authToken'\n];\n","import Config from \"./BaseConfig.js\";\nimport { ALLOWED_URL_CONFIG } from \"../internal/internalConstants.js\";\nclass URLConfig extends Config {\n /**\n * @param {IURLConfig} userURLConfig\n */\n constructor(userURLConfig) {\n super();\n const urlConfig = this.filterOutNonSupportedKeys(userURLConfig, ALLOWED_URL_CONFIG);\n Object.assign(this, {\n secure: true\n }, urlConfig);\n }\n extend(userURLConfig) {\n const urlConfig = this.filterOutNonSupportedKeys(userURLConfig, ALLOWED_URL_CONFIG);\n return new URLConfig(Object.assign({}, this, urlConfig));\n }\n /**\n * @param {string} value Sets the cname\n */\n setCname(value) {\n this.cname = value;\n return this;\n }\n /**\n * @param {string} value Sets the secureDistribution\n */\n setSecureDistribution(value) {\n this.secureDistribution = value;\n return this;\n }\n /**\n * @param {boolean} value Sets whether to use a private CDN (Removes cloudName from URL)\n */\n setPrivateCdn(value) {\n this.privateCdn = value;\n return this;\n }\n /**\n * @param value Sets whether or not to sign the URL\n */\n setSignUrl(value) {\n this.signUrl = value;\n return this;\n }\n /**\n * @param value Sets whether or not to use a long signature\n */\n setLongUrlSignature(value) {\n this.longUrlSignature = value;\n return this;\n }\n /**\n * @param value Sets whether or not to shorten the URL\n */\n setShorten(value) {\n this.shorten = value;\n return this;\n }\n /**\n * @param value Sets whether or not to use a root path\n */\n setUseRootPath(value) {\n this.useRootPath = value;\n return this;\n }\n /**\n * @param value Sets whether or not to deliver the asset through https\n */\n setSecure(value) {\n this.secure = value;\n return this;\n }\n /**\n * @param value Sets whether to force a version in the URL\n */\n setForceVersion(value) {\n this.forceVersion = value;\n return this;\n }\n /**\n * @param params Sets additional params\n */\n setQueryParams(params) {\n this.queryParams = params;\n return this;\n }\n}\nexport default URLConfig;\n","/**\n * @summary SDK\n * @memberOf SDK\n */\nclass QualifierValue {\n /**\n *\n * @param {QualifierValue | QualifierValue[] | any[] | string | number}qualifierValue\n */\n constructor(qualifierValue) {\n this.values = [];\n this.delimiter = ':'; // {value}{delimiter}{value}...\n if (this.hasValue(qualifierValue)) {\n this.addValue(qualifierValue);\n }\n }\n /**\n * @description Joins the provided values with the provided delimiter\n */\n toString() {\n return this.values.join(this.delimiter);\n }\n /**\n * @description Checks if the provided argument has a value\n * @param {any} v\n * @private\n * @return {boolean}\n */\n hasValue(v) {\n return typeof v !== 'undefined' && v !== null && v !== '';\n }\n /**\n * @desc Adds a value for the this qualifier instance\n * @param {any} value\n * @return {this}\n */\n addValue(value) {\n // Append value or array of values\n if (Array.isArray(value)) {\n this.values = this.values.concat(value);\n }\n else {\n this.values.push(value);\n }\n // Remove falsy values\n this.values = this.values.filter((v) => this.hasValue(v));\n return this;\n }\n /**\n * @description Sets the delimiter for this instance\n * @param delimiter\n */\n setDelimiter(delimiter) {\n this.delimiter = delimiter;\n return this;\n }\n}\nexport { QualifierValue };\n","class UnsupportedError extends Error {\n constructor(message = 'Unsupported') {\n super(message);\n }\n}\n/**\n * Creates a new UnsupportedError\n * @param message\n */\nfunction createUnsupportedError(message) {\n return new UnsupportedError(message);\n}\nexport { UnsupportedError, createUnsupportedError };\n","import { createUnsupportedError } from \"../utils/unsupportedError.js\";\n/**\n * Returns the action's model\n */\nexport function qualifierToJson() {\n return this._qualifierModel || { error: createUnsupportedError(`unsupported qualifier ${this.constructor.name}`) };\n}\n","import { qualifierToJson } from \"./qualifierToJson.js\";\nexport class QualifierModel {\n constructor() {\n this._qualifierModel = {};\n }\n toJson() {\n return qualifierToJson.apply(this);\n }\n}\n","import { QualifierValue } from './QualifierValue.js';\nimport { QualifierModel } from '../models/QualifierModel.js';\n/**\n * @summary SDK\n * @memberOf SDK\n */\nclass Qualifier extends QualifierModel {\n constructor(key, qualifierValue) {\n super();\n this.delimiter = '_'; // {key}{delimiter}{qualifierValue}\n this.key = key;\n if (qualifierValue instanceof QualifierValue) {\n this.qualifierValue = qualifierValue;\n }\n else {\n this.qualifierValue = new QualifierValue();\n this.qualifierValue.addValue(qualifierValue);\n }\n }\n toString() {\n const { key, delimiter, qualifierValue } = this;\n return `${key}${delimiter}${qualifierValue.toString()}`;\n }\n addValue(value) {\n this.qualifierValue.addValue(value);\n return this;\n }\n}\nexport { Qualifier };\n","import { QualifierValue } from \"../../internal/qualifier/QualifierValue.js\";\nimport { Qualifier } from \"../../internal/qualifier/Qualifier.js\";\n/**\n * @memberOf Qualifiers.Flag\n * @extends {SDK.Qualifier}\n * @description the FlagQualifier class\n */\nclass FlagQualifier extends Qualifier {\n constructor(flagType, flagValue) {\n let qualifierValue;\n if (flagValue) {\n qualifierValue = new QualifierValue([flagType, `${flagValue}`]).setDelimiter(':');\n }\n else {\n qualifierValue = flagType;\n }\n super('fl', qualifierValue);\n this.flagValue = flagValue;\n }\n toString() {\n return super.toString().replace(/\\./g, '%2E');\n }\n getFlagValue() {\n return this.flagValue;\n }\n}\nexport { FlagQualifier };\n","/**\n * Sort a map by key\n * @private\n * @param map <string, any>\n * @Return array of map's values sorted by key\n */\nfunction mapToSortedArray(map, flags) {\n const array = Array.from(map.entries());\n // objects from the Array.from() method above are stored in array of arrays:\n // [[qualifierKey, QualifierObj], [qualifierKey, QualifierObj]]\n // Flags is an array of FlagQualifierObj\n // We need to convert it to the same form: [flagQualifier] => ['fl', flagQualifier]\n flags.forEach((flag) => {\n array.push(['fl', flag]); // push ['fl', flagQualifier]\n });\n return array.sort().map((v) => v[1]);\n}\n/**\n * Checks if `value` is a string.\n * @private\n * @param {*} value The value to check.\n * @return {boolean} `true` if `value` is a string, else `false`.\n */\nfunction isString(value) {\n return (typeof value === 'string' || value instanceof String);\n}\nexport { isString, mapToSortedArray };\n","import { createUnsupportedError } from \"../utils/unsupportedError.js\";\n/**\n * Returns the action's model\n */\nexport function actionToJson() {\n var _a, _b, _c;\n const actionModelIsNotEmpty = this._actionModel && Object.keys(this._actionModel).length;\n const sourceTransformationError = (_c = (_b = (_a = this._actionModel) === null || _a === void 0 ? void 0 : _a.source) === null || _b === void 0 ? void 0 : _b.transformation) === null || _c === void 0 ? void 0 : _c.error;\n // Should return error when there is unsupported transformation inside\n if (sourceTransformationError && sourceTransformationError instanceof Error) {\n return { error: sourceTransformationError };\n }\n if (actionModelIsNotEmpty) {\n return this._actionModel;\n }\n return { error: createUnsupportedError(`unsupported action ${this.constructor.name}`) };\n}\n","import { actionToJson } from \"./actionToJson.js\";\nexport class ActionModel {\n constructor() {\n this._actionModel = {};\n }\n toJson() {\n return actionToJson.apply(this);\n }\n}\n","import { FlagQualifier } from \"../qualifiers/flag/FlagQualifier.js\";\nimport { Qualifier } from \"./qualifier/Qualifier.js\";\nimport { mapToSortedArray } from \"./utils/dataStructureUtils.js\";\nimport { ActionModel } from \"./models/ActionModel.js\";\n/**\n * @summary SDK\n * @memberOf SDK\n * @description Defines the category of transformation to perform.\n */\nclass Action extends ActionModel {\n constructor() {\n super(...arguments);\n // We're using map, to overwrite existing keys. for example:\n // addParam(w_100).addQualifier(w_200) should result in w_200. and not w_100,w_200\n this.qualifiers = new Map();\n // Unlike regular qualifiers, there can be multiple flags in each url component /fl_1,fl_2/\n // If the falgs are added to the qualifiers map, only a single flag could exist in a component (it's a map)\n // So flags are stored separately until the very end because of that reason\n this.flags = [];\n this.delimiter = ','; // {qualifier}{delimiter}{qualifier} for example: `${'w_100'}${','}${'c_fill'}`\n this.actionTag = ''; // A custom name tag to identify this action in the future\n }\n prepareQualifiers() { }\n /**\n * @description Returns the custom name tag that was given to this action\n * @return {string}\n */\n getActionTag() {\n return this.actionTag;\n }\n /**\n * @description Sets the custom name tag for this action\n * @return {this}\n */\n setActionTag(tag) {\n this.actionTag = tag;\n return this;\n }\n /**\n * @description Calls toString() on all child qualifiers (implicitly by using .join()).\n * @return {string}\n */\n toString() {\n this.prepareQualifiers();\n return mapToSortedArray(this.qualifiers, this.flags).join(this.delimiter);\n }\n /**\n * @description Adds the parameter to the action.\n * @param {SDK.Qualifier} qualifier\n * @return {this}\n */\n addQualifier(qualifier) {\n // if string, find the key and value\n if (typeof qualifier === 'string') {\n const [key, value] = qualifier.toLowerCase().split('_');\n if (key === 'fl') {\n // if string qualifier is a flag, store it in the flags arrays\n this.flags.push(new FlagQualifier(value));\n }\n else {\n // if the string qualifier is not a flag, create a new qualifier from it\n this.qualifiers.set(key, new Qualifier(key, value));\n }\n }\n else {\n // if a qualifier object, insert to the qualifiers map\n this.qualifiers.set(qualifier.key, qualifier);\n }\n return this;\n }\n /**\n * @description Adds a flag to the current action.\n * @param {Qualifiers.Flag} flag\n * @return {this}\n */\n addFlag(flag) {\n if (typeof flag === 'string') {\n this.flags.push(new FlagQualifier(flag));\n }\n else {\n if (flag instanceof FlagQualifier) {\n this.flags.push(flag);\n }\n }\n return this;\n }\n addValueToQualifier(qualifierKey, qualifierValue) {\n this.qualifiers.get(qualifierKey).addValue(qualifierValue);\n return this;\n }\n}\nexport { Action };\n","/**\n * Returns RGB or Color\n * @private\n * @param color\n */\nexport function prepareColor(color) {\n if (color) {\n return color.match(/^#/) ? `rgb:${color.substr(1)}` : color;\n }\n else {\n return color;\n }\n}\n","import { Action } from \"../../../internal/Action.js\";\nimport { QualifierValue } from \"../../../internal/qualifier/QualifierValue.js\";\nimport { Qualifier } from \"../../../internal/qualifier/Qualifier.js\";\nimport { prepareColor } from \"../../../internal/utils/prepareColor.js\";\n/**\n * @extends SDK.Action\n * @description A class for background transformations.\n */\nclass BackgroundColor extends Action {\n constructor(color) {\n super();\n this._actionModel = {};\n this.addQualifier(new Qualifier('b', new QualifierValue(prepareColor(color)).setDelimiter('_')));\n this._actionModel.color = color;\n this._actionModel.actionType = 'backgroundColor';\n }\n static fromJson(actionModel) {\n const { color } = actionModel;\n // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel])\n // This allows the inheriting classes to determine the class to be created\n const result = new this(color);\n return result;\n }\n}\nexport { BackgroundColor };\n","import { createUnsupportedError } from \"./utils/unsupportedError.js\";\n/**\n * @summary SDK\n * @memberOf SDK\n * @description Defines an action that's a string literal, no validations or manipulations are performed\n */\nclass RawAction {\n constructor(raw) {\n this.raw = raw;\n }\n toString() {\n return this.raw;\n }\n toJson() {\n return { error: createUnsupportedError(`unsupported action ${this.constructor.name}`) };\n }\n}\nexport { RawAction };\n","/**\n * Validates obj is an instance of IErrorObject\n * @param obj\n */\nfunction isErrorObject(obj) {\n const errorObj = obj;\n return ('error' in errorObj) && !!errorObj.error;\n}\nexport { isErrorObject };\n","/**\n * @description Defines flags that you can use to alter the default transformation behavior.\n * @namespace Flag\n * @memberOf Qualifiers\n */\nimport { FlagQualifier } from \"./flag/FlagQualifier.js\";\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Used when delivering a video file as an image format that supports animation, such as animated WebP.\n * Plays all frames rather than just delivering the first one as a static image.\n * Use this flag in addition to the flag or parameter controlling the delivery format,\n * for example f_auto or fl_awebp.\n\n * Note: When delivering a video in GIF format, it is delivered as an animated GIF by default and this flag is not\n * necessary. To deliver a single frame of a video in GIF format, use the page parameter.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction animated() {\n return new FlagQualifier('animated');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When converting animated images to WebP format, generate an animated WebP from all the frames in the\n * original\n * animated file instead of only from the first still frame.\n *\n * Note that animated WebPs are not supported in all browsers and versions.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction animatedWebP() {\n return new FlagQualifier('awebp');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When used together with automatic quality (q_auto):\n * allow switching to PNG8 encoding if the quality algorithm decides that it's more efficient.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction anyFormat() {\n return new FlagQualifier('any_format');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When converting animated images to PNG format, generates an animated PNG from all the frames in the\n * original\n * animated file instead of only from the first still frame.\n *\n * Note that animated PNGs are not supported in all browsers and versions.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction animatedPng() {\n return new FlagQualifier('apng');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Trims pixels according to a clipping path included in the original image\n * (e.g., manually created using PhotoShop).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction clip() {\n return new FlagQualifier('clip');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Trims pixels according to a clipping path included in the original image (e.g., manually created\n * using PhotoShop)\n * using an evenodd clipping rule.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction clipEvenOdd() {\n return new FlagQualifier('clip_evenodd');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Instructs Cloudinary to clear all image meta-data (IPTC, Exif and XMP) while applying an incoming\n * transformation.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction forceStrip() {\n return new FlagQualifier('force_strip');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Allows custom flag\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction custom(value) {\n return new FlagQualifier(value);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Adds ICC color space metadata to the image, even when the original image doesn't contain any ICC data.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction forceIcc() {\n return new FlagQualifier('force_icc');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Delivers the image as an attachment.\n * @param {string} filename The attachment's filename\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction attachment(filename) {\n return new FlagQualifier('attachment', filename);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Returns metadata of the input asset and of the transformed output asset in JSON instead of the\n * transformed image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction getInfo() {\n return new FlagQualifier('getinfo');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Deliver an HLS adaptive bitrate streaming file as HLS v3 instead of the default version (HLS v4).\n * Delivering in this format requires a private CDN configuration.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction hlsv3() {\n return new FlagQualifier('hlsv3');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Sets the cache-control to immutable for the asset.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction immutableCache() {\n return new FlagQualifier('immutable_cache');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description * Allows specifying only either width or height so the value of the second axis remains as is, and is not\n * recalculated to maintain the aspect ratio of the original image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction ignoreInitialAspectRatio() {\n return new FlagQualifier('ignore_aspect_ratio');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Keeps the copyright related fields when stripping meta-data.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction keepAttribution() {\n return new FlagQualifier('keep_attribution');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * Keep the Display Aspect Ratio metadata of the uploaded video (if it’s different from the current video\n * dimensions).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction keepDar() {\n return new FlagQualifier('keep_dar');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Keeps all meta-data.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction keepIptc() {\n return new FlagQualifier('keep_iptc');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Applies all chained transformations, until a transformation component that includes this flag, on the last added\n * overlay or underlay instead of applying on the containing image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction layerApply() {\n return new FlagQualifier('layer_apply');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Automatically use lossy compression when delivering animated GIF files.\n *\n * This flag can also be used as a conditional flag for delivering PNG files: it tells Cloudinary to deliver the\n * image in PNG format (as requested) unless there is no transparency channel - in which case deliver in JPEG\n * format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction lossy() {\n return new FlagQualifier('lossy');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Convert the audio channel to mono\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction mono() {\n return new FlagQualifier('mono');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Used internally by Position within an Overlay, this flag will tile the overlay across your image.\n *\n * <b>Learn more:</b> {@link https://cloudinary.com/documentation/transformation_reference#fl_no_overflow|Overflow in overlays}\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction noOverflow() {\n return new FlagQualifier('no_overflow');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Don't stream a video that is currently being generated on the fly. Wait until the video is fully generated.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction noStream() {\n return new FlagQualifier('no_stream');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generate PNG images in the png24 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction png24() {\n return new FlagQualifier('png24');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generate PNG images in the png32 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction png32() {\n return new FlagQualifier('png32');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generate PNG images in the PNG8 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction png8() {\n return new FlagQualifier('png8');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When used with automatic fetch_format (f_auto): ensures that images with a transparency channel will be\n * delivered in PNG format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction preserveTransparency() {\n return new FlagQualifier('preserve_transparency');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generates a JPG image using the progressive (interlaced) JPG format.\n *\n * This format allows the browser to quickly show a low-quality rendering of the image until the full-quality\n * image is loaded.\n *\n * @param {string} mode? The mode to determine a specific progressive outcome as follows:\n * * semi - A smart optimization of the decoding time, compression level and progressive rendering\n * (less iterations). This is the default mode when using q_auto.\n * * steep - Delivers a preview very quickly, and in a single later phase improves the image to\n * the required resolution.\n * * none - Use this to deliver a non-progressive image. This is the default mode when setting\n * a specific value for quality.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction progressive(mode) {\n return new FlagQualifier('progressive', mode);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Modifies percentage-based width & height parameters of overlays and underlays (e.g., 1.0) to be relative to the overlaid region\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction regionRelative() {\n return new FlagQualifier('region_relative');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Reduces the image to one flat pixelated layer (as opposed to the default vector based graphic) in\n * order to enable\n * PDF resizing and overlay manipulations.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction rasterize() {\n return new FlagQualifier('rasterize');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Modifies percentage-based width & height parameters of overlays and underlays (e.g., 1.0) to be relative to the containing image instead of the added layer.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction relative() {\n return new FlagQualifier('relative');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Instructs Cloudinary to run a sanitizer on the image (relevant only for the SVG format).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction sanitize() {\n return new FlagQualifier('sanitize');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Splices the video stipulated as an overlay on to the end of the container video instead of adding it as an\n * overlay.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction splice() {\n return new FlagQualifier('splice');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Instructs Cloudinary to clear all ICC color profile data included with the image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction stripProfile() {\n return new FlagQualifier('strip_profile');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description If the requested video transformation has already been generated, this flag works identically to\n * Flag::attachment.\n *\n * However, if the video transformation is being requested for the first time, this flag causes the video download\n * to begin immediately, streaming it as a fragmented video file.\n *\n * In contrast, if the regular fl_attachment flag is used when a user requests a new video transformation,\n * the download will begin only after the complete transformed video has been generated.\n *\n * Most standard video players successfully play fragmented video files without issue.\n *\n * @param {string} filename The attachment's filename\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction streamingAttachment(filename) {\n return new FlagQualifier('streaming_attachment', filename);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generates TIFF images using LZW compression and in the TIFF8 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction tiff8Lzw() {\n return new FlagQualifier('tiff8_lzw');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Used internally by Position within an Overlay, this flag will tile the overlay across your image.\n *\n * <b>Learn more:</b> {@link https://cloudinary.com/documentation/layers#automatic_tiling|Tiling overlay}\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction tiled() {\n return new FlagQualifier('tiled');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Truncate (trim) a video file based on the start time defined in the metadata (relevant only where the metadata\n * includes a directive to play only a section of the video).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction truncateTS() {\n return new FlagQualifier('truncate_ts');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Create a waveform image (in the format specified by the file extension) from the audio or video file.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction waveform() {\n return new FlagQualifier('waveform');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description A qualifier that ensures that an alpha channel is not applied to a TIFF image if it is a mask channel.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction ignoreMaskChannels() {\n return new FlagQualifier('ignore_mask_channels');\n}\nconst Flag = {\n animated, anyFormat, animatedPng, animatedWebP,\n clipEvenOdd, lossy, preserveTransparency, png8, png24, png32, progressive, rasterize,\n sanitize, stripProfile, tiff8Lzw, attachment, forceIcc, forceStrip, getInfo, immutableCache,\n keepAttribution, keepIptc, custom, streamingAttachment, hlsv3, keepDar, noStream, mono,\n layerApply, relative, regionRelative, splice, truncateTS, waveform, ignoreInitialAspectRatio, clip,\n tiled, noOverflow, ignoreMaskChannels\n};\nexport { Flag, animated, anyFormat, animatedPng, animatedWebP, clipEvenOdd, lossy, preserveTransparency, png8, png24, png32, progressive, rasterize, sanitize, stripProfile, tiff8Lzw, attachment, forceIcc, forceStrip, getInfo, immutableCache, keepAttribution, keepIptc, custom, streamingAttachment, hlsv3, keepDar, noStream, mono, layerApply, relative, regionRelative, splice, truncateTS, waveform, ignoreInitialAspectRatio, clip, tiled, noOverflow, ignoreMaskChannels };\n","import { QualifierValue } from \"../../internal/qualifier/QualifierValue.js\";\n/**\n * @memberOf Qualifiers.Format\n * @extends {SDK.QualifierValue}\n */\nclass FormatQualifier extends QualifierValue {\n constructor(val) {\n super(val);\n this.val = val;\n }\n getValue() {\n return this.val;\n }\n}\nexport { FormatQualifier };\n","/**\n * Flip keys and values for given object\n * @param obj\n */\nfunction objectFlip(obj) {\n const result = {};\n Object.keys(obj).forEach((key) => {\n result[obj[key]] = key;\n });\n return result;\n}\nexport { objectFlip };\n","/**\n * This file is for internal constants only.\n * It is not intended for public use and is not part of the public API\n */\nimport { objectFlip } from \"./utils/objectFlip.js\";\nexport const CONDITIONAL_OPERATORS = {\n \"=\": \"eq\",\n \"!=\": \"ne\",\n \"<\": \"lt\",\n \">\": \"gt\",\n \"<=\": \"lte\",\n \">=\": \"gte\",\n \"&&\": \"and\",\n \"||\": \"or\",\n \"*\": \"mul\",\n \"/\": \"div\",\n \"+\": \"add\",\n \"-\": \"sub\",\n \"^\": \"pow\"\n};\nexport const RESERVED_NAMES = {\n \"aspect_ratio\": \"ar\",\n \"aspectRatio\": \"ar\",\n \"current_page\": \"cp\",\n \"currentPage\": \"cp\",\n \"duration\": \"du\",\n \"face_count\": \"fc\",\n \"faceCount\": \"fc\",\n \"height\": \"h\",\n \"initial_aspect_ratio\": \"iar\",\n \"initial_height\": \"ih\",\n \"initial_width\": \"iw\",\n \"initialAspectRatio\": \"iar\",\n \"initialHeight\": \"ih\",\n \"initialWidth\": \"iw\",\n \"initial_duration\": \"idu\",\n \"initialDuration\": \"idu\",\n \"page_count\": \"pc\",\n \"page_x\": \"px\",\n \"page_y\": \"py\",\n \"pageCount\": \"pc\",\n \"pageX\": \"px\",\n \"pageY\": \"py\",\n \"tags\": \"tags\",\n \"width\": \"w\",\n \"trimmed_aspect_ratio\": \"tar\",\n \"current_public_id\": \"cpi\",\n \"initial_density\": \"idn\",\n \"page_names\": \"pgnames\"\n};\nexport const ACTION_TYPE_TO_CROP_MODE_MAP = {\n limitFit: 'limit',\n limitFill: 'lfill',\n minimumFit: 'mfit',\n thumbnail: 'thumb',\n limitPad: 'lpad',\n minimumPad: 'mpad',\n autoPad: 'auto_pad'\n};\nexport const ACTION_TYPE_TO_DELIVERY_MODE_MAP = {\n colorSpace: 'cs',\n dpr: 'dpr',\n density: 'dn',\n defaultImage: 'd',\n format: 'f',\n quality: 'q'\n};\nexport const ACTION_TYPE_TO_EFFECT_MODE_MAP = {\n redEye: 'redeye',\n advancedRedEye: 'adv_redeye',\n oilPaint: 'oil_paint',\n unsharpMask: 'unsharp_mask',\n makeTransparent: 'make_transparent',\n generativeRestore: 'gen_restore',\n upscale: 'upscale'\n};\nexport const ACTION_TYPE_TO_QUALITY_MODE_MAP = {\n autoBest: 'auto:best',\n autoEco: 'auto:eco',\n autoGood: 'auto:good',\n autoLow: 'auto:low',\n jpegminiHigh: 'jpegmini:1',\n jpegminiMedium: 'jpegmini:2',\n jpegminiBest: 'jpegmini:0'\n};\nexport const ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP = {\n fullHd: 'full_hd',\n fullHdWifi: 'full_hd_wifi',\n fullHdLean: 'full_hd_lean',\n hdLean: 'hd_lean'\n};\nexport const CHROMA_VALUE_TO_CHROMA_MODEL_ENUM = {\n 444: \"CHROMA_444\",\n 420: \"CHROMA_420\"\n};\nexport const COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP = {\n 'noCmyk': 'no_cmyk',\n 'keepCmyk': 'keep_cmyk',\n 'tinySrgb': 'tinysrgb',\n 'srgbTrueColor': 'srgb:truecolor'\n};\nexport const ACTION_TYPE_TO_BLEND_MODE_MAP = {\n 'antiRemoval': 'anti_removal'\n};\nexport const CHROMA_MODEL_ENUM_TO_CHROMA_VALUE = objectFlip(CHROMA_VALUE_TO_CHROMA_MODEL_ENUM);\nexport const COLOR_SPACE_MODE_TO_COLOR_SPACE_MODEL_MODE_MAP = objectFlip(COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP);\nexport const CROP_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_CROP_MODE_MAP);\nexport const DELIVERY_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_DELIVERY_MODE_MAP);\nexport const EFFECT_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_EFFECT_MODE_MAP);\nexport const QUALITY_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_QUALITY_MODE_MAP);\nexport const STREAMING_PROFILE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP);\n","import { Action } from \"../../internal/Action.js\";\nimport { FormatQualifier } from \"../../qualifiers/format/FormatQualifier.js\";\nimport { Qualifier } from \"../../internal/qualifier/Qualifier.js\";\nimport { DELIVERY_MODE_TO_ACTION_TYPE_MAP } from \"../../internal/internalConstants.js\";\n/**\n * @description Qualifies the delivery of an asset.\n * @memberOf Actions.Delivery\n * @extends SDK.Action\n */\nclass DeliveryAction extends Action {\n /**\n * @param {string} deliveryKey A generic Delivery Action Key (such as q, f, dn, etc.)\n * @param {string} deliveryType A Format Qualifiers for the action, such as Quality.auto()\n * @param {string} modelProperty internal model property of the action, for example quality uses `level` while dpr uses `density`\n * @see Visit {@link Actions.Delivery|Delivery} for an example\n */\n constructor(deliveryKey, deliveryType, modelProperty) {\n super();\n this._actionModel = {};\n let deliveryTypeValue;\n if (deliveryType instanceof FormatQualifier) {\n deliveryTypeValue = deliveryType.getValue();\n }\n else {\n deliveryTypeValue = deliveryType;\n }\n this._actionModel.actionType = DELIVERY_MODE_TO_ACTION_TYPE_MAP[deliveryKey];\n this._actionModel[modelProperty] = deliveryTypeValue;\n this.addQualifier(new Qualifier(deliveryKey, deliveryType));\n }\n}\nexport { DeliveryAction };\n","/**\n * @description Contains functions to select the mode when using a progressive format.\n * <b>Learn more</b>: {@link https://cloudinary.com/documentation/transformation_reference#fl_progressive|Progressive modes}\n * @memberOf Qualifiers\n * @namespace Progressive\n * @example\n * import {Cloudinary} from \"@cloudinary/url-gen\";\n * import {format} from \"@cloudinary/url-gen/actions/delivery\";\n * import {jpg} from \"@cloudinary/url-gen/qualifiers/format\";\n * import {steep} from \"@cloudinary/url-gen/qualifiers/progressive\";\n *\n * const yourCldInstance = new Cloudinary({cloud: {cloudName: 'demo'}});\n * const image = yourCldInstance.image('woman');\n * image.delivery(format(jpg()).progressive(steep()))\n */\nimport { FlagQualifier } from \"./flag/FlagQualifier.js\";\nclass ProgressiveQualifier extends FlagQualifier {\n constructor(mode) {\n super('progressive', mode);\n }\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction none() {\n return new ProgressiveQualifier('none');\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction semi() {\n return new ProgressiveQualifier('semi');\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction steep() {\n return new ProgressiveQualifier('steep');\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction progressive() {\n return new ProgressiveQualifier();\n}\nconst Progressive = {\n semi,\n none,\n steep,\n progressive,\n ProgressiveQualifier\n};\nexport { Progressive, semi, none, steep, progressive, ProgressiveQualifier };\n","import { lossy, preserveTransparency, progressive } from \"../../qualifiers/flag.js\";\nimport { DeliveryAction } from \"./DeliveryAction.js\";\nimport { ProgressiveQualifier } from \"../../qualifiers/progressive.js\";\n/**\n * @memberOf Actions.Delivery\n * @extends {Actions.Delivery.DeliveryAction}\n * @see Visit {@link Actions.Delivery|Delivery} for an example\n */\nclass DeliveryFormatAction extends DeliveryAction {\n constructor(deliveryKey, deliveryType) {\n super(deliveryKey, deliveryType, 'formatType');\n }\n /**\n * @description Uses lossy compression when delivering animated GIF files.\n * @return {this}\n */\n lossy() {\n this._actionModel.lossy = true;\n this.addFlag(lossy());\n return this;\n }\n /**\n * @description Uses progressive compression when delivering JPG file format.\n * @return {this}\n */\n progressive(mode) {\n if (mode instanceof ProgressiveQualifier) {\n this._actionModel.progressive = { mode: mode.getFlagValue() };\n this.addFlag(mode);\n }\n else {\n this._actionModel.progressive = { mode: mode };\n this.addFlag(progressive(mode));\n }\n return this;\n }\n /**\n * @description Ensures that images with a transparency channel are delivered in PNG format.\n */\n preserveTransparency() {\n this._actionModel.preserveTransparency = true;\n this.addFlag(preserveTransparency());\n return this;\n }\n static fromJson(actionModel) {\n const { formatType, lossy, progressive, preserveTransparency } = actionModel;\n let result;\n if (formatType) {\n result = new this('f', formatType);\n }\n else {\n result = new this('f');\n }\n if (progressive) {\n if (progressive.mode) {\n result.progressive(progressive.mode);\n }\n else {\n result.progressive();\n }\n }\n lossy && result.lossy();\n preserveTransparency && result.preserveTransparency();\n return result;\n }\n}\nexport { DeliveryFormatAction };\n","import { Action } from \"../internal/Action.js\";\nimport { BackgroundColor } from \"../actions/background/actions/BackgroundColor.js\";\nimport { FlagQualifier } from \"../qualifiers/flag/FlagQualifier.js\";\nimport { RawAction } from \"../internal/RawAction.js\";\nimport { isErrorObject } from \"../internal/models/IErrorObject.js\";\nimport { DeliveryFormatAction } from \"../actions/delivery/DeliveryFormatAction.js\";\n/**\n * @summary SDK\n * @description - Defines how to transform an asset\n * @memberOf SDK\n */\nclass Transformation {\n constructor() {\n this.actions = [];\n }\n /**\n * @param {SDK.Action | string} action\n * @return {this}\n */\n addAction(action) {\n let actionToAdd;\n if (typeof action === 'string') {\n if (action.indexOf('/') >= 0) {\n throw 'addAction cannot accept a string with a forward slash in it - /, use .addTransformation() instead';\n }\n else {\n actionToAdd = new RawAction(action);\n }\n }\n else {\n actionToAdd = action;\n }\n this.actions.push(actionToAdd);\n return this;\n }\n /**\n * @description Allows the injection of a raw transformation as a string into the transformation, or a Transformation instance that was previously created\n * @param {string | SDK.Transformation} tx\n * @example\n * import {Transformation} from \"@cloudinary/url-gen\";\n *\n * const transformation = new Transformation();\n * transformation.addTransformation('w_100/w_200/w_300');\n * @return {this}\n */\n addTransformation(tx) {\n if (tx instanceof Transformation) {\n // Concat the new actions into the existing actions\n this.actions = this.actions.concat(tx.actions);\n }\n else {\n this.actions.push(new RawAction(tx));\n }\n return this;\n }\n /**\n * @return {string}\n */\n toString() {\n return this.actions\n .map((action) => {\n return action.toString();\n })\n .filter((a) => a)\n .join('/');\n }\n /**\n * @description Delivers an animated GIF.\n * @param {AnimatedAction} animatedAction\n * @return {this}\n */\n animated(animatedAction) {\n return this.addAction(animatedAction);\n }\n /**\n * @description Adds a border around the image.\n * @param {Border} borderAction\n * @return {this}\n */\n border(borderAction) {\n return this.addAction(borderAction);\n }\n /**\n * @description Adjusts the shape of the delivered image. </br>\n * <b>Learn more:</b> {@link https://cloudinary.com/documentation/effects_and_artistic_enhancements#distort|Shape changes and distortion effects}\n * @param {IReshape} reshapeAction\n * @return {this}\n */\n reshape(reshapeAction) {\n return this.addAction(reshapeAction);\n }\n /**\n * @description Resize the asset using provided resize action\n * @param {ResizeSimpleAction} resizeAction\n * @return {this}\n */\n resize(resizeAction) {\n return this.addAction(resizeAction);\n }\n /**\n * @desc An alias to Action Delivery.quality\n * @param {string|number} quality\n * @return {this}\n */\n quality(quality) {\n this.addAction(new DeliveryFormatAction('q', quality));\n return this;\n }\n /**\n * @desc An alias to Action Delivery.format\n * @param {string} format\n * @return {this}\n */\n format(format) {\n this.addAction(new DeliveryFormatAction('f', format));\n return this;\n }\n /**\n * @description Rounds the specified corners of an image.\n * @param roundCornersAction\n * @return {this}\n */\n roundCorners(roundCornersAction) {\n return this.addAction(roundCornersAction);\n }\n /**\n * @description Adds an overlay over the base image.\n * @param {LayerAction} overlayAction\n * @return {this}\n */\n overlay(overlayAction) {\n return this.addAction(overlayAction);\n }\n /**\n * @description Adds an underlay under the base image.\n * @param {LayerAction} underlayAction\n * @return {this}\n */\n underlay(underlayAction) {\n underlayAction.setLayerType('u');\n return this.addAction(underlayAction);\n }\n /**\n * @description Defines an new user variable.\n * @param {VariableAction} variableAction\n * @return {this}\n */\n addVariable(variableAction) {\n return this.addAction(variableAction);\n }\n /**\n * @description Specifies a condition to be met before applying a transformation.\n * @param {ConditionalAction} conditionAction\n * @return {this}\n */\n conditional(conditionAction) {\n return this.addAction(conditionAction);\n }\n /**\n * @description Applies a filter or an effect on an asset.\n * @param {SimpleEffectAction} effectAction\n * @return {this}\n */\n effect(effectAction) {\n return this.addAction(effectAction);\n }\n /**\n * @description Applies adjustment effect on an asset.\n * @param action\n * @return {this}\n */\n adjust(action) {\n return this.addAction(action);\n }\n /**\n * @description Rotates the asset by the given angle.\n * @param {RotateAction} rotateAction\n * @return {this}\n */\n rotate(rotateAction) {\n return this.addAction(rotateAction);\n }\n /**\n * @description Applies a pre-defined named transformation of the given name.\n * @param {NamedTransformation} namedTransformation\n * @return {this}\n */\n namedTransformation(namedTransformation) {\n return this.addAction(namedTransformation);\n }\n /**\n * @description Applies delivery action.\n * @param deliveryAction\n * @return {this}\n */\n delivery(deliveryAction) {\n return this.addAction(deliveryAction);\n }\n /**\n * @description Sets the color of the background.\n * @param {Qualifiers.Color} color\n * @return {this}\n */\n backgroundColor(color) {\n return this.addAction(new BackgroundColor(color));\n }\n /**\n * @description Adds a layer in a Photoshop document.\n * @param action\n * @return {this}\n */\n psdTools(action) {\n return this.addAction(action);\n }\n /**\n * @description Extracts an image or a page using an index, a range, or a name from a layered media asset.\n * @param action\n * @return {this}\n */\n extract(action) {\n return this.addAction(action);\n }\n /**\n * @description Adds a flag as a separate action.\n * @param {Qualifiers.Flag | string} flagQualifier\n * @return {this}\n */\n addFlag(flagQualifier) {\n const action = new Action();\n let flagToAdd = flagQualifier;\n if (typeof flagQualifier === 'string') {\n flagToAdd = new FlagQualifier(flagQualifier);\n }\n action.addQualifier(flagToAdd);\n return this.addAction(action);\n }\n /**\n * @description Inject a custom function into the image transformation pipeline.\n * @return {this}\n */\n customFunction(customFunction) {\n return this.addAction(customFunction);\n }\n /**\n * Transcodes the video (or audio) to another format.\n * @param {Action} action\n * @return {this}\n */\n transcode(action) {\n return this.addAction(action);\n }\n /**\n * Applies the specified video edit action.\n *\n * @param {videoEditType} action\n * @return {this}\n */\n videoEdit(action) {\n return this.addAction(action);\n }\n toJson() {\n const actions = [];\n for (const action of this.actions) {\n const json = action.toJson();\n if (isErrorObject(json)) {\n // Fail early and return an IErrorObject\n return json;\n }\n actions.push(json);\n }\n return { actions };\n }\n}\nexport { Transformation };\n","import { Transformation } from \"./Transformation.js\";\n/**\n * @summary SDK\n * @extends {SDK.Transformation}\n * @memberOf SDK\n */\nclass ImageTransformation extends Transformation {\n}\nexport { ImageTransformation };\n","import { Transformation } from \"./Transformation.js\";\n/**\n * @summary SDK\n * @extends {SDK.Transformation}\n * @memberOf SDK\n */\nclass VideoTransformation extends Transformation {\n}\nexport { VideoTransformation };\n","/**\n *\n * @param publicID\n */\nexport function isUrl(publicID) {\n return publicID.match(/^https?:\\//);\n}\n","/**\n *\n * @param publicID\n */\nexport function isFileName(publicID) {\n return publicID.indexOf('/') < 0;\n}\n","/**\n *\n * @param publicID\n */\nexport function publicIDContainsVersion(publicID) {\n return publicID.match(/^v[0-9]+/);\n}\n","import { isUrl } from \"./urlUtils/isUrl.js\";\nimport { isFileName } from \"./urlUtils/isFileName.js\";\nimport { publicIDContainsVersion } from \"./urlUtils/publicIDContainsVersion.js\";\n/**\n * Create the URL prefix for Cloudinary resources.\n * Available use cases\n * http://res.cloudinary.com/{cloudName}\n * https://res.cloudinary.com/{cloudName}\n * https://{cloudName}-res.cloudinary.com/\n * http://{domain}/${cloudName}\n * https://{domain}/${cloudName}\n * https://{domain}\n * @private\n *\n * @param {string} cloudName\n * @param {IURLConfig} urlConfig\n */\nfunction getUrlPrefix(cloudName, urlConfig) {\n const secure = urlConfig.secure;\n const privateCDN = urlConfig.privateCdn;\n const cname = urlConfig.cname;\n const secureDistribution = urlConfig.secureDistribution;\n if (!secure && !cname) {\n return `http://res.cloudinary.com/${cloudName}`;\n }\n if (secure && !secureDistribution && privateCDN) {\n return `https://${cloudName}-res.cloudinary.com`;\n }\n if (secure && !secureDistribution) {\n return `https://res.cloudinary.com/${cloudName}`;\n }\n if (secure && secureDistribution && privateCDN) {\n return `https://${secureDistribution}`;\n }\n if (secure && secureDistribution) {\n return `https://${secureDistribution}/${cloudName}`;\n }\n if (!secure && cname) {\n return `http://${cname}/${cloudName}`;\n }\n else {\n return 'ERROR';\n }\n}\n/**\n * @private\n * @param assetType\n */\nfunction handleAssetType(assetType) {\n //default to image\n if (!assetType) {\n return 'image';\n }\n return assetType;\n}\n/**\n * @private\n * @param deliveryType\n */\nfunction handleDeliveryType(deliveryType) {\n //default to upload\n if (!deliveryType) {\n return 'upload';\n }\n return deliveryType;\n}\n/**\n *\n * @param {string} publicID\n * @param {number} version\n * @param {boolean} forceVersion\n */\nfunction getUrlVersion(publicID, version, forceVersion) {\n const shouldForceVersion = forceVersion !== false;\n if (version) {\n return `v${version}`;\n }\n // In all these conditions we never force a version\n if (publicIDContainsVersion(publicID) || isUrl(publicID) || isFileName(publicID)) {\n return '';\n }\n return shouldForceVersion ? 'v1' : '';\n}\nexport { handleAssetType, getUrlVersion, handleDeliveryType, getUrlPrefix };\n","/**\n * @private\n * @description Adds left padding to a string with the desired substring the provided number of times\n * @example stringPad(foo, 3, 'a'') // -> aaafoo\n * @param {string} value\n * @param {number} _targetLength\n * @param {string} _padString\n */\nexport function stringPad(value, _targetLength, _padString) {\n let targetLength = _targetLength >> 0; //truncate if number or convert non-number to 0;\n let padString = String((typeof _padString !== 'undefined' ? _padString : ' '));\n if (value.length > targetLength) {\n return String(value);\n }\n else {\n targetLength = targetLength - value.length;\n if (targetLength > padString.length) {\n padString += repeatStringNumTimes(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(value);\n }\n}\n/**\n * @description Repeat a string multiple times, cross-browser-safe alternative to string.repeat()\n * @param string\n * @param _times\n */\nfunction repeatStringNumTimes(string, _times) {\n let times = _times;\n let repeatedString = \"\";\n while (times > 0) {\n repeatedString += string;\n times--;\n }\n return repeatedString;\n}\n","import { stringPad } from \"./stringPad.js\";\n/**\n * This file maps sequences of 6 bit binary digits to a character in base64.\n * 000000 -> A\n * 110011 -> Z\n * 111111 -> /\n */\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst base64Map = {};\nlet num = 0;\nchars.split('').forEach((char) => {\n let key = num.toString(2);\n key = stringPad(key, 6, '0');\n base64Map[key] = char;\n num++;\n});\n/**\n * Map of [six-bit binary codes] -> [Base64 characters]\n */\nexport { base64Map };\n","/**\n * @private\n * @description Reverses the version positions, x.y.z turns to z.y.x\n * Example: 1.2.3 -> 03.02.01\n * @param {string} semVer Input can be either x.y.z or x.y\n * @return {string} in the form of zz.yy.xx (\n */\nexport function reverseVersion(semVer) {\n if (semVer.split('.').length < 2) {\n throw new Error('invalid semVer, must have at least two segments');\n }\n // Split by '.', reverse, create new array\n return semVer.split('.').reverse().join('.');\n}\n","import { stringPad } from \"./stringPad.js\";\n/**\n * @private\n * @description Pads each segment with '0' so they have length of 2\n * @param {string} semVer Input can be either x.y.z or x.y\n * @return {string} in the form of xx.yy.zz (\n */\nexport function padVersion(semVer) {\n if (semVer.split('.').length < 2) {\n throw new Error('invalid semVer, must have at least two segments');\n }\n // Split by '.', reverse, create new array with padded values and concat it together\n return semVer.split('.').map((segment) => {\n // try to cast to number\n const asNumber = +segment;\n if (isNaN(asNumber) || asNumber < 0) {\n throw 'Invalid version number provided';\n }\n return stringPad(segment, 2, '0');\n }).join('.');\n}\n","import { base64Map } from \"./base64Map.js\";\nimport { stringPad } from \"./stringPad.js\";\nimport { reverseVersion } from \"./reverseVersion.js\";\nimport { padVersion } from \"./padVersion.js\";\n/**\n * @private\n * @description Encodes a semVer-like version string\n * @param {string} semVer Input can be either x.y.z or x.y\n * @return {string} A string built from 3 characters of the base64 table that encode the semVer\n */\nexport function encodeVersion(semVer) {\n let strResult = '';\n // support x.y or x.y.z by using 'parts' as a variable\n const parts = semVer.split('.').length;\n const paddedStringLength = parts * 6; // we pad to either 12 or 18 characters\n // reverse (but don't mirror) the version. 1.5.15 -> 15.5.1\n const reversedSemver = reverseVersion(semVer);\n // Pad to two spaces, 15.5.1 -> 15.05.01\n const paddedSemver = padVersion(reversedSemver);\n // turn 15.05.01 to a string '150501' then to a number 150501\n const num = parseInt(paddedSemver.split('.').join(''));\n // Represent as binary, add left padding to 12 or 18 characters.\n // 150,501 -> 100100101111100101\n let paddedBinary = num.toString(2);\n paddedBinary = stringPad(paddedBinary, paddedStringLength, '0');\n // Stop in case an invalid version number was provided\n // paddedBinary must be built from sections of 6 bits\n if (paddedBinary.length % 6 !== 0) {\n throw 'Version must be smaller than 43.21.26)';\n }\n // turn every 6 bits into a character using the base64Map\n paddedBinary.match(/.{1,6}/g).forEach((bitString) => {\n // console.log(bitString);\n strResult += base64Map[bitString];\n });\n return strResult;\n}\n","/**\n * @private\n * @description Gets the analyticsOptions from options- should include sdkSemver, techVersion, sdkCode, and feature\n * @param {ITrackedPropertiesThroughAnalytics} options\n * @returns {IAnalyticsOptions}\n */\nexport function getAnalyticsOptions(options) {\n const analyticsOptions = {\n sdkSemver: options.sdkSemver,\n techVersion: options.techVersion,\n sdkCode: options.sdkCode,\n product: options.product,\n feature: '0',\n osType: options.osType,\n osVersion: options.osVersion,\n };\n if (options.accessibility) {\n analyticsOptions.feature = 'D';\n }\n if (options.lazyload) {\n analyticsOptions.feature = 'C';\n }\n if (options.responsive) {\n analyticsOptions.feature = 'A';\n }\n if (options.placeholder) {\n analyticsOptions.feature = 'B';\n }\n return analyticsOptions;\n}\n","const packageVersion = '1.21.0';\n/**\n * Export package version (injected during our build).\n * Reason for this is that If we import values from from package.json,\n * it will cause an error for users who do not have an 'import from json' plugin\n * as part of their build process / bundler.\n */\nexport { packageVersion };\n","import { base64Map } from \"./base64Map.js\";\n/**\n * @private\n * @description Encodes a semVer-like version string for OS\n * @param {string} semVer Input is x.y\n * @return {string} A string built from 2 characters of the base64 table that encode the semVer\n */\nexport function encodeOSVersion(semVer) {\n const [major, minor] = semVer.split('.');\n //convert to binary\n const binaryMajorVersion = parseInt(major).toString(2);\n const binaryMinorVersion = parseInt(minor).toString(2);\n //pad to 6\n const paddedMajor = binaryMajorVersion.padStart(6, '0');\n const paddedMinor = binaryMinorVersion.padStart(6, '0');\n return base64Map[paddedMajor] + base64Map[paddedMinor];\n}\n","import { encodeVersion } from \"./encodeVersion.js\";\nimport { getAnalyticsOptions } from \"./getAnalyticsOptions.js\";\nimport { packageVersion } from \"../internal/utils/packageVersion.js\";\nimport { encodeOSVersion } from \"./encodeOSVersion.js\";\n/**\n * @private\n * @description Try to get the node version out of process, if browser just return 0.0.0\n */\nfunction getNodeVersion() {\n const failedVersion = '0.0.0';\n if (typeof window !== 'undefined') {\n return failedVersion;\n }\n else {\n // node env\n try {\n return process.versions.node || failedVersion;\n }\n catch (e) {\n return failedVersion;\n }\n }\n}\n/**\n * @private\n * @description Ensure that all values ITrackedPropertiesThroughAnalytics are populated.\n * Accept a partial map of values and returns the complete interface of ITrackedPropertiesThroughAnalytics\n * @param {ITrackedPropertiesThroughAnalytics} trackedAnalytics\n * @param {ITrackedPropertiesThroughAnalytics} trackedAnalytics\n */\nfunction ensureShapeOfTrackedProperties(trackedAnalytics) {\n // try to get the process version from node, but if we're on the client return 0.0.0\n const defaults = {\n techVersion: getNodeVersion(),\n sdkCode: 'T',\n sdkSemver: packageVersion.split('-')[0],\n product: 'A',\n osType: 'Z',\n osVersion: '0.0',\n responsive: false,\n placeholder: false,\n lazyload: false,\n accessibility: false\n };\n if (!trackedAnalytics) {\n return defaults;\n }\n else {\n return Object.assign(Object.assign({}, defaults), trackedAnalytics);\n }\n}\n/**\n * @private\n * @description Creates the complete SDK signature by using all the values provided by ITrackedPropertiesThroughAnalytics\n * Creation of the signature\n * - Set the AlgoVersion of the encoding, this is an internal letter that represents the version\n * of our encoding algorithm, it will allow us to perform breaking changes if we'll need them.\n * - Take the constant SDK code (Arbitrary letter chosen for each SDK, for Base that letter is 'T')\n * this is used to tell apart which SDK is being tracked.\n * - Take the {major.minor} versions of the node version (techVersion) (14.2, 16.2 etc.)\n * - Take the full semver of the SDK you wish to track\n * - Take the features used(lazy, placeholder etc.) and turn them to a letter (for example accessibility -> D)\n * - Before appending the string, the Versions must be encoded, see the function `encodeVersion` for more details\n * - Append all the variables to a single string\n * - In any case of an error, return the single letter 'E'\n *\n * @return {string} sdkAnalyticsSignature\n */\nexport function getSDKAnalyticsSignature(_trackedAnalytics) {\n const trackedAnalytics = ensureShapeOfTrackedProperties(_trackedAnalytics);\n const analyticsOptions = getAnalyticsOptions(trackedAnalytics);\n try {\n const twoPartVersion = removePatchFromSemver(analyticsOptions.techVersion);\n const encodedSDKVersion = encodeVersion(analyticsOptions.sdkSemver);\n const encodedTechVersion = encodeVersion(twoPartVersion);\n const encodedOSVersion = encodeOSVersion(analyticsOptions.osVersion);\n const featureCode = analyticsOptions.feature;\n const SDKCode = analyticsOptions.sdkCode;\n const { product, osType } = analyticsOptions;\n const algoVersion = 'D'; // The algo version is determined here, it should not be an argument\n return `${algoVersion}${product}${SDKCode}${encodedSDKVersion}${encodedTechVersion}${osType}${encodedOSVersion}${featureCode}`;\n }\n catch (e) {\n // Either SDK or Node versions were unparsable\n return 'E';\n }\n}\n/**\n * @private\n * @description Removes patch version from the semver if it exists\n * Turns x.y.z OR x.y into x.y\n * @param {'x.y.z' | 'x.y' | string} semVerStr\n */\nfunction removePatchFromSemver(semVerStr) {\n const parts = semVerStr.split('.');\n return `${parts[0]}.${parts[1]}`;\n}\n","import { getUrlPrefix, getUrlVersion, handleAssetType, handleDeliveryType } from \"../internal/url/cloudinaryURL.js\";\nimport URLConfig from \"../config/URLConfig.js\";\nimport { getSDKAnalyticsSignature } from \"../sdkAnalytics/getSDKAnalyticsSignature.js\";\n/**\n * This const contains all the valid combination of asset/delivery for URL shortening purposes\n * It's exported because it's used in a test, but it's not really shared enough to belong in a separate file\n */\nexport const SEO_TYPES = {\n \"image/upload\": \"images\",\n \"image/private\": \"private_images\",\n \"image/authenticated\": \"authenticated_images\",\n \"raw/upload\": \"files\",\n \"video/upload\": \"videos\"\n};\n/**\n * @description Cloudinary file without a transformation\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryFile {\n constructor(publicID, cloudConfig = {}, urlConfig) {\n this.setPublicID(publicID);\n this.setCloudConfig(cloudConfig);\n this.setURLConfig(urlConfig);\n }\n /**\n * @description Sets the URL Config for this asset\n * @param urlConfig\n * @return {this}\n */\n setURLConfig(urlConfig) {\n this.urlConfig = new URLConfig(urlConfig);\n return this;\n }\n /**\n * @description Sets the Cloud Config for this asset\n * @param urlConfig\n * @return {this}\n */\n setCloudConfig(cloudConfig) {\n this.cloudName = cloudConfig.cloudName;\n this.apiKey = cloudConfig.apiKey;\n this.apiSecret = cloudConfig.apiSecret;\n this.authToken = cloudConfig.authToken;\n return this;\n }\n /**\n * @description Sets the public ID of the asset.\n * @param {string} publicID The public ID of the asset.\n * @return {this}\n */\n setPublicID(publicID) {\n // PublicID must be a string!\n this.publicID = publicID ? publicID.toString() : '';\n return this;\n }\n /**\n * @description Sets the delivery type of the asset.\n * @param {DELIVERY_TYPE | string} newType The type of the asset.\n * @return {this}\n */\n setDeliveryType(newType) {\n this.deliveryType = newType;\n return this;\n }\n /**\n * @description Sets the URL SEO suffix of the asset.\n * @param {string} newSuffix The SEO suffix.\n * @return {this}\n */\n setSuffix(newSuffix) {\n this.suffix = newSuffix;\n return this;\n }\n /**\n * @description Sets the signature of the asset.\n * @param {string} signature The signature.\n * @return {this}\n */\n setSignature(signature) {\n this.signature = signature;\n return this;\n }\n /**\n * @description Sets the version of the asset.\n * @param {string} newVersion The version of the asset.\n * @return {this}\n */\n setVersion(newVersion) {\n if (newVersion) {\n this.version = newVersion;\n }\n return this;\n }\n /**\n * @description Sets the asset type.\n * @param {string} newType The type of the asset.\n * @return {this}\n */\n setAssetType(newType) {\n if (newType) {\n this.assetType = newType;\n }\n return this;\n }\n sign() {\n return this;\n }\n /**\n * @description Serializes to URL string\n * @param overwriteOptions\n */\n toURL(overwriteOptions = {}) {\n return this.createCloudinaryURL(null, overwriteOptions.trackedAnalytics);\n }\n /**\n * @description Validate various options before attempting to create a URL\n * The function will throw in case a violation\n * @throws Validation errors\n */\n validateAssetForURLCreation() {\n if (typeof this.cloudName === 'undefined') {\n throw 'You must supply a cloudName when initializing the asset';\n }\n const suffixContainsDot = this.suffix && this.suffix.indexOf('.') >= 0;\n const suffixContainsSlash = this.suffix && this.suffix.indexOf('/') >= 0;\n if (suffixContainsDot || suffixContainsSlash) {\n throw '`suffix`` should not include . or /';\n }\n }\n /**\n * @description return an SEO friendly name for a combination of asset/delivery, some examples:\n * * image/upload -> images\n * * video/upload -> videos\n * If no match is found, return `{asset}/{delivery}`\n */\n getResourceType() {\n const assetType = handleAssetType(this.assetType);\n const deliveryType = handleDeliveryType(this.deliveryType);\n const hasSuffix = !!this.suffix;\n const regularSEOType = `${assetType}/${deliveryType}`;\n const shortSEOType = SEO_TYPES[`${assetType}/${deliveryType}`];\n const useRootPath = this.urlConfig.useRootPath;\n const shorten = this.urlConfig.shorten;\n // Quick exit incase of useRootPath\n if (useRootPath) {\n if (regularSEOType === 'image/upload') {\n return ''; // For image/upload we're done, just return nothing\n }\n else {\n throw new Error(`useRootPath can only be used with assetType: 'image' and deliveryType: 'upload'. Provided: ${regularSEOType} instead`);\n }\n }\n if (shorten && regularSEOType === 'image/upload') {\n return 'iu';\n }\n if (hasSuffix) {\n if (shortSEOType) {\n return shortSEOType;\n }\n else {\n throw new Error(`URL Suffix only supported for ${Object.keys(SEO_TYPES).join(', ')}, Provided: ${regularSEOType} instead`);\n }\n }\n // If all else fails, return the regular image/upload combination (asset/delivery)\n return regularSEOType;\n }\n getSignature() {\n if (this.signature) {\n return `s--${this.signature}--`;\n }\n else {\n return '';\n }\n }\n /**\n *\n * @description Creates a fully qualified CloudinaryURL\n * @return {string} CloudinaryURL\n * @throws Validation Errors\n */\n createCloudinaryURL(transformation, trackedAnalytics) {\n // In accordance with the existing implementation, if no publicID exists we should return nothing.\n if (!this.publicID) {\n return '';\n }\n // Throws if some options are mis-configured\n // See the function for more information on when it throws\n this.validateAssetForURLCreation();\n const prefix = getUrlPrefix(this.cloudName, this.urlConfig);\n const transformationString = transformation ? transformation.toString() : '';\n const version = getUrlVersion(this.publicID, this.version, this.urlConfig.forceVersion);\n const publicID = this.publicID;\n if (typeof transformation === 'string') {\n const url = [prefix, this.getResourceType(), this.getSignature(), transformationString, version, publicID.replace(/,/g, '%2C'), this.suffix]\n .filter((a) => a)\n .join('/');\n return url;\n }\n else {\n // Avoid applying encodeURI on entire string in case where we have transformations with comma (i.e. f_auto,q_auto)\n // Since encodeURI does not encode commas we replace commas *only* on the publicID\n const safeURL = [\n encodeURI(prefix),\n this.getResourceType(),\n this.getSignature(),\n encodeURI(transformationString),\n version,\n encodeURI(publicID).replace(/,/g, '%2C'),\n this.suffix && encodeURI(this.suffix)\n ]\n .filter((a) => a)\n .join('/')\n .replace(/\\?/g, '%3F')\n .replace(/=/g, '%3D');\n const shouldAddAnalytics = this.urlConfig.analytics !== false && !(publicID.includes('?'));\n let queryParamsString = '';\n if (typeof (this.urlConfig.queryParams) === 'object') {\n try {\n const queryParams = new URLSearchParams(this.urlConfig.queryParams);\n if (shouldAddAnalytics) {\n queryParams.set(\"_a\", getSDKAnalyticsSignature(trackedAnalytics));\n }\n queryParamsString = queryParams.toString();\n }\n catch (err) {\n console.error('Error: URLSearchParams is not available so the queryParams object cannot be parsed, please try passing as an already parsed string');\n }\n }\n else {\n queryParamsString = this.urlConfig.queryParams || '';\n if (shouldAddAnalytics) {\n queryParamsString += `${(queryParamsString.length > 0 ? '&' : '')}_a=${getSDKAnalyticsSignature(trackedAnalytics)}`;\n }\n }\n if (queryParamsString) {\n return `${safeURL}?${queryParamsString}`;\n }\n else {\n return safeURL;\n }\n }\n }\n}\nexport { CloudinaryFile };\n","import { CloudinaryFile } from \"./CloudinaryFile.js\";\nimport { DeliveryFormatAction } from \"@cloudinary/transformation-builder-sdk/actions/delivery/DeliveryFormatAction\";\n/**\n * @desc Cloudinary Transformable interface, extended by any class that needs a Transformation Interface\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryTransformable extends CloudinaryFile {\n constructor(publicID, cloudConfig, urlConfig, transformation) {\n /* istanbul ignore next */\n super(publicID, cloudConfig, urlConfig);\n this.transformation = transformation;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Animated} animated\n * @return {this}\n */\n animated(animated) {\n this.transformation.animated(animated);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Border} border\n * @return {this}\n */\n border(border) {\n this.transformation.border(border);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Reshape} reshape\n * @return {this}\n */\n reshape(reshape) {\n this.transformation.reshape(reshape);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Resize} resize\n * @return {this}\n */\n resize(resize) {\n this.transformation.resize(resize);\n return this;\n }\n /**\n * @desc An alias to Action Delivery.quality\n * @param {string|number} quality\n * @return {this}\n */\n quality(quality) {\n this.addAction(new DeliveryFormatAction('q', quality));\n return this;\n }\n /**\n * @desc An alias to Action Delivery.format\n * @param {string} format\n * @return {this}\n */\n format(format) {\n this.addAction(new DeliveryFormatAction('f', format));\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.RoundCorners} roundCorners\n * @return {this}\n */\n roundCorners(roundCorners) {\n this.transformation.roundCorners(roundCorners);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @return {this}\n */\n overlay(overlayAction) {\n this.transformation.overlay(overlayAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Variable} variableAction\n * @return {this}\n */\n addVariable(variableAction) {\n this.transformation.addVariable(variableAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Condition} conditionalAction\n * @return {this}\n */\n conditional(conditionalAction) {\n this.transformation.conditional(conditionalAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Effect} effect\n * @return {this}\n */\n effect(effect) {\n this.transformation.effect(effect);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Adjust} action\n * @return {this}\n */\n adjust(action) {\n this.transformation.adjust(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Rotate} rotate\n * @return {this}\n */\n rotate(rotate) {\n this.transformation.rotate(rotate);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.NamedTransformation} namedTransformation\n * @return {this}\n */\n namedTransformation(namedTransformation) {\n this.transformation.namedTransformation(namedTransformation);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Delivery} deliveryAction\n * @return {this}\n */\n delivery(deliveryAction) {\n this.transformation.delivery(deliveryAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Qualifiers.color} color\n * @return {this}\n */\n backgroundColor(color) {\n this.transformation.backgroundColor(color);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.PSDTools} action\n * @return {this}\n */\n psdTools(action) {\n this.transformation.psdTools(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Extract} action\n * @return {this}\n */\n extract(action) {\n this.transformation.extract(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Qualifiers.Flag | string} flagQualifier\n * @return {this}\n */\n addFlag(flagQualifier) {\n this.transformation.addFlag(flagQualifier);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.CustomFunction} customFunction\n * @return {this}\n */\n customFunction(customFunction) {\n this.transformation.customFunction(customFunction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {SDK.Action | string} action\n * @return {this}\n */\n addAction(action) {\n this.transformation.addAction(action);\n return this;\n }\n /**\n * @description Extend your transformation with another transformation\n * @param { string | SDK.Transformation } tx\n */\n addTransformation(tx) {\n this.transformation.addTransformation(tx);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @return {string}\n */\n toString() {\n return this.transformation.toString();\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @return {this}\n */\n underlay(underlayAction) {\n this.transformation.underlay(underlayAction);\n return this;\n }\n toURL(overwriteOptions = {}) {\n return this.createCloudinaryURL(this.transformation, overwriteOptions === null || overwriteOptions === void 0 ? void 0 : overwriteOptions.trackedAnalytics);\n }\n}\nexport { CloudinaryTransformable };\n","import { ImageTransformation } from \"@cloudinary/transformation-builder-sdk/transformation/ImageTransformation\";\nimport { CloudinaryTransformable } from \"./CloudinaryTransformable.js\";\n/**\n * @desc Cloudinary image asset, with image-related transformations\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryImage extends CloudinaryTransformable {\n constructor(publicID, cloudConfig, urlConfig) {\n /* istanbul ignore next */\n super(publicID, cloudConfig, urlConfig, new ImageTransformation());\n }\n}\nexport { CloudinaryImage };\n","import { CloudinaryTransformable } from \"./CloudinaryTransformable.js\";\nimport { VideoTransformation } from \"../transformation/VideoTransformation.js\";\n/**\n * @desc Cloudinary video asset, with video-related transformations\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryVideo extends CloudinaryTransformable {\n constructor(publicID, cloudConfig, urlConfig) {\n /* istanbul ignore next */\n super(publicID, cloudConfig, urlConfig, new VideoTransformation());\n this.assetType = 'video';\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Transcode} action\n * @return {this}\n */\n transcode(action) {\n this.transformation.transcode(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.VideoEdit} action\n * @return {this}\n */\n videoEdit(action) {\n this.transformation.videoEdit(action);\n return this;\n }\n}\nexport { CloudinaryVideo };\n","import { CloudinaryImage } from \"../assets/CloudinaryImage.js\";\nimport { CloudinaryVideo } from \"../assets/CloudinaryVideo.js\";\nclass Cloudinary {\n constructor(cloudinaryConfig) {\n if (cloudinaryConfig) {\n this.cloudinaryConfig = cloudinaryConfig;\n }\n }\n image(publicID) {\n return new CloudinaryImage(publicID, this.cloudinaryConfig.cloud, this.cloudinaryConfig.url);\n }\n video(publicID) {\n return new CloudinaryVideo(publicID, this.cloudinaryConfig.cloud, this.cloudinaryConfig.url);\n }\n setConfig(cloudinaryConfig) {\n this.cloudinaryConfig = cloudinaryConfig;\n return this;\n }\n getConfig() {\n return this.cloudinaryConfig;\n }\n extendConfig() {\n // Future implementation\n }\n}\nexport { Cloudinary };\n","import { type TransformerOption } from '@cld-apis/types'\nimport { buildImageUrl, setConfig } from 'cloudinary-build-url'\nimport emojiRegex from 'emoji-regex'\nimport { toBase64 } from './utils/misc.tsx'\nimport { type CSSProperties } from 'react'\nimport clsx from 'clsx'\nimport { Cloudinary } from '@cloudinary/url-gen'\n\nconst cloudName = 'dnpe4swr2'\n\nsetConfig({\n cloudName,\n})\n\nexport const cloudinaryInstance = new Cloudinary({\n cloud: {\n cloudName,\n },\n})\n\ntype ImageBuilder = {\n (transformations?: TransformerOption): string\n alt: string\n id: string\n className?: string\n style?: CSSProperties\n}\nconst createImages = <\n ImageType extends Record<\n string,\n Pick<ImageBuilder, 'id' | 'alt' | 'className' | 'style'>\n >,\n>(\n images: ImageType,\n) => {\n const imageBuilders: Record<string, ImageBuilder> = {}\n for (const [name, { id, alt, className, style }] of Object.entries(images)) {\n imageBuilders[name] = getImageBuilder(id, alt, { className, style })\n }\n return imageBuilders as { [Name in keyof ImageType]: ImageBuilder }\n}\n\nfunction getImageBuilder(\n id: string,\n alt: string = '',\n { className, style }: { className?: string; style?: CSSProperties } = {},\n): ImageBuilder {\n function imageBuilder(transformations?: TransformerOption) {\n return buildImageUrl(id, { transformations })\n }\n imageBuilder.alt = alt\n imageBuilder.id = id\n imageBuilder.className = className\n imageBuilder.style = style\n return imageBuilder\n}\n\nconst square = { aspectRatio: '1/1' } satisfies CSSProperties\n\nconst images = createImages({\n vinhAvatar: {\n id: 'vinh/avatar',\n alt: 'Young Vinh',\n style: square,\n },\n defaultFeaturedImage: {\n id: 'blog/default-featured-image.jpg',\n alt: 'Vinh Nguyen',\n },\n homeCover1: {\n id: 'blog/home-illustrations/black-hole-universe-1_yexnay',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Back Hole Universe',\n },\n homeCover2: {\n id: 'blog/home-illustrations/black-hole-universe-2_sotdd0',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Back Hole Universe',\n },\n homeCover3: {\n id: 'blog/home-illustrations/black-hole-universe-3_w4kjep',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Back Hole Universe',\n },\n homeCover4: {\n id: 'blog/home-illustrations/infinite-universe-1_wt3ohc',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Infinite Universe',\n },\n homeCover5: {\n id: 'blog/home-illustrations/infinite-universe-2_snym75',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Infinite Universe',\n },\n seriesCover: {\n id: 'blog/series/hero_flegru',\n alt: 'Photo by Clay Banks on Unsplash',\n },\n})\n\nfunction getImgProps(\n imageBuilder: ImageBuilder,\n {\n widths,\n sizes,\n transformations,\n className,\n style,\n }: {\n widths: Array<number>\n sizes: Array<string>\n transformations?: TransformerOption\n className?: string\n style?: CSSProperties\n },\n) {\n const averageSize = Math.ceil(widths.reduce((a, s) => a + s) / widths.length)\n const aspectRatio = transformations?.resize?.aspectRatio\n ? transformations.resize.aspectRatio.replace(':', '/')\n : transformations?.resize?.height && transformations.resize.width\n ? `${transformations.resize.width}/${transformations.resize.height}`\n : imageBuilder.style?.aspectRatio\n\n return {\n style: {\n ...imageBuilder.style,\n aspectRatio,\n ...style,\n },\n className: clsx(imageBuilder.className, className),\n alt: imageBuilder.alt,\n src: imageBuilder({\n quality: 'auto',\n format: 'auto',\n ...transformations,\n resize: { width: averageSize, ...transformations?.resize },\n }),\n srcSet: widths\n .map(width =>\n [\n imageBuilder({\n quality: 'auto',\n format: 'auto',\n ...transformations,\n resize: { width, ...transformations?.resize },\n }),\n `${width}w`,\n ].join(' '),\n )\n .join(', '),\n sizes: sizes.join(', '),\n crossOrigin: 'anonymous',\n } as const\n}\n\nfunction getSocialImageWithPreTitle({\n title,\n preTitle,\n featuredImage: img,\n}: {\n title: string\n preTitle: string\n featuredImage: string\n url: string\n}) {\n const vars = `$th_1256,$tw_2400,$gw_$tw_div_24,$gh_$th_div_12`\n\n const encodedPreTitle = doubleEncode(emojiStrip(preTitle))\n const preTitleSection = `co_rgb:a9adc1,c_fit,g_north_west,w_$gw_mul_14,h_$gh,x_$gw_mul_1.5,y_$gh_mul_1.3,l_text:Arial_24_bold:${encodedPreTitle}`\n\n const encodedTitle = doubleEncode(emojiStrip(title))\n const titleSection = `co_white,c_fit,g_north_west,w_$gw_mul_13.5,h_$gh_mul_7,x_$gw_mul_1.5,y_$gh_mul_2.3,l_text:roboto_100_normal_left:${encodedTitle}`\n\n const featuredImageIsRemote = img.startsWith('http')\n const featuredImageCloudinaryId = featuredImageIsRemote\n ? toBase64(img)\n : img.replace(/\\//g, ':')\n const featuredImageLayerType = featuredImageIsRemote ? 'l_fetch:' : 'l_'\n const featuredImageSection = `c_fill,ar_3:4,r_12,g_east,h_$gh_mul_10,x_$gw,${featuredImageLayerType}${featuredImageCloudinaryId}`\n\n return [\n `https://res.cloudinary.com/${cloudName}/image/upload`,\n vars,\n preTitleSection,\n titleSection,\n featuredImageSection,\n `c_fill,w_$tw,h_$th/blog/default-social-background.png`,\n ].join('/')\n}\n\nfunction getGenericSocialImage({\n words,\n featuredImage: img,\n}: {\n words: string\n featuredImage: string\n url: string\n}) {\n const vars = `$th_1256,$tw_2400,$gw_$tw_div_24,$gh_$th_div_12`\n\n const encodedWords = doubleEncode(emojiStrip(words))\n const primaryWordsSection = `co_white,c_fit,g_north_west,w_$gw_mul_10,h_$gh_mul_7,x_$gw_mul_1.3,y_$gh_mul_1.5,l_text:roboto_80_normal_left:${encodedWords}`\n\n const featuredImageIsRemote = img.startsWith('http')\n const featuredImageCloudinaryId = featuredImageIsRemote\n ? toBase64(img)\n : img.replace(/\\//g, ':')\n const featuredImageLayerType = featuredImageIsRemote ? 'l_fetch:' : 'l_'\n\n const featureImageSection = `c_fit,g_east,w_$gw_mul_11,h_$gh_mul_11,x_$gw,${featuredImageLayerType}${featuredImageCloudinaryId}`\n\n const backgroundSection = `c_fill,w_$tw,h_$th/blog/default-social-background.png`\n return [\n `https://res.cloudinary.com/${cloudName}/image/upload`,\n vars,\n primaryWordsSection,\n featureImageSection,\n backgroundSection,\n ].join('/')\n}\n\nfunction emojiStrip(string: string) {\n return string\n .replace(emojiRegex(), '')\n .split(' ')\n .filter(Boolean)\n .join(' ')\n .trim()\n}\n\nfunction doubleEncode(s: string) {\n return encodeURIComponent(encodeURIComponent(s))\n}\n\nexport {\n images,\n getImgProps,\n getImageBuilder,\n getGenericSocialImage,\n getSocialImageWithPreTitle,\n}\nexport type { ImageBuilder }\n","import { clsx } from 'clsx'\nimport * as React from 'react'\n\ninterface GridProps {\n children: React.ReactNode\n overflow?: boolean\n className?: string\n as?: React.ElementType\n id?: string\n nested?: boolean\n rowGap?: boolean\n featured?: boolean\n}\n\nconst Grid = React.forwardRef<HTMLElement, GridProps>(function Grid(\n { children, className, as: Tag = 'div', featured, nested, rowGap, id },\n ref,\n) {\n return (\n <Tag\n ref={ref}\n id={id}\n className={clsx('relative', {\n 'mx-10vw': !nested,\n 'w-full': nested,\n 'py-10 md:py-24 lg:pb-40 lg:pt-36': featured,\n })}\n >\n {featured ? (\n <div className=\"absolute inset-0 -mx-5vw\">\n <div className=\"bg-secondary mx-auto h-full w-full max-w-8xl rounded-lg\" />\n </div>\n ) : null}\n\n <div\n className={clsx(\n 'relative grid grid-cols-4 gap-x-4 md:grid-cols-8 lg:grid-cols-12 lg:gap-x-6',\n {\n 'mx-auto max-w-7xl': !nested,\n 'gap-y-4 lg:gap-y-6': rowGap,\n },\n className,\n )}\n >\n {children}\n </div>\n </Tag>\n )\n})\n\n/**\n * Use for development only! It renders the grid columns and gaps as page overlay\n */\nfunction GridLines() {\n if (ENV.NODE_ENV !== 'development') {\n throw new Error('<GridLines /> should only be used during development')\n }\n\n return (\n <div className=\"pointer-events-none fixed inset-0 z-10 select-none\">\n <Grid>\n {Array.from({ length: 12 }).map((_, idx) => (\n <div\n key={idx}\n className=\"flex h-screen items-start bg-black text-black opacity-10 dark:bg-white dark:text-white\"\n >\n <div className=\"w-full pt-4 text-center text-lg text-black dark:text-white\">\n {idx + 1}\n </div>\n </div>\n ))}\n </Grid>\n </div>\n )\n}\n\nexport { Grid, GridLines }\n","/**\n * This file generates keyframes for any animation, you can extend it with more properties if needed.\n * It is designed to be used with Tailwind config and CSS variables.\n * Main problem it solves is implementing a sequence of animations with static keyframes\n * and allowing it to be controlled with CSS variables.\n * @param name Name of the animation, will be used as a prefix for CSS variables\n * @param steps Maximum amount of steps the animation will have including all conditional steps\n * @param initial Initial style for the animation\n * @param visible Visible style for the animation\n */\nfunction generateAnimation({\n name,\n steps,\n initial,\n visible,\n}: {\n name: string\n steps: number\n initial: { opacity?: number; x?: string; y?: string }\n visible: { opacity?: number; x?: string; y?: string }\n}) {\n const keyframes = new Map<string, { opacity: string; transform: string }>()\n\n keyframes.set('0%', {\n opacity: (initial.opacity ?? 0).toString(),\n transform: `translate(${initial.x ?? 0}, ${initial.y ?? 0})`,\n })\n\n for (let step = 0; step < steps; step++) {\n keyframes.set(`${(100 * (step + 1)) / steps}%`, {\n opacity: `var(--${name}-opacity-step-${step})`,\n transform: `translate(var(--${name}-x-step-${step}), var(--${name}-y-step-${step}))`,\n })\n }\n\n function getVariables(activeStep: number) {\n const variables = new Map<string, string | number>()\n for (let step = 0; step < steps; step++) {\n const value = step >= activeStep ? visible : initial\n variables.set(`--${name}-opacity-step-${step}`, value.opacity ?? 0)\n variables.set(`--${name}-x-step-${step}`, value.x ?? 0)\n variables.set(`--${name}-y-step-${step}`, value.y ?? 0)\n }\n return Object.fromEntries(variables)\n }\n\n return {\n name,\n keyframes: Object.fromEntries(keyframes),\n getVariables,\n }\n}\n\nexport const heroTextAnimation = generateAnimation({\n name: 'hero-text-reveal',\n steps: 4,\n initial: {\n opacity: 0,\n y: '25px',\n },\n visible: {\n opacity: 1,\n y: '0px',\n },\n})\n","import { type TransformerOption } from '@cld-apis/types'\nimport { clsx } from 'clsx'\nimport { motion, useReducedMotion, type HTMLMotionProps } from 'framer-motion'\nimport { getImgProps, type ImageBuilder } from '~/images.tsx'\nimport { ArrowLink } from '../arrow-button.tsx'\nimport { Grid } from '../grid.tsx'\nimport { H2, H6 } from '../typography.tsx'\nimport { heroTextAnimation } from '~/utils/animations.ts'\n\nexport type HeroSectionProps = {\n title: string | React.ReactNode\n subtitle?: string | React.ReactNode\n smallSubtitle?: string\n action?: React.ReactNode\n animatedTitle?: boolean\n animatedTitleStyles?: string\n as?: React.ElementType\n} & (\n | {\n imageProps?: HTMLMotionProps<'img'>\n imageSize?: 'medium' | 'large' | 'giant'\n image?: never\n imageBuilder?: never\n imageTransformations?: never\n }\n | {\n imageProps?: never\n imageSize?: never\n image?: never\n imageBuilder?: never\n imageTransformations?: never\n }\n | {\n imageProps?: never\n imageSize?: 'medium' | 'large' | 'giant'\n image: React.ReactNode\n imageBuilder?: never\n imageTransformations?: never\n }\n | {\n imageProps?: never\n imageSize?: 'medium' | 'large' | 'giant'\n image?: never\n imageBuilder: ImageBuilder\n imageTransformations?: TransformerOption\n }\n) &\n (\n | {\n arrowUrl: string\n arrowLabel: string\n }\n | {\n arrowUrl?: never\n arrowLabel?: never\n }\n )\n\nfunction HeroSection({\n action,\n title,\n subtitle,\n smallSubtitle,\n arrowUrl,\n arrowLabel,\n image,\n imageProps,\n imageBuilder,\n imageSize = 'medium',\n as = 'header',\n animatedTitle,\n animatedTitleStyles,\n}: HeroSectionProps) {\n const hasImage = Boolean(image ?? imageProps ?? imageBuilder)\n const shouldReduceMotion = useReducedMotion()\n let animationStep = 0\n return (\n <Grid\n as={as}\n className={clsx('lg: mb-24 h-auto pt-24 lg:min-h-[10rem] lg:pb-12', {\n 'lg:mb-64': arrowLabel,\n 'lg:mb-0': !arrowLabel,\n })}\n >\n {hasImage ? (\n <div\n className={clsx('col-span-full mb-12 lg:mb-0', {\n 'px-10 lg:col-span-5 lg:col-start-7': imageSize === 'medium',\n 'flex items-start justify-end lg:col-span-6 lg:col-start-7':\n imageSize === 'large',\n 'flex items-center justify-center lg:col-span-7 lg:col-start-6 lg:-mr-5vw lg:px-0':\n imageSize === 'giant',\n })}\n >\n {imageProps ? (\n <motion.img\n {...imageProps}\n className={clsx(\n 'h-auto w-full object-contain',\n {\n 'max-h-50vh': imageSize === 'medium',\n 'max-h-75vh': imageSize === 'giant',\n },\n imageProps.className,\n )}\n initial={{ scale: shouldReduceMotion ? 1 : 1.5, opacity: 0 }}\n animate={{ scale: 1, opacity: 1 }}\n transition={{ duration: 0.75 }}\n />\n ) : imageBuilder ? (\n <img\n {...getHeroImageProps(imageBuilder, {\n className: clsx(\n 'h-auto w-full object-contain motion-safe:animate-hero-image-reveal rounded-lg',\n {\n 'max-h-50vh': imageSize === 'medium',\n 'max-h-75vh': imageSize === 'giant',\n },\n ),\n })}\n />\n ) : (\n image\n )}\n </div>\n ) : null}\n\n <div\n className={clsx(\n 'col-span-full pt-6 lg:col-start-1 lg:row-start-1 lg:flex lg:h-full lg:flex-col',\n {\n 'lg:col-span-5': hasImage,\n 'lg:col-span-7': !hasImage,\n },\n )}\n >\n <div className=\"flex flex-auto flex-col\">\n <H2\n as=\"h2\"\n className={clsx(\n `motion-safe:animate-hero-text-reveal ${animatedTitleStyles}`,\n {\n 'text-gradient-animated': animatedTitle,\n },\n )}\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {title}\n </H2>\n {subtitle ? (\n <H2\n as=\"p\"\n variant=\"secondary\"\n className=\"mt-3 motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {subtitle}\n </H2>\n ) : null}\n {smallSubtitle ? (\n <H6\n variant=\"secondary\"\n className=\"mt-3 motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {smallSubtitle}\n </H6>\n ) : null}\n {action ? (\n <div\n className=\"mt-14 flex flex-col space-y-4 motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {action}\n </div>\n ) : null}\n </div>\n {arrowUrl ? (\n <div\n className=\"hidden pt-12 lg:block motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n <ArrowLink to={arrowUrl} direction=\"down\" textSize=\"small\">\n {arrowLabel}\n </ArrowLink>\n </div>\n ) : null}\n </div>\n </Grid>\n )\n}\n\nfunction getHeroImageProps(\n imageBuilder: ImageBuilder,\n {\n transformations,\n style,\n className,\n }: {\n transformations?: TransformerOption\n style?: React.CSSProperties\n className?: string\n } = {},\n) {\n return getImgProps(imageBuilder, {\n style,\n className,\n widths: [256, 550, 700, 900, 1300, 1800],\n sizes: [\n '(max-width: 1023px) 80vw',\n '(min-width: 1024px) and (max-width: 1279px) 50vw',\n '(min-width: 1280px) 900px',\n ],\n transformations,\n })\n}\n\nexport { HeroSection, getHeroImageProps }\n"],"names":["isResponse","value","captureRemixErrorBoundaryError","error","isNodeEnv","captureException","r","f","n","o","clsx","LayoutGroupContext","createContext","useConstant","init","ref","useRef","PresenceContext","MotionConfigContext","p","usePresence","subscribe","context","useContext","isPresent","onExitComplete","register","id","useId","useEffect","safeToRemove","useCallback","isBrowser","useIsomorphicLayoutEffect","useLayoutEffect","noop","any","invariant","memo","callback","result","progress","from","to","toFromDifference","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","MotionGlobalConfig","createRenderStep","runNextFrame","thisFrame","nextFrame","isProcessing","flushNextFrame","toKeepAlive","latestFrameData","triggerCallback","step","keepAlive","immediate","queue","frameData","stepsOrder","maxElapsed","createRenderBatcher","scheduleNextBatch","allowKeepAlive","useDefaultElapsed","state","flagRunNextFrame","steps","acc","key","read","resolveKeyframes","update","preRender","render","postRender","processBatch","timestamp","wake","process","i","frame","cancelFrame","frameSteps","LazyContext","featureProps","featureDefinitions","props","name","loadFeatures","features","validMotionProps","isValidMotionProp","shouldForward","loadExternalIsValidProp","isValidProp","filterProps","isDom","forwardMotionProps","filteredProps","createDOMMotionComponentProxy","componentFactory","componentCache","deprecatedFactoryFunction","args","_target","MotionContext","isVariantLabel","v","isAnimationControls","variantPriorityOrder","variantProps","isControllingVariants","isVariantNode","getCurrentTreeVariants","initial","animate","useCreateMotionContext","useMemo","variantLabelsAsDependency","prop","motionComponentSymbol","isRefObject","useMotionRef","visualState","visualElement","externalRef","instance","camelToDash","str","optimizedAppearDataId","optimizedAppearDataAttribute","microtask","SwitchLayoutGroupContext","useVisualElement","Component","createVisualElement","ProjectionNodeConstructor","_a","_b","parent","lazyContext","presenceContext","reducedMotionConfig","visualElementRef","initialLayoutGroupConfig","createProjectionNode","isMounted","useInsertionEffect","optimisedAppearId","wantsHandoff","initialPromotionConfig","layoutId","layout","drag","dragConstraints","layoutScroll","layoutRoot","getClosestProjectingNode","createRendererMotionComponent","preloadedFeatures","useRender","useVisualState","MotionComponent","MeasureLayout","configAndProps","useLayoutId","isStatic","useStrictMode","layoutProjection","getProjectionFunctionality","jsxs","jsx","ForwardRefMotionComponent","forwardRef","layoutGroupId","combined","lowercaseSVGElements","isSVGComponent","getValueState","resolveVariantFromProps","definition","custom","current","velocity","isKeyframesTarget","isCustomValue","resolveFinalValueInKeyframes","isMotionValue","resolveMotionValue","unwrappedValue","makeState","scrapeMotionValuesFromProps","createRenderState","onUpdate","makeLatestValues","makeUseVisualState","config","make","scrapeMotionValues","values","motionValues","isControllingVariants$1","isVariantNode$1","isInitialAnimationBlocked","variantToSet","list","resolved","transitionEnd","transition","target","valueTarget","index","transformPropOrder","transformProps","checkStringStartsWith","token","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","getValueAsType","type","clamp","min","max","number","alpha","scale","createUnitType","unit","degrees","percent","px","vh","vw","progressPercentage","browserNumberValueTypes","transformValueTypes","int","numberValueTypes","translateAlias","numTransforms","buildTransform","latestValues","transform","transformTemplate","transformString","transformIsDefault","valueIsDefault","valueAsType","transformName","buildHTMLStyles","style","vars","transformOrigin","hasTransform","hasTransformOrigin","originX","originY","originZ","dashKeys","camelKeys","buildSVGPath","attrs","length","spacing","offset","useDashCase","keys","pathLength","pathSpacing","calcOrigin","origin","size","calcSVGTransformOrigin","dimensions","pxOriginX","pxOriginY","buildSVGAttrs","attrX","attrY","attrScale","pathOffset","latest","isSVGTag","createHtmlRenderState","createSvgRenderState","tag","renderHTML","element","styleProp","projection","camelCaseAttributes","renderSVG","renderState","_styleProp","scaleCorrectors","addScaleCorrector","correctors","isForcedMotionValue","prevProps","newValues","scrapeMotionValuesFromProps$1","targetKey","updateSVGDimensions","layoutProps","svgMotionConfig","needsMeasure","htmlMotionConfig","copyRawValuesOnly","source","useInitialMotionValues","useStyle","useHTMLProps","htmlProps","useSVGProps","_isStatic","visualProps","rawStyles","createUseRender","elementProps","Fragment","children","renderedChildren","createElement","createMotionComponentFactory","shallowCompare","next","prev","prevLength","resolveVariant","supportsScrollTimeline","BaseGroupPlaybackControls","animations","animation","propName","newValue","timeline","fallback","subscriptions","cancel","time","speed","methodName","controls","GroupPlaybackControls","onResolve","onReject","getValueTransition","maxGeneratorDuration","calcGeneratorDuration","generator","duration","timeStep","isGenerator","attachTimeline","isBezierDefinition","easing","supportsFlags","memoSupports","supportsFlag","memoized","supportsLinearEasing","generateLinearEasing","resolution","points","numPoints","isWaapiSupportedEasing","supportedWaapiEasing","cubicBezierAsString","a","b","c","d","mapEasingToNativeEasing","segmentEasing","isDragging","isDragActive","resolveElements","elementOrSelector","scope","selectorCache","root","elements","setupGesture","options","gestureAbortController","eventOptions","filterEvents","event","hover","onHoverStart","onPointerEnter","enterEvent","onHoverEnd","onPointerLeave","leaveEvent","isNodeOrChild","child","isPrimaryPointer","focusableElements","isElementKeyboardAccessible","isPressing","firePointerEvent","enableKeyboardPress","focusEvent","handleKeydown","handleKeyup","handleBlur","isValidPressEvent","press","onPressStart","cancelEvents","startPress","startEvent","onPressEnd","onPointerEnd","endEvent","success","onPointerUp","onPointerCancel","upEvent","cancelEvent","setDragLock","axis","positionalKeys","now","clearTime","newTime","addUniqueItem","arr","item","removeItem","SubscriptionManager","handler","numSubscriptions","velocityPerSecond","frameDuration","MAX_VELOCITY_DELTA","isFloat","MotionValue","currentTime","prevFrameValue","subscription","eventName","unsubscribe","eventManagers","passiveEffect","stopPassiveEffect","delta","endAnimation","startAnimation","resolve","motionValue","setMotionValue","setTarget","isWillChangeMotionValue","addValueToWillChange","willChange","getOptimisedAppearId","calcBezier","t","a1","a2","subdivisionPrecision","subdivisionMaxIterations","binarySubdivide","x","lowerBound","upperBound","mX1","mX2","currentX","currentT","cubicBezier","mY1","mY2","getTForX","aX","mirrorEasing","reverseEasing","backOut","backIn","backInOut","anticipate","circIn","circOut","circInOut","isZeroValueString","isNone","sanitize","floatRegex","isNullish","singleColorRegex","isColorString","testProp","splitColor","aName","bName","cName","clampRgbUnit","rgbUnit","rgba","red","green","blue","alpha$1","parseHex","g","hex","hsla","hue","saturation","lightness","color","colorRegex","test","NUMBER_TOKEN","COLOR_TOKEN","VAR_TOKEN","VAR_FUNCTION_TOKEN","SPLIT_TOKEN","complexRegex","analyseComplexValue","originalValue","indexes","types","split","parsedValue","parseComplexValue","createTransformer","numSections","output","convertNumbersToZero","getAnimatableNone","parsed","complex","maxDefaults","applyDefaultFilter","defaultValue","functionRegex","filter","functions","defaultValueTypes","getDefaultValueType","defaultValueType","invalidTemplates","makeNoneKeyframesAnimatable","unresolvedKeyframes","noneKeyframeIndexes","animatableTemplate","keyframe","noneIndex","isNumOrPxType","getPosFromMatrix","matrix","pos","getTranslateFromMatrix","pos2","pos3","_bbox","matrix3d","transformKeys","nonTranslationalTransformKeys","removeNonTranslationalTransform","removedTransforms","positionalValues","paddingLeft","paddingRight","y","paddingTop","paddingBottom","top","left","toResolve","isScheduled","anyNeedsMeasurement","measureAllKeyframes","resolversToMeasure","resolver","elementsToMeasure","transformsToRestore","restore","readAllKeyframes","flushKeyframeResolvers","KeyframeResolver","onComplete","isAsync","currentValue","finalKeyframe","valueAsRead","isNumericalString","splitCSSVariableRegex","parseCSSVariable","match","token1","token2","getVariableValue","depth","trimmed","testValueType","auto","dimensionValueTypes","findDimensionValueType","DOMKeyframesResolver","originType","targetType","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","isAnimatable","hasKeyframesChanged","keyframes","canAnimate","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","isNotNull","getFinalKeyframe","repeat","repeatType","resolvedKeyframes","MAX_RESOLVE_DELAY","BaseAnimation","autoplay","delay","repeatDelay","resolvedAnimation","reject","mixNumber","hueToRgb","q","hslaToRgba","mixImmediate","mixLinearColor","fromExpo","expo","colorTypes","getColorType","asRGBA","model","mixColor","fromRGBA","toRGBA","blended","combineFunctions","pipe","transformers","invisibleValues","mixVisibility","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","matchOrder","orderedOrigin","pointers","originIndex","originValue","template","originStats","targetStats","mix","velocitySampleDuration","calcGeneratorVelocity","resolveValue","prevT","springDefaults","safeMin","findSpring","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","calcAngularFreq","e","initialGuess","approximateRoot","stiffness","rootIterations","durationKeys","physicsKeys","isSpringType","getSpringOptions","springOptions","visualDuration","damping","derived","spring","optionsOrVisualDuration","restSpeed","restDelta","isResolvedFromDuration","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","dampedAngularFreq","freqForT","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","calculatedDuration","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","isOutOfBounds","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","easeIn","easeOut","easeInOut","isEasingArray","ease","easingLookup","easingDefinitionToFunction","x1","y1","x2","y2","createMixers","customMixer","mixers","mixerFactory","numMixers","mixer","easingFunction","interpolate","input","isClamp","inputLength","isZeroDeltaRange","interpolator","progressInRange","fillOffset","remaining","offsetProgress","defaultOffset","convertOffsetToTimes","defaultEasing","keyframeValues","times","easingFunctions","absoluteTimes","mapTimeToKeyframe","frameloopDriver","passTimestamp","generators","percentToProgress","MainThreadAnimation","onStop","KeyframeResolver$1","onResolved","keyframes$1","generatorFactory","mapPercentToKeyframes","mirroredGenerator","resolvedDuration","totalDuration","sample","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","iterationProgress","done","isAnimationFinished","newSpeed","hasChanged","driver","onPlay","startTime","acceleratedValues","startWaapiAnimation","valueName","keyframeOptions","supportsWaapi","sampleDelta","maxDuration","requiresPregeneratedKeyframes","pregenerateKeyframes","sampleAnimation","pregeneratedKeyframes","unsupportedEasingFunctions","isUnsupportedEase","AcceleratedAnimation","pregeneratedAnimation","sampleTime","underDampedSpring","criticallyDampedSpring","keyframesTransition","getDefaultTransition","valueKey","isTransitionDefined","when","_delay","delayChildren","staggerChildren","staggerDirection","animateMotionValue","isHandoff","valueTransition","shouldSkip","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","animationTypeState","appearId","animateVariant","variant","getAnimation","getChildAnimations","forwardDelay","animateChildren","first","last","maxStaggerDuration","generateStaggerDuration","sortByTreeOrder","animateVisualElement","resolvedDefinition","numVariantProps","getVariantContext","reversePriorityOrder","numAnimationTypes","animateList","createAnimationState","createState","isInitialRender","buildResolvedTypeValues","setAnimateFunction","makeAnimator","animateChanges","changedActiveType","removedKeys","encounteredKeys","removedVariantIndex","typeState","propIsVariant","activeDelta","isInherited","variantDidChange","checkVariantsDidChange","shouldAnimateType","handledRemovedValues","definitionList","resolvedValues","prevResolvedValues","allKeys","markToAnimate","valueHasChanged","fallbackAnimation","fallbackTarget","shouldAnimate","setActive","isActive","createTypeState","Feature","node","AnimationFeature","prevAnimate","ExitAnimationFeature","prevIsPresent","exitAnimation","addDomEvent","extractEventInfo","addPointerInfo","addPointerEvent","distance","distance2D","xDelta","yDelta","PanSession","handlers","transformPagePoint","contextWindow","dragSnapToOrigin","info","getPanInfo","isPanStarted","isDistancePastThreshold","point","onStart","onMove","transformPoint","onEnd","onSessionEnd","resumeAnimation","panInfo","initialInfo","onSessionStart","subtractPoint","history","lastDevicePoint","startDevicePoint","getVelocity","timeDelta","timestampedPoint","lastPoint","SCALE_PRECISION","SCALE_MIN","SCALE_MAX","TRANSLATE_PRECISION","TRANSLATE_MIN","TRANSLATE_MAX","calcLength","isNear","maxDistance","calcAxisDelta","calcBoxDelta","calcRelativeAxis","relative","calcRelativeBox","calcRelativeAxisPosition","calcRelativePosition","applyConstraints","elastic","calcRelativeAxisConstraints","calcRelativeConstraints","layoutBox","bottom","right","calcViewportAxisConstraints","layoutAxis","constraintsAxis","calcViewportConstraints","constraintsBox","sourceLength","targetLength","rebaseAxisConstraints","constraints","relativeConstraints","defaultElastic","resolveDragElastic","dragElastic","resolveAxisElastic","minLabel","maxLabel","resolvePointElastic","label","createAxisDelta","createDelta","createAxis","createBox","eachAxis","convertBoundingBoxToBox","convertBoxToBoundingBox","transformBoxPoints","topLeft","bottomRight","isIdentityScale","hasScale","scaleX","scaleY","has2DTranslate","is2DTranslate","scalePoint","originPoint","distanceFromOrigin","scaled","applyPointDelta","translate","boxScale","applyAxisDelta","applyBoxDelta","box","TREE_SCALE_SNAP_MIN","TREE_SCALE_SNAP_MAX","applyTreeDeltas","treeScale","treePath","isSharedTransition","treeLength","transformBox","translateAxis","transformAxis","axisTranslate","axisScale","axisOrigin","measureViewportBox","measurePageBox","rootProjectionNode","viewportBox","scroll","getContextWindow","elementDragControls","VisualElementDragControls","originEvent","snapToCursor","dragPropagation","onDragStart","measuredAxis","animationState","dragDirectionLock","onDirectionLock","onDrag","getCurrentDirection","onDragEnd","_point","shouldDrag","axisValue","prevConstraints","onMeasureDragConstraints","constraintsElement","measuredConstraints","userConstraints","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","dragKey","externalMotionValue","boxProgress","stopPointerListener","dragListener","measureDragConstraints","stopMeasureLayoutListener","stopResizeListener","stopLayoutUpdateListener","hasLayoutChanged","direction","currentDirection","lockThreshold","DragGesture","dragControls","asyncHandler","PanGesture","pointerDownEvent","onPanSessionStart","onPanStart","onPan","onPanEnd","globalProjectionState","pixelsToPercent","pixels","correctBorderRadius","correctBoxShadow","projectionDelta","original","shadow","xScale","yScale","averageScale","MeasureLayoutWithContext","layoutGroup","switchLayoutGroup","defaultScaleCorrectors","layoutDependency","stack","promoteContext","animateSingleValue","motionValue$1","isSVGElement","compareByDepth","FlatTree","timeout","start","checkElapsed","borders","numBorders","asNumber","isPx","mixValues","follow","lead","shouldCrossfadeOpacity","isOnlyMember","easeCrossfadeIn","easeCrossfadeOut","borderLabel","followRadius","getRadius","leadRadius","radiusName","compress","copyAxisInto","originAxis","copyBoxInto","originBox","copyAxisDeltaInto","originDelta","removePointDelta","removeAxisDelta","sourceAxis","removeAxisTransforms","transforms","scaleKey","originKey","xKeys","yKeys","removeBoxTransforms","sourceBox","isAxisDeltaZero","isDeltaZero","axisEquals","boxEquals","axisEqualsRounded","boxEqualsRounded","aspectRatio","axisDeltaEquals","NodeStack","prevLead","indexOfNode","member","preserveFollowOpacity","crossfade","resumingFrom","buildProjectionTransform","latestTransform","xTranslate","yTranslate","zTranslate","transformPerspective","rotate","rotateX","rotateY","skewX","skewY","elementScaleX","elementScaleY","metrics","isDebug","transformAxes","hiddenVisibility","animationTarget","resetDistortingTransform","sharedAnimationValues","cancelTreeOptimisedTransformAnimations","projectionNode","attachResizeListener","defaultParent","measureScroll","checkIsScrollRoot","resetTransform","propagateDirtyNodes","resolveTargetDelta","calcProjection","cleanDirtyNodes","subscriptionManager","isLayoutDirty","cancelDelay","resizeUnblockUpdate","finishAnimation","hasRelativeTargetChanged","newLayout","layoutTransition","defaultLayoutTransition","onLayoutAnimationStart","onLayoutAnimationComplete","targetChanged","hasOnlyRelativeTargetChanged","animationOptions","resetSkewAndRotation","shouldNotifyListeners","clearMeasurements","clearIsLayoutDirty","resetTransformStyle","updateLayout","notifyLayoutUpdate","clearSnapshot","removeLeadSnapshots","prevLayout","phase","needsMeasurement","isRoot","isResetRequested","hasProjection","transformTemplateValue","transformTemplateHasChanged","removeTransform","pageBox","roundBox","checkNodeWasScrollRoot","boxWithoutScroll","transformOnly","withTransforms","boxWithoutTransform","nodeBox","forceRecalculation","isShared","relativeParent","canSkip","prevTreeScaleX","prevTreeScaleY","notifyAll","snapshot","snapshotLatestValues","mixedValues","targetDelta","relativeLayout","snapshotSource","layoutSource","isSharedLayoutAnimation","hasOpacityCrossfade","prevRelativeTarget","mixAxisDelta","mixBox","targetWithTransforms","shouldAnimatePositionOnly","xLength","yLength","needsReset","hasDistortingTransform","resetValues","styles","emptyStyles","valuesToRender","correct","applyTo","corrected","num","measuredLayout","animationType","axisSnapshot","layoutDelta","visualDelta","parentSnapshot","parentLayout","relativeSnapshot","mixAxis","userAgentContains","string","roundPoint","roundAxis","DocumentProjectionNode","notify","HTMLProjectionNode","documentNode","handleHoverEvent","lifecycle","HoverGesture","FocusGesture","isFocusVisible","handlePressEvent","PressGesture","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","entries","initIntersectionObserver","lookupRoot","rootObservers","observeIntersection","rootInteresectionObserver","thresholdNames","InViewFeature","viewport","rootMargin","amount","once","onIntersectionUpdate","isIntersecting","onViewportEnter","onViewportLeave","hasViewportOptionChanged","prevViewport","gestureAnimations","prefersReducedMotion","hasReducedMotionListener","initPrefersReducedMotion","motionMediaQuery","setReducedMotionPreferences","valueTypes","findValueType","visualElementStore","updateMotionValuesFromProps","nextValue","prevValue","existingValue","latestValue","propEventHandlers","VisualElement","_props","_prevProps","_visualElement","blockInitialAnimation","initialMotionValues","remove","feature","valueIsTransform","removeOnChange","removeOnRenderRequest","removeSyncCheck","other","featureDefinition","isEnabled","FeatureConstructor","listenerName","listener","closestVariantNode","valueFromInitial","DOMVisualElement","getComputedStyle","HTMLVisualElement","defaultType","computedStyle","SVGVisualElement","createDomVisualElement","createMotionComponent","motion","useReducedMotion","shouldReduceMotion","useState","useElementState","setState","setRef","el","pointerenter","s","pointerleave","focus","blur","pointerdown","pointerup","keydown","keyup","status","arrowRotationMap","ArrowIcon","className","CheckIcon","CopyIcon","GithubIcon","title","LaptopIcon","MoonIcon","PlusIcon","RssIcon","SearchIcon","SunIcon","fontSize","titleColors","Title","as","rest","Tag","H2","H3","H4","H6","Paragraph","prose","textColorClassName","React.createElement","arrowVariants","getBaseProps","textSize","ArrowButtonContent","MotionLink","Link","ArrowLink","href","BackLink","ConditionOperators","STORAGE_TYPES","RESOURCE_TYPES","ValueAssignable","SEO_TYPES","TRANSFORMERS","ArithmeticExpression","PredefinedVariables","PreDefinedPatterns","AcceptNumbericVars","ConditionalParams","toString","separation","computeCondition","conditionObj","expression","exp","computeConditionExpression","transformations","transformation","toTransformationStr","mapCharacteristic","characteristic","operator","condition","ifCondition","elseCondition","formattedIf","formattedElse","effect","obj","isString","effectValue","Prefix","Formats","OPERATORS_REGEX","mapArithmeticExpression","orgExpression","regex","mapPredefinedVariables","formatValue","convert","mappedArithmetic","converted","hasArithmeticExpression","flags","flagValue","rawTransformation","convertStringValueType","isArithmetic","convertedExpression","format","mappedExpression","computeVariable","variable","varValue","variables","fps","isObj","range","end","resize","width","height","w","h","crop","ar","border","_c","formattedValue","position","xAxis","yAxis","getResize","hasResize","getBorder","borderModification","getPosition","getTransformations","modifier","mapping","isAcceptedNumberic","chainedTransformations","chained","chainedTransformation","isChained","__assign","SHARED_CDNS","CLOUDINARY_REGEX","extractPublicId","link","parts","getSignature","signature","isFormatted","doesPathNeedVersion","publicId","encodePublicId","getVersion","forceVersion","version","needVersion","getSubDomain","cdnSubdomain","cname","getPrefix","cloudName","privateCdn","secureDistribution","_d","secure","hasSecureDistribution","protocol","cdn","accountPath","subDomain","host","getResourceType","resourceType","storageType","urlSuffix","useRootPath","shortern","isUploadImage","useRootForNonUploadedImages","shortenForUploadedImages","typePath","seo","isUrl","getPathToAsset","path","url","cloud","_publicId","prefix","pathToAsset","$options","trans","setConfig","buildUrl","cloudConfig","buildImageUrl","emojiRegex","dist","md5","L","k","K","G","I","F","H","aa","Z","D","B","J","C","P","E","Y","X","W","V","S","Q","N","M","A","z","m","l","j","U","T","R","O","AnchorOrLink","React.forwardRef","download","reload","prefetch","toUrl","shouldUserRegularAnchor","formatNumber","getErrorMessage","typedBoolean","removeTrailingSlash","getDisplayUrl","requestInfo","getUrl","getOrigin","toBase64","useUpdateQueryStringValueWithoutNavigation","queryKey","queryValue","React.useEffect","currentSearchParams","oldQuery","newUrl","message","useCapturedRouteError","useRouteError","isObject","Config","userProvidedConfig","validKeys","ALLOWED_URL_CONFIG","URLConfig","userURLConfig","urlConfig","params","QualifierValue","qualifierValue","delimiter","UnsupportedError","createUnsupportedError","qualifierToJson","QualifierModel","Qualifier","FlagQualifier","flagType","mapToSortedArray","map","array","flag","actionToJson","actionModelIsNotEmpty","sourceTransformationError","ActionModel","Action","qualifier","qualifierKey","prepareColor","BackgroundColor","actionModel","RawAction","raw","isErrorObject","errorObj","lossy","preserveTransparency","progressive","mode","FormatQualifier","val","objectFlip","ACTION_TYPE_TO_CROP_MODE_MAP","ACTION_TYPE_TO_DELIVERY_MODE_MAP","ACTION_TYPE_TO_EFFECT_MODE_MAP","ACTION_TYPE_TO_QUALITY_MODE_MAP","ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP","CHROMA_VALUE_TO_CHROMA_MODEL_ENUM","COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP","DELIVERY_MODE_TO_ACTION_TYPE_MAP","DeliveryAction","deliveryKey","deliveryType","modelProperty","deliveryTypeValue","ProgressiveQualifier","DeliveryFormatAction","formatType","Transformation","action","actionToAdd","tx","animatedAction","borderAction","reshapeAction","resizeAction","quality","roundCornersAction","overlayAction","underlayAction","variableAction","conditionAction","effectAction","rotateAction","namedTransformation","deliveryAction","flagQualifier","flagToAdd","customFunction","actions","json","ImageTransformation","VideoTransformation","publicID","isFileName","publicIDContainsVersion","getUrlPrefix","privateCDN","handleAssetType","assetType","handleDeliveryType","getUrlVersion","shouldForceVersion","stringPad","_targetLength","_padString","padString","repeatStringNumTimes","_times","repeatedString","chars","base64Map","char","reverseVersion","semVer","padVersion","segment","encodeVersion","strResult","paddedStringLength","reversedSemver","paddedSemver","paddedBinary","bitString","getAnalyticsOptions","analyticsOptions","packageVersion","encodeOSVersion","major","minor","binaryMajorVersion","binaryMinorVersion","paddedMajor","paddedMinor","getNodeVersion","failedVersion","ensureShapeOfTrackedProperties","trackedAnalytics","defaults","getSDKAnalyticsSignature","_trackedAnalytics","twoPartVersion","removePatchFromSemver","encodedSDKVersion","encodedTechVersion","encodedOSVersion","featureCode","SDKCode","product","osType","semVerStr","CloudinaryFile","newType","newSuffix","newVersion","overwriteOptions","suffixContainsDot","suffixContainsSlash","hasSuffix","regularSEOType","shortSEOType","shorten","transformationString","safeURL","shouldAddAnalytics","queryParamsString","queryParams","CloudinaryTransformable","animated","reshape","roundCorners","conditionalAction","CloudinaryImage","CloudinaryVideo","Cloudinary","cloudinaryConfig","cloudinaryInstance","createImages","images","imageBuilders","alt","getImageBuilder","imageBuilder","square","getImgProps","widths","sizes","averageSize","getSocialImageWithPreTitle","preTitle","img","preTitleSection","doubleEncode","emojiStrip","titleSection","featuredImageIsRemote","featuredImageCloudinaryId","featuredImageSection","getGenericSocialImage","words","primaryWordsSection","featureImageSection","Grid","featured","nested","rowGap","generateAnimation","visible","getVariables","activeStep","heroTextAnimation","HeroSection","subtitle","smallSubtitle","arrowUrl","arrowLabel","image","imageProps","imageSize","animatedTitle","animatedTitleStyles","hasImage","animationStep","getHeroImageProps"],"mappings":"oHA2BA,SAASA,GAAWC,EAAO,CACzB,OACEA,GAAS,MAET,OAAOA,EAAM,QAAW,UACxB,OAAOA,EAAM,YAAe,UAC5B,OAAOA,EAAM,SAAY,UACzB,OAAOA,EAAM,KAAS,GAG1B,CC5BA,SAASC,GAA+BC,EAAO,CAU7C,GAAI,EAAAH,GAAWG,CAAK,GAAKC,GAAW,GAAI,EAAED,aAAiB,QAI3D,OAAOE,GAAiBF,EAAO,CAC7B,UAAW,CACT,KAAM,aACN,QAAS,GACT,KAAM,CACJ,SAAU,YACX,CACF,CACL,CAAG,CACH,CChCA,SAASG,GAAE,EAAE,CAAC,IAAI,EAAEC,EAAEC,EAAE,GAAG,GAAa,OAAO,GAAjB,UAA8B,OAAO,GAAjB,SAAmBA,GAAG,UAAoB,OAAO,GAAjB,SAAmB,GAAG,MAAM,QAAQ,CAAC,EAA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AA,MAAA,CAAI,UAAU,0BACb,SAAA,CAAAC,EAAA,IAACyqC,GAAA,CACC,GAAG,KACH,UAAWh1C,EACT,wCAAwCiwD,CAAmB,GAC3D,CACE,yBAA0BD,CAAA,CAE9B,EACA,MAAOT,GAAkB,aAAaY,GAAe,EAEpD,SAAAhc,CAAA,CACH,EACCsb,EACCllD,EAAA,IAACyqC,GAAA,CACC,GAAG,IACH,QAAQ,YACR,UAAU,4CACV,MAAOua,GAAkB,aAAaY,GAAe,EAEpD,SAAAV,CAAA,CAAA,EAED,KACHC,EACCnlD,EAAA,IAAC4qC,GAAA,CACC,QAAQ,YACR,UAAU,4CACV,MAAOoa,GAAkB,aAAaY,GAAe,EAEpD,SAAAT,CAAA,CAAA,EAED,KACHhJ,EACCn8C,EAAA,IAAC,MAAA,CACC,UAAU,qEACV,MAAOglD,GAAkB,aAAaY,GAAe,EAEpD,SAAAzJ,CAAA,CAAA,EAED,IAAA,EACN,EACCiJ,EACCplD,EAAA,IAAC,MAAA,CACC,UAAU,6DACV,MAAOglD,GAAkB,aAAaY,GAAe,EAErD,SAAA5lD,EAAA,IAACurC,IAAU,GAAI6Z,EAAU,UAAU,OAAO,SAAS,QAChD,SACHC,CAAA,CAAA,CAAA,CAAA,EAEA,IAAA,CAAA,CAAA,CACN,CAAA,CACF,CAEJ,CAEA,SAASQ,GACPzC,EACA,CACE,gBAAAxW,EACA,MAAA3nC,EACA,UAAAukC,CACF,EAII,GACJ,CACA,OAAO8Z,GAAYF,EAAc,CAC/B,MAAAn+C,EACA,UAAAukC,EACA,OAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,KAAM,IAAI,EACvC,MAAO,CACL,2BACA,mDACA,2BACF,EACA,gBAAAoD,CAAA,CACD,CACH","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319]}