+ Double-check everything before creating your pool on the Stellar network.
+
+
+
+ {/* Basic Info Card */}
+
+
+
+ 1
+
+
Basic Information
+
+
+
+
+
+
+
+
+
+
+
+ {/* Financials Card */}
+
+
+
+ 2
+
+
Financial Details
+
+
+
+
+
+
+
+
+
+ {/* Confirmation note */}
+
+
+
+ By submitting, you confirm that all information is accurate. The pool will be
+ registered on the Stellar blockchain and cannot be altered after creation.
+
+
+
+ );
+}
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
new file mode 100644
index 0000000..3c99b38
--- /dev/null
+++ b/node_modules/.package-lock.json
@@ -0,0 +1,55 @@
+{
+ "name": "Nevo",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "node_modules/framer-motion": {
+ "version": "12.34.3",
+ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.34.3.tgz",
+ "integrity": "sha512-v81ecyZKYO/DfpTwHivqkxSUBzvceOpoI+wLfgCgoUIKxlFKEXdg0oR9imxwXumT4SFy8vRk9xzJ5l3/Du/55Q==",
+ "license": "MIT",
+ "dependencies": {
+ "motion-dom": "^12.34.3",
+ "motion-utils": "^12.29.2",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "@emotion/is-prop-valid": "*",
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@emotion/is-prop-valid": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ },
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/motion-dom": {
+ "version": "12.34.3",
+ "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.34.3.tgz",
+ "integrity": "sha512-sYgFe+pR9aIM7o4fhs2aXtOI+oqlUd33N9Yoxcgo1Fv7M20sRkHtCmzE/VRNIcq7uNJ+qio+Xubt1FXH3pQ+eQ==",
+ "license": "MIT",
+ "dependencies": {
+ "motion-utils": "^12.29.2"
+ }
+ },
+ "node_modules/motion-utils": {
+ "version": "12.29.2",
+ "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.29.2.tgz",
+ "integrity": "sha512-G3kc34H2cX2gI63RqU+cZq+zWRRPSsNIOjpdl9TN4AQwC4sgwYPl/Q/Obf/d53nOm569T0fYK+tcoSV50BWx8A==",
+ "license": "MIT"
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "license": "0BSD"
+ }
+ }
+}
diff --git a/node_modules/framer-motion/LICENSE.md b/node_modules/framer-motion/LICENSE.md
new file mode 100644
index 0000000..b5b8d6a
--- /dev/null
+++ b/node_modules/framer-motion/LICENSE.md
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Framer B.V.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/framer-motion/README.md b/node_modules/framer-motion/README.md
new file mode 100644
index 0000000..da28390
--- /dev/null
+++ b/node_modules/framer-motion/README.md
@@ -0,0 +1,143 @@
+
Motion for React
+
+ An open source animation library for React
+
+
+
+
+
+
+
+
+
+```bash
+npm install motion
+```
+
+## Table of Contents
+
+1. [Why Motion?](#why-motion)
+2. [🍦 Platforms](#-platforms)
+3. [🎓 Examples](#-examples)
+4. [⚡️ Motion+](#-motion)
+5. [👩🏻⚖️ License](#-license)
+6. [💎 Contribute](#-contribute)
+7. [✨ Sponsors](#-sponsors)
+
+## Why Motion?
+
+- **Simple API:** First-class React, JavaScript, and Vue packages.
+- **Hybrid engine:** Power of JavaScript combined with native browser APIs for 120fps, GPU-accelerated animations.
+- **Production-ready:** TypeScript, extensive test suite, tree-shakable, tiny footprint.
+ **Batteries included:** Gestures, springs, layout transitions, scroll-linked effects, timelines.
+
+## 🍦 Platforms
+
+Motion is available for [React](https://motion.dev/docs/react), [JavaScript](https://motion.dev/docs/quick-start) and [Vue](https://motion.dev/docs/vue).
+
+
+React
+
+```jsx
+import { motion } from "motion/react"
+
+function Component() {
+ return
+}
+```
+
+Get started with [Motion for React](https://motion.dev/docs/react).
+
+
+
+
+JavaScript
+
+```javascript
+import { animate } from "motion"
+
+animate("#box", { x: 100 })
+```
+
+Get started with [JavaScript](https://motion.dev/docs/quick-start).
+
+
+
+
+Vue
+
+```html
+
+
+
+```
+
+Get started with [Motion for Vue](https://motion.dev/docs/vue).
+
+
+
+## 🎓 Examples
+
+Browse 100+ free and 180+ premium [Motion Examples](https://motion.dev/examples), with copy-paste code that'll level-up your animations whether you're a beginner or an expert.
+
+## ⚡️ Motion+
+
+A one-time payment, lifetime-updates membership:
+
+- **180+ premium examples**
+- **Premium APIs** like [Cursor](https://motion.dev/docs/cursor) and [Ticker](https://motion.dev/docs/react-ticker)
+- **Visual editing** for VS Code (alpha)
+- **Private Discord**
+- **Early access content**
+
+[Get Motion+](https://motion.dev/plus)
+
+## 👩🏻⚖️ License
+
+- Motion is MIT licensed.
+
+## 💎 Contribute
+
+- Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered.
+
+## ✨ Sponsors
+
+Motion is sustainable thanks to the kind support of its sponsors.
+
+[Become a sponsor](https://motion.dev/sponsor)
+
+### Partners
+
+Motion powers the animations for all websites built with Framer, the web builder for creative pros. The Motion website itself is built on Framer, for its delightful canvas-based editing and powerful CMS features.
+
+
+
+
+
+Motion drives the animations on the Cursor homepage, and is working with Cursor to bring powerful AI workflows to the Motion examples and docs.
+
+
+
+
+
+### Platinum
+
+
+
+
+### Gold
+
+
+
+### Silver
+
+
+
+### Personal
+
+- [OlegWock](https://sinja.io)
+- [Lambert Weller](https://github.com/l-mbert)
+- [Jake LeBoeuf](https://jklb.wf)
+- [Han Lee](https://github.com/hahnlee)
diff --git a/node_modules/framer-motion/client/README.md b/node_modules/framer-motion/client/README.md
new file mode 100644
index 0000000..00af8b4
--- /dev/null
+++ b/node_modules/framer-motion/client/README.md
@@ -0,0 +1 @@
+This directory is a fallback for `exports["./client"]` in the root `framer-motion` `package.json`.
diff --git a/node_modules/framer-motion/client/package.json b/node_modules/framer-motion/client/package.json
new file mode 100644
index 0000000..ed702d3
--- /dev/null
+++ b/node_modules/framer-motion/client/package.json
@@ -0,0 +1,6 @@
+{
+ "private": true,
+ "types": "../dist/types/client.d.ts",
+ "main": "../dist/cjs/client.js",
+ "module": "../dist/es/client.mjs"
+}
diff --git a/node_modules/framer-motion/dist/cjs/client.js b/node_modules/framer-motion/dist/cjs/client.js
new file mode 100644
index 0000000..959fd5f
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/client.js
@@ -0,0 +1,369 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var featureBundle = require('./feature-bundle-CUI5saed.js');
+require('motion-dom');
+require('react');
+require('react/jsx-runtime');
+require('motion-utils');
+
+function createMotionComponentWithFeatures(Component, options) {
+ return featureBundle.createMotionComponent(Component, options, featureBundle.featureBundle, featureBundle.createDomVisualElement);
+}
+
+/**
+ * HTML components
+ */
+const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a");
+const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr");
+const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address");
+const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area");
+const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article");
+const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside");
+const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio");
+const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b");
+const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base");
+const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi");
+const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo");
+const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big");
+const MotionBlockquote =
+/*@__PURE__*/ createMotionComponentWithFeatures("blockquote");
+const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body");
+const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button");
+const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas");
+const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption");
+const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite");
+const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code");
+const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col");
+const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup");
+const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data");
+const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist");
+const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd");
+const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del");
+const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details");
+const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn");
+const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog");
+const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div");
+const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl");
+const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt");
+const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em");
+const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed");
+const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset");
+const MotionFigcaption =
+/*@__PURE__*/ createMotionComponentWithFeatures("figcaption");
+const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure");
+const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer");
+const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form");
+const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1");
+const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2");
+const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3");
+const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4");
+const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5");
+const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6");
+const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head");
+const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header");
+const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup");
+const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr");
+const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html");
+const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i");
+const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe");
+const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img");
+const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input");
+const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins");
+const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd");
+const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen");
+const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label");
+const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend");
+const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li");
+const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link");
+const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main");
+const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map");
+const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark");
+const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu");
+const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem");
+const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter");
+const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav");
+const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object");
+const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol");
+const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup");
+const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option");
+const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output");
+const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p");
+const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param");
+const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture");
+const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre");
+const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress");
+const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q");
+const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp");
+const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt");
+const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby");
+const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s");
+const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp");
+const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script");
+const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section");
+const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select");
+const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small");
+const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source");
+const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span");
+const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong");
+const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style");
+const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub");
+const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary");
+const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup");
+const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table");
+const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody");
+const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td");
+const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea");
+const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot");
+const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th");
+const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead");
+const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time");
+const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title");
+const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr");
+const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track");
+const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u");
+const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul");
+const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video");
+const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr");
+const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview");
+/**
+ * SVG components
+ */
+const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate");
+const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle");
+const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs");
+const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc");
+const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse");
+const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g");
+const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image");
+const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line");
+const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter");
+const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker");
+const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask");
+const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata");
+const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path");
+const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern");
+const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon");
+const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline");
+const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect");
+const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop");
+const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg");
+const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol");
+const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text");
+const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan");
+const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use");
+const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view");
+const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath");
+const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend");
+const MotionFeColorMatrix =
+/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix");
+const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer");
+const MotionFeComposite =
+/*@__PURE__*/ createMotionComponentWithFeatures("feComposite");
+const MotionFeConvolveMatrix =
+/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix");
+const MotionFeDiffuseLighting =
+/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting");
+const MotionFeDisplacementMap =
+/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap");
+const MotionFeDistantLight =
+/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight");
+const MotionFeDropShadow =
+/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow");
+const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood");
+const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA");
+const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB");
+const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG");
+const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR");
+const MotionFeGaussianBlur =
+/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur");
+const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage");
+const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge");
+const MotionFeMergeNode =
+/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode");
+const MotionFeMorphology =
+/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology");
+const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset");
+const MotionFePointLight =
+/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight");
+const MotionFeSpecularLighting =
+/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting");
+const MotionFeSpotLight =
+/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight");
+const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile");
+const MotionFeTurbulence =
+/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence");
+const MotionForeignObject =
+/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject");
+const MotionLinearGradient =
+/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient");
+const MotionRadialGradient =
+/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient");
+const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath");
+
+exports.a = MotionA;
+exports.abbr = MotionAbbr;
+exports.address = MotionAddress;
+exports.animate = MotionAnimate;
+exports.area = MotionArea;
+exports.article = MotionArticle;
+exports.aside = MotionAside;
+exports.audio = MotionAudio;
+exports.b = MotionB;
+exports.base = MotionBase;
+exports.bdi = MotionBdi;
+exports.bdo = MotionBdo;
+exports.big = MotionBig;
+exports.blockquote = MotionBlockquote;
+exports.body = MotionBody;
+exports.button = MotionButton;
+exports.canvas = MotionCanvas;
+exports.caption = MotionCaption;
+exports.circle = MotionCircle;
+exports.cite = MotionCite;
+exports.clipPath = MotionClipPath;
+exports.code = MotionCode;
+exports.col = MotionCol;
+exports.colgroup = MotionColgroup;
+exports.data = MotionData;
+exports.datalist = MotionDatalist;
+exports.dd = MotionDd;
+exports.defs = MotionDefs;
+exports.del = MotionDel;
+exports.desc = MotionDesc;
+exports.details = MotionDetails;
+exports.dfn = MotionDfn;
+exports.dialog = MotionDialog;
+exports.div = MotionDiv;
+exports.dl = MotionDl;
+exports.dt = MotionDt;
+exports.ellipse = MotionEllipse;
+exports.em = MotionEm;
+exports.embed = MotionEmbed;
+exports.feBlend = MotionFeBlend;
+exports.feColorMatrix = MotionFeColorMatrix;
+exports.feComponentTransfer = MotionFeComponentTransfer;
+exports.feComposite = MotionFeComposite;
+exports.feConvolveMatrix = MotionFeConvolveMatrix;
+exports.feDiffuseLighting = MotionFeDiffuseLighting;
+exports.feDisplacementMap = MotionFeDisplacementMap;
+exports.feDistantLight = MotionFeDistantLight;
+exports.feDropShadow = MotionFeDropShadow;
+exports.feFlood = MotionFeFlood;
+exports.feFuncA = MotionFeFuncA;
+exports.feFuncB = MotionFeFuncB;
+exports.feFuncG = MotionFeFuncG;
+exports.feFuncR = MotionFeFuncR;
+exports.feGaussianBlur = MotionFeGaussianBlur;
+exports.feImage = MotionFeImage;
+exports.feMerge = MotionFeMerge;
+exports.feMergeNode = MotionFeMergeNode;
+exports.feMorphology = MotionFeMorphology;
+exports.feOffset = MotionFeOffset;
+exports.fePointLight = MotionFePointLight;
+exports.feSpecularLighting = MotionFeSpecularLighting;
+exports.feSpotLight = MotionFeSpotLight;
+exports.feTile = MotionFeTile;
+exports.feTurbulence = MotionFeTurbulence;
+exports.fieldset = MotionFieldset;
+exports.figcaption = MotionFigcaption;
+exports.figure = MotionFigure;
+exports.filter = MotionFilter;
+exports.footer = MotionFooter;
+exports.foreignObject = MotionForeignObject;
+exports.form = MotionForm;
+exports.g = MotionG;
+exports.h1 = MotionH1;
+exports.h2 = MotionH2;
+exports.h3 = MotionH3;
+exports.h4 = MotionH4;
+exports.h5 = MotionH5;
+exports.h6 = MotionH6;
+exports.head = MotionHead;
+exports.header = MotionHeader;
+exports.hgroup = MotionHgroup;
+exports.hr = MotionHr;
+exports.html = MotionHtml;
+exports.i = MotionI;
+exports.iframe = MotionIframe;
+exports.image = MotionImage;
+exports.img = MotionImg;
+exports.input = MotionInput;
+exports.ins = MotionIns;
+exports.kbd = MotionKbd;
+exports.keygen = MotionKeygen;
+exports.label = MotionLabel;
+exports.legend = MotionLegend;
+exports.li = MotionLi;
+exports.line = MotionLine;
+exports.linearGradient = MotionLinearGradient;
+exports.link = MotionLink;
+exports.main = MotionMain;
+exports.map = MotionMap;
+exports.mark = MotionMark;
+exports.marker = MotionMarker;
+exports.mask = MotionMask;
+exports.menu = MotionMenu;
+exports.menuitem = MotionMenuitem;
+exports.metadata = MotionMetadata;
+exports.meter = MotionMeter;
+exports.nav = MotionNav;
+exports.object = MotionObject;
+exports.ol = MotionOl;
+exports.optgroup = MotionOptgroup;
+exports.option = MotionOption;
+exports.output = MotionOutput;
+exports.p = MotionP;
+exports.param = MotionParam;
+exports.path = MotionPath;
+exports.pattern = MotionPattern;
+exports.picture = MotionPicture;
+exports.polygon = MotionPolygon;
+exports.polyline = MotionPolyline;
+exports.pre = MotionPre;
+exports.progress = MotionProgress;
+exports.q = MotionQ;
+exports.radialGradient = MotionRadialGradient;
+exports.rect = MotionRect;
+exports.rp = MotionRp;
+exports.rt = MotionRt;
+exports.ruby = MotionRuby;
+exports.s = MotionS;
+exports.samp = MotionSamp;
+exports.script = MotionScript;
+exports.section = MotionSection;
+exports.select = MotionSelect;
+exports.small = MotionSmall;
+exports.source = MotionSource;
+exports.span = MotionSpan;
+exports.stop = MotionStop;
+exports.strong = MotionStrong;
+exports.style = MotionStyle;
+exports.sub = MotionSub;
+exports.summary = MotionSummary;
+exports.sup = MotionSup;
+exports.svg = MotionSvg;
+exports.symbol = MotionSymbol;
+exports.table = MotionTable;
+exports.tbody = MotionTbody;
+exports.td = MotionTd;
+exports.text = MotionText;
+exports.textPath = MotionTextPath;
+exports.textarea = MotionTextarea;
+exports.tfoot = MotionTfoot;
+exports.th = MotionTh;
+exports.thead = MotionThead;
+exports.time = MotionTime;
+exports.title = MotionTitle;
+exports.tr = MotionTr;
+exports.track = MotionTrack;
+exports.tspan = MotionTspan;
+exports.u = MotionU;
+exports.ul = MotionUl;
+exports.use = MotionUse;
+exports.video = MotionVideo;
+exports.view = MotionView;
+exports.wbr = MotionWbr;
+exports.webview = MotionWebview;
+//# sourceMappingURL=client.js.map
diff --git a/node_modules/framer-motion/dist/cjs/client.js.map b/node_modules/framer-motion/dist/cjs/client.js.map
new file mode 100644
index 0000000..ce21028
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/client.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"client.js","sources":["../../src/render/components/motion/create.ts","../../src/render/components/motion/elements.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement\n )\n}\n","\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":["createMotionComponent","featureBundle","createDomVisualElement"],"mappings":";;;;;;;;;;AAMgB,SAAA,iCAAiC,CAI7C,SAAwD,EACxD,OAAgC,EAAA;IAEhC,OAAOA,mCAAqB,CACxB,SAAS,EACT,OAAO,EACPC,2BAAa,EACbC,oCAA6D,CAChE,CAAA;AACL;;ACfA;;AAEG;AACU,MAAA,OAAO,iBAAiBF,iCAAqB,CAAC,GAAG,EAAC;AAClD,MAAA,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM,EAAC;AACxD,MAAA,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS,EAAC;AAC9D,MAAA,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM,EAAC;AACxD,MAAA,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS,EAAC;AAC9D,MAAA,WAAW,iBAAiBA,iCAAqB,CAAC,OAAO,EAAC;AAC1D,MAAA,WAAW,iBAAiBA,iCAAq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AAqB,CAAC,gBAAgB,EAAC;AAC5C,MAAA,cAAc,iBAAiBA,iCAAqB,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/framer-motion/dist/cjs/debug.js b/node_modules/framer-motion/dist/cjs/debug.js
new file mode 100644
index 0000000..6fb2ed6
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/debug.js
@@ -0,0 +1,13 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var motionDom = require('motion-dom');
+
+
+
+Object.defineProperty(exports, "recordStats", {
+ enumerable: true,
+ get: function () { return motionDom.recordStats; }
+});
+//# sourceMappingURL=debug.js.map
diff --git a/node_modules/framer-motion/dist/cjs/debug.js.map b/node_modules/framer-motion/dist/cjs/debug.js.map
new file mode 100644
index 0000000..ec4f5cd
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/debug.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"debug.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js b/node_modules/framer-motion/dist/cjs/dom-mini.js
new file mode 100644
index 0000000..1ed4330
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/dom-mini.js
@@ -0,0 +1,479 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var motionDom = require('motion-dom');
+var motionUtils = require('motion-utils');
+
+function isDOMKeyframes(keyframes) {
+ return typeof keyframes === "object" && !Array.isArray(keyframes);
+}
+
+function resolveSubjects(subject, keyframes, scope, selectorCache) {
+ if (subject == null) {
+ return [];
+ }
+ if (typeof subject === "string" && isDOMKeyframes(keyframes)) {
+ return motionDom.resolveElements(subject, scope, selectorCache);
+ }
+ else if (subject instanceof NodeList) {
+ return Array.from(subject);
+ }
+ else if (Array.isArray(subject)) {
+ return subject.filter((s) => s != null);
+ }
+ else {
+ return [subject];
+ }
+}
+
+function calculateRepeatDuration(duration, repeat, _repeatDelay) {
+ return duration * (repeat + 1);
+}
+
+/**
+ * Given a absolute or relative time definition and current/prev time state of the sequence,
+ * calculate an absolute time for the next keyframes.
+ */
+function calcNextTime(current, next, prev, labels) {
+ if (typeof next === "number") {
+ return next;
+ }
+ else if (next.startsWith("-") || next.startsWith("+")) {
+ return Math.max(0, current + parseFloat(next));
+ }
+ else if (next === "<") {
+ return prev;
+ }
+ else if (next.startsWith("<")) {
+ return Math.max(0, prev + parseFloat(next.slice(1)));
+ }
+ else {
+ return labels.get(next) ?? current;
+ }
+}
+
+function eraseKeyframes(sequence, startTime, endTime) {
+ for (let i = 0; i < sequence.length; i++) {
+ const keyframe = sequence[i];
+ if (keyframe.at > startTime && keyframe.at < endTime) {
+ motionUtils.removeItem(sequence, keyframe);
+ // If we remove this item we have to push the pointer back one
+ i--;
+ }
+ }
+}
+function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {
+ /**
+ * Erase every existing value between currentTime and targetTime,
+ * this will essentially splice this timeline into any currently
+ * defined ones.
+ */
+ eraseKeyframes(sequence, startTime, endTime);
+ for (let i = 0; i < keyframes.length; i++) {
+ sequence.push({
+ value: keyframes[i],
+ at: motionDom.mixNumber(startTime, endTime, offset[i]),
+ easing: motionUtils.getEasingForSegment(easing, i),
+ });
+ }
+}
+
+/**
+ * Take an array of times that represent repeated keyframes. For instance
+ * if we have original times of [0, 0.5, 1] then our repeated times will
+ * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back
+ * down to a 0-1 scale.
+ */
+function normalizeTimes(times, repeat) {
+ for (let i = 0; i < times.length; i++) {
+ times[i] = times[i] / (repeat + 1);
+ }
+}
+
+function compareByTime(a, b) {
+ if (a.at === b.at) {
+ if (a.value === null)
+ return 1;
+ if (b.value === null)
+ return -1;
+ return 0;
+ }
+ else {
+ return a.at - b.at;
+ }
+}
+
+const defaultSegmentEasing = "easeInOut";
+const MAX_REPEAT = 20;
+function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {
+ const defaultDuration = defaultTransition.duration || 0.3;
+ const animationDefinitions = new Map();
+ const sequences = new Map();
+ const elementCache = {};
+ const timeLabels = new Map();
+ let prevTime = 0;
+ let currentTime = 0;
+ let totalDuration = 0;
+ /**
+ * Build the timeline by mapping over the sequence array and converting
+ * the definitions into keyframes and offsets with absolute time values.
+ * These will later get converted into relative offsets in a second pass.
+ */
+ for (let i = 0; i < sequence.length; i++) {
+ const segment = sequence[i];
+ /**
+ * If this is a timeline label, mark it and skip the rest of this iteration.
+ */
+ if (typeof segment === "string") {
+ timeLabels.set(segment, currentTime);
+ continue;
+ }
+ else if (!Array.isArray(segment)) {
+ timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));
+ continue;
+ }
+ let [subject, keyframes, transition = {}] = segment;
+ /**
+ * If a relative or absolute time value has been specified we need to resolve
+ * it in relation to the currentTime.
+ */
+ if (transition.at !== undefined) {
+ currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);
+ }
+ /**
+ * Keep track of the maximum duration in this definition. This will be
+ * applied to currentTime once the definition has been parsed.
+ */
+ let maxDuration = 0;
+ const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {
+ const valueKeyframesAsList = keyframesAsList(valueKeyframes);
+ const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;
+ let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition;
+ /**
+ * Resolve stagger() if defined.
+ */
+ const calculatedDelay = typeof delay === "function"
+ ? delay(elementIndex, numSubjects)
+ : delay;
+ /**
+ * If this animation should and can use a spring, generate a spring easing function.
+ */
+ const numKeyframes = valueKeyframesAsList.length;
+ const createGenerator = motionDom.isGenerator(type)
+ ? type
+ : generators?.[type || "keyframes"];
+ if (numKeyframes <= 2 && createGenerator) {
+ /**
+ * As we're creating an easing function from a spring,
+ * ideally we want to generate it using the real distance
+ * between the two keyframes. However this isn't always
+ * possible - in these situations we use 0-100.
+ */
+ let absoluteDelta = 100;
+ if (numKeyframes === 2 &&
+ isNumberKeyframesArray(valueKeyframesAsList)) {
+ const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];
+ absoluteDelta = Math.abs(delta);
+ }
+ const springTransition = {
+ ...defaultTransition,
+ ...remainingTransition,
+ };
+ if (duration !== undefined) {
+ springTransition.duration = motionUtils.secondsToMilliseconds(duration);
+ }
+ const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator);
+ ease = springEasing.ease;
+ duration = springEasing.duration;
+ }
+ duration ?? (duration = defaultDuration);
+ const startTime = currentTime + calculatedDelay;
+ /**
+ * If there's only one time offset of 0, fill in a second with length 1
+ */
+ if (times.length === 1 && times[0] === 0) {
+ times[1] = 1;
+ }
+ /**
+ * Fill out if offset if fewer offsets than keyframes
+ */
+ const remainder = times.length - valueKeyframesAsList.length;
+ remainder > 0 && motionDom.fillOffset(times, remainder);
+ /**
+ * If only one value has been set, ie [1], push a null to the start of
+ * the keyframe array. This will let us mark a keyframe at this point
+ * that will later be hydrated with the previous value.
+ */
+ valueKeyframesAsList.length === 1 &&
+ valueKeyframesAsList.unshift(null);
+ /**
+ * Handle repeat options
+ */
+ if (repeat) {
+ motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
+ duration = calculateRepeatDuration(duration, repeat);
+ const originalKeyframes = [...valueKeyframesAsList];
+ const originalTimes = [...times];
+ ease = Array.isArray(ease) ? [...ease] : [ease];
+ const originalEase = [...ease];
+ for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {
+ valueKeyframesAsList.push(...originalKeyframes);
+ for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {
+ times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));
+ ease.push(keyframeIndex === 0
+ ? "linear"
+ : motionUtils.getEasingForSegment(originalEase, keyframeIndex - 1));
+ }
+ }
+ normalizeTimes(times, repeat);
+ }
+ const targetTime = startTime + duration;
+ /**
+ * Add keyframes, mapping offsets to absolute time.
+ */
+ addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);
+ maxDuration = Math.max(calculatedDelay + duration, maxDuration);
+ totalDuration = Math.max(targetTime, totalDuration);
+ };
+ if (motionDom.isMotionValue(subject)) {
+ const subjectSequence = getSubjectSequence(subject, sequences);
+ resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence));
+ }
+ else {
+ const subjects = resolveSubjects(subject, keyframes, scope, elementCache);
+ const numSubjects = subjects.length;
+ /**
+ * For every element in this segment, process the defined values.
+ */
+ for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {
+ /**
+ * Cast necessary, but we know these are of this type
+ */
+ keyframes = keyframes;
+ transition = transition;
+ const thisSubject = subjects[subjectIndex];
+ const subjectSequence = getSubjectSequence(thisSubject, sequences);
+ for (const key in keyframes) {
+ resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);
+ }
+ }
+ }
+ prevTime = currentTime;
+ currentTime += maxDuration;
+ }
+ /**
+ * For every element and value combination create a new animation.
+ */
+ sequences.forEach((valueSequences, element) => {
+ for (const key in valueSequences) {
+ const valueSequence = valueSequences[key];
+ /**
+ * Arrange all the keyframes in ascending time order.
+ */
+ valueSequence.sort(compareByTime);
+ const keyframes = [];
+ const valueOffset = [];
+ const valueEasing = [];
+ /**
+ * For each keyframe, translate absolute times into
+ * relative offsets based on the total duration of the timeline.
+ */
+ for (let i = 0; i < valueSequence.length; i++) {
+ const { at, value, easing } = valueSequence[i];
+ keyframes.push(value);
+ valueOffset.push(motionUtils.progress(0, totalDuration, at));
+ valueEasing.push(easing || "easeOut");
+ }
+ /**
+ * If the first keyframe doesn't land on offset: 0
+ * provide one by duplicating the initial keyframe. This ensures
+ * it snaps to the first keyframe when the animation starts.
+ */
+ if (valueOffset[0] !== 0) {
+ valueOffset.unshift(0);
+ keyframes.unshift(keyframes[0]);
+ valueEasing.unshift(defaultSegmentEasing);
+ }
+ /**
+ * If the last keyframe doesn't land on offset: 1
+ * provide one with a null wildcard value. This will ensure it
+ * stays static until the end of the animation.
+ */
+ if (valueOffset[valueOffset.length - 1] !== 1) {
+ valueOffset.push(1);
+ keyframes.push(null);
+ }
+ if (!animationDefinitions.has(element)) {
+ animationDefinitions.set(element, {
+ keyframes: {},
+ transition: {},
+ });
+ }
+ const definition = animationDefinitions.get(element);
+ definition.keyframes[key] = keyframes;
+ /**
+ * Exclude `type` from defaultTransition since springs have been
+ * converted to duration-based easing functions in resolveValueSequence.
+ * Including `type: "spring"` would cause JSAnimation to error when
+ * the merged keyframes array has more than 2 keyframes.
+ */
+ const { type: _type, ...remainingDefaultTransition } = defaultTransition;
+ definition.transition[key] = {
+ ...remainingDefaultTransition,
+ duration: totalDuration,
+ ease: valueEasing,
+ times: valueOffset,
+ ...sequenceTransition,
+ };
+ }
+ });
+ return animationDefinitions;
+}
+function getSubjectSequence(subject, sequences) {
+ !sequences.has(subject) && sequences.set(subject, {});
+ return sequences.get(subject);
+}
+function getValueSequence(name, sequences) {
+ if (!sequences[name])
+ sequences[name] = [];
+ return sequences[name];
+}
+function keyframesAsList(keyframes) {
+ return Array.isArray(keyframes) ? keyframes : [keyframes];
+}
+function getValueTransition(transition, key) {
+ return transition && transition[key]
+ ? {
+ ...transition,
+ ...transition[key],
+ }
+ : { ...transition };
+}
+const isNumber = (keyframe) => typeof keyframe === "number";
+const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);
+
+function animateElements(elementOrSelector, keyframes, options, scope) {
+ // Gracefully handle null/undefined elements (e.g., from querySelector returning null)
+ if (elementOrSelector == null) {
+ return [];
+ }
+ const elements = motionDom.resolveElements(elementOrSelector, scope);
+ const numElements = elements.length;
+ motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
+ /**
+ * WAAPI doesn't support interrupting animations.
+ *
+ * Therefore, starting animations requires a three-step process:
+ * 1. Stop existing animations (write styles to DOM)
+ * 2. Resolve keyframes (read styles from DOM)
+ * 3. Create new animations (write styles to DOM)
+ *
+ * The hybrid `animate()` function uses AsyncAnimation to resolve
+ * keyframes before creating new animations, which removes style
+ * thrashing. Here, we have much stricter filesize constraints.
+ * Therefore we do this in a synchronous way that ensures that
+ * at least within `animate()` calls there is no style thrashing.
+ *
+ * In the motion-native-animate-mini-interrupt benchmark this
+ * was 80% faster than a single loop.
+ */
+ const animationDefinitions = [];
+ /**
+ * Step 1: Build options and stop existing animations (write)
+ */
+ for (let i = 0; i < numElements; i++) {
+ const element = elements[i];
+ const elementTransition = { ...options };
+ /**
+ * Resolve stagger function if provided.
+ */
+ if (typeof elementTransition.delay === "function") {
+ elementTransition.delay = elementTransition.delay(i, numElements);
+ }
+ for (const valueName in keyframes) {
+ let valueKeyframes = keyframes[valueName];
+ if (!Array.isArray(valueKeyframes)) {
+ valueKeyframes = [valueKeyframes];
+ }
+ const valueOptions = {
+ ...motionDom.getValueTransition(elementTransition, valueName),
+ };
+ valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration));
+ valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay));
+ /**
+ * If there's an existing animation playing on this element then stop it
+ * before creating a new one.
+ */
+ const map = motionDom.getAnimationMap(element);
+ const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || "");
+ const currentAnimation = map.get(key);
+ currentAnimation && currentAnimation.stop();
+ animationDefinitions.push({
+ map,
+ key,
+ unresolvedKeyframes: valueKeyframes,
+ options: {
+ ...valueOptions,
+ element,
+ name: valueName,
+ allowFlatten: !elementTransition.type && !elementTransition.ease,
+ },
+ });
+ }
+ }
+ /**
+ * Step 2: Resolve keyframes (read)
+ */
+ for (let i = 0; i < animationDefinitions.length; i++) {
+ const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i];
+ const { element, name, pseudoElement } = animationOptions;
+ if (!pseudoElement && unresolvedKeyframes[0] === null) {
+ unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name);
+ }
+ motionDom.fillWildcards(unresolvedKeyframes);
+ motionDom.applyPxDefaults(unresolvedKeyframes, name);
+ /**
+ * If we only have one keyframe, explicitly read the initial keyframe
+ * from the computed style. This is to ensure consistency with WAAPI behaviour
+ * for restarting animations, for instance .play() after finish, when it
+ * has one vs two keyframes.
+ */
+ if (!pseudoElement && unresolvedKeyframes.length < 2) {
+ unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name));
+ }
+ animationOptions.keyframes = unresolvedKeyframes;
+ }
+ /**
+ * Step 3: Create new animations (write)
+ */
+ const animations = [];
+ for (let i = 0; i < animationDefinitions.length; i++) {
+ const { map, key, options: animationOptions } = animationDefinitions[i];
+ const animation = new motionDom.NativeAnimation(animationOptions);
+ map.set(key, animation);
+ animation.finished.finally(() => map.delete(key));
+ animations.push(animation);
+ }
+ return animations;
+}
+
+function animateSequence(definition, options) {
+ const animations = [];
+ createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => {
+ animations.push(...animateElements(element, keyframes, transition));
+ });
+ return new motionDom.GroupAnimationWithThen(animations);
+}
+
+const createScopedWaapiAnimate = (scope) => {
+ function scopedAnimate(elementOrSelector, keyframes, options) {
+ return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope));
+ }
+ return scopedAnimate;
+};
+const animateMini = /*@__PURE__*/ createScopedWaapiAnimate();
+
+exports.animate = animateMini;
+exports.animateSequence = animateSequence;
+//# sourceMappingURL=dom-mini.js.map
diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js.map b/node_modules/framer-motion/dist/cjs/dom-mini.js.map
new file mode 100644
index 0000000..18661d5
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/dom-mini.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"dom-mini.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-sequence.ts","../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n","import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n","export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n _repeatDelay: number\n): number {\n return duration * (repeat + 1)\n}\n","import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n current: number,\n next: SequenceTime,\n prev: number,\n labels: Map\n): number {\n if (typeof next === \"number\") {\n return next\n } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next))\n } else if (next === \"<\") {\n return prev\n } else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)))\n } else {\n return labels.get(next) ?? current\n }\n}\n","import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n sequence: ValueSequence,\n startTime: number,\n endTime: number\n): void {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i]\n\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe)\n\n // If we remove this item we have to push the pointer back one\n i--\n }\n }\n}\n\nexport function addKeyframes(\n sequence: ValueSequence,\n keyframes: UnresolvedValueKeyframe[],\n easing: Easing | Easing[],\n offset: number[],\n startTime: number,\n endTime: number\n): void {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime)\n\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n })\n }\n}\n","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times: number[], repeat: number): void {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1)\n }\n}\n","import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n","import {\n AnimationScope,\n createGeneratorEasing,\n defaultOffset,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n fillOffset,\n GeneratorFactory,\n isGenerator,\n isMotionValue,\n Transition,\n UnresolvedValueKeyframe,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport {\n Easing,\n getEasingForSegment,\n invariant,\n progress,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n AnimationSequence,\n At,\n ResolvedAnimationDefinitions,\n SequenceMap,\n SequenceOptions,\n ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n sequence: AnimationSequence,\n { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n scope?: AnimationScope,\n generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n const defaultDuration = defaultTransition.duration || 0.3\n const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n const sequences = new Map()\n const elementCache = {}\n const timeLabels = new Map()\n\n let prevTime = 0\n let currentTime = 0\n let totalDuration = 0\n\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i]\n\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime)\n continue\n } else if (!Array.isArray(segment)) {\n timeLabels.set(\n segment.name,\n calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n )\n continue\n }\n\n let [subject, keyframes, transition = {}] = segment\n\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(\n currentTime,\n transition.at,\n prevTime,\n timeLabels\n )\n }\n\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0\n\n const resolveValueSequence = (\n valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n valueTransition: Transition | DynamicAnimationOptions,\n valueSequence: ValueSequence,\n elementIndex = 0,\n numSubjects = 0\n ) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n const {\n delay = 0,\n times = defaultOffset(valueKeyframesAsList),\n type = defaultTransition.type || \"keyframes\",\n repeat,\n repeatType,\n repeatDelay = 0,\n ...remainingTransition\n } = valueTransition\n let { ease = defaultTransition.ease || \"easeOut\", duration } =\n valueTransition\n\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay =\n typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay\n\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"]\n\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100\n if (\n numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)\n ) {\n const delta =\n valueKeyframesAsList[1] - valueKeyframesAsList[0]\n absoluteDelta = Math.abs(delta)\n }\n\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n }\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration)\n }\n\n const springEasing = createGeneratorEasing(\n springTransition,\n absoluteDelta,\n createGenerator\n )\n\n ease = springEasing.ease\n duration = springEasing.duration\n }\n\n duration ??= defaultDuration\n\n const startTime = currentTime + calculatedDelay\n\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1\n }\n\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length\n remainder > 0 && fillOffset(times, remainder)\n\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null)\n\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(\n repeat < MAX_REPEAT,\n \"Repeat count too high, must be less than 20\",\n \"repeat-count-high\"\n )\n\n duration = calculateRepeatDuration(\n duration,\n repeat,\n repeatDelay\n )\n\n const originalKeyframes = [...valueKeyframesAsList]\n const originalTimes = [...times]\n ease = Array.isArray(ease) ? [...ease] : [ease]\n const originalEase = [...ease]\n\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes)\n\n for (\n let keyframeIndex = 0;\n keyframeIndex < originalKeyframes.length;\n keyframeIndex++\n ) {\n times.push(\n originalTimes[keyframeIndex] + (repeatIndex + 1)\n )\n ease.push(\n keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(\n originalEase,\n keyframeIndex - 1\n )\n )\n }\n }\n\n normalizeTimes(times, repeat)\n }\n\n const targetTime = startTime + duration\n\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(\n valueSequence,\n valueKeyframesAsList,\n ease as Easing | Easing[],\n times,\n startTime,\n targetTime\n )\n\n maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n totalDuration = Math.max(targetTime, totalDuration)\n }\n\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences)\n resolveValueSequence(\n keyframes as AnyResolvedKeyframe,\n transition,\n getValueSequence(\"default\", subjectSequence)\n )\n } else {\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope,\n elementCache\n )\n\n const numSubjects = subjects.length\n\n /**\n * For every element in this segment, process the defined values.\n */\n for (\n let subjectIndex = 0;\n subjectIndex < numSubjects;\n subjectIndex++\n ) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes as DOMKeyframesDefinition\n transition = transition as DynamicAnimationOptions\n\n const thisSubject = subjects[subjectIndex]\n const subjectSequence = getSubjectSequence(\n thisSubject,\n sequences\n )\n\n for (const key in keyframes) {\n resolveValueSequence(\n keyframes[\n key as keyof typeof keyframes\n ] as UnresolvedValueKeyframe,\n getValueTransition(transition, key),\n getValueSequence(key, subjectSequence),\n subjectIndex,\n numSubjects\n )\n }\n }\n }\n\n prevTime = currentTime\n currentTime += maxDuration\n }\n\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key]\n\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime)\n\n const keyframes: UnresolvedValueKeyframe[] = []\n const valueOffset: number[] = []\n const valueEasing: Easing[] = []\n\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i]\n keyframes.push(value)\n valueOffset.push(progress(0, totalDuration, at))\n valueEasing.push(easing || \"easeOut\")\n }\n\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0)\n keyframes.unshift(keyframes[0])\n valueEasing.unshift(defaultSegmentEasing)\n }\n\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1)\n keyframes.push(null)\n }\n\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n })\n }\n\n const definition = animationDefinitions.get(element)!\n\n definition.keyframes[key] = keyframes\n\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } =\n defaultTransition\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n }\n }\n })\n\n return animationDefinitions\n}\n\nfunction getSubjectSequence(\n subject: Element | MotionValue | O,\n sequences: Map\n): SequenceMap {\n !sequences.has(subject) && sequences.set(subject, {})\n return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n if (!sequences[name]) sequences[name] = []\n return sequences[name]\n}\n\nfunction keyframesAsList(\n keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n transition: DynamicAnimationOptions & At,\n key: string\n): DynamicAnimationOptions {\n return transition && transition[key as keyof typeof transition]\n ? {\n ...transition,\n ...(transition[key as keyof typeof transition] as Transition),\n }\n : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n","import {\n animationMapKey,\n AnimationPlaybackControls,\n AnimationScope,\n applyPxDefaults,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n fillWildcards,\n getAnimationMap,\n getComputedStyle,\n getValueTransition,\n NativeAnimation,\n NativeAnimationOptions,\n resolveElements,\n UnresolvedValueKeyframe,\n ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n map: Map>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\n keyframes?: ValueKeyframe[]\n }\n}\n\nexport function animateElements(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return []\n }\n\n const elements = resolveElements(elementOrSelector, scope) as Array<\n HTMLElement | SVGElement\n >\n const numElements = elements.length\n\n invariant(\n Boolean(numElements),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions: AnimationDefinition[] = []\n\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i]\n const elementTransition: DynamicAnimationOptions = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements)\n }\n\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes]\n }\n\n const valueOptions = {\n ...getValueTransition(elementTransition as any, valueName),\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element)\n const key = animationMapKey(\n valueName,\n valueOptions.pseudoElement || \"\"\n )\n const currentAnimation = map.get(key)\n currentAnimation && currentAnimation.stop()\n\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten:\n !elementTransition.type && !elementTransition.ease,\n },\n })\n }\n }\n\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } =\n animationDefinitions[i]\n\n const { element, name, pseudoElement } = animationOptions\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name)\n }\n\n fillWildcards(unresolvedKeyframes)\n applyPxDefaults(unresolvedKeyframes, name)\n\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name))\n }\n\n animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n }\n\n /**\n * Step 3: Create new animations (write)\n */\n const animations: AnimationPlaybackControls[] = []\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i]\n const animation = new NativeAnimation(\n animationOptions as NativeAnimationOptions\n )\n\n map.set(key, animation)\n animation.finished.finally(() => map.delete(key))\n\n animations.push(animation)\n }\n\n return animations\n}\n","import { AnimationPlaybackControls, GroupAnimationWithThen } from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../../sequence/types\"\nimport { animateElements } from \"./animate-elements\"\n\nexport function animateSequence(\n definition: AnimationSequence,\n options?: SequenceOptions\n) {\n const animations: AnimationPlaybackControls[] = []\n\n createAnimationsFromSequence(definition, options).forEach(\n ({ keyframes, transition }, element: Element) => {\n animations.push(...animateElements(element, keyframes, transition))\n }\n )\n\n return new GroupAnimationWithThen(animations)\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","invariant","isMotionValue","progress","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","GroupAnimationWithThen"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACrE;;ACGM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE,CAAA;KACZ;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAOA,yBAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,CAAA;KACxD;AAAM,SAAA,IAAI,OAAO,YAAY,QAAQ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at end of file
diff --git a/node_modules/framer-motion/dist/cjs/dom.js b/node_modules/framer-motion/dist/cjs/dom.js
new file mode 100644
index 0000000..c20a7cd
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/dom.js
@@ -0,0 +1,1165 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var motionDom = require('motion-dom');
+var motionUtils = require('motion-utils');
+
+function isDOMKeyframes(keyframes) {
+ return typeof keyframes === "object" && !Array.isArray(keyframes);
+}
+
+function resolveSubjects(subject, keyframes, scope, selectorCache) {
+ if (subject == null) {
+ return [];
+ }
+ if (typeof subject === "string" && isDOMKeyframes(keyframes)) {
+ return motionDom.resolveElements(subject, scope, selectorCache);
+ }
+ else if (subject instanceof NodeList) {
+ return Array.from(subject);
+ }
+ else if (Array.isArray(subject)) {
+ return subject.filter((s) => s != null);
+ }
+ else {
+ return [subject];
+ }
+}
+
+function calculateRepeatDuration(duration, repeat, _repeatDelay) {
+ return duration * (repeat + 1);
+}
+
+/**
+ * Given a absolute or relative time definition and current/prev time state of the sequence,
+ * calculate an absolute time for the next keyframes.
+ */
+function calcNextTime(current, next, prev, labels) {
+ if (typeof next === "number") {
+ return next;
+ }
+ else if (next.startsWith("-") || next.startsWith("+")) {
+ return Math.max(0, current + parseFloat(next));
+ }
+ else if (next === "<") {
+ return prev;
+ }
+ else if (next.startsWith("<")) {
+ return Math.max(0, prev + parseFloat(next.slice(1)));
+ }
+ else {
+ return labels.get(next) ?? current;
+ }
+}
+
+function eraseKeyframes(sequence, startTime, endTime) {
+ for (let i = 0; i < sequence.length; i++) {
+ const keyframe = sequence[i];
+ if (keyframe.at > startTime && keyframe.at < endTime) {
+ motionUtils.removeItem(sequence, keyframe);
+ // If we remove this item we have to push the pointer back one
+ i--;
+ }
+ }
+}
+function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {
+ /**
+ * Erase every existing value between currentTime and targetTime,
+ * this will essentially splice this timeline into any currently
+ * defined ones.
+ */
+ eraseKeyframes(sequence, startTime, endTime);
+ for (let i = 0; i < keyframes.length; i++) {
+ sequence.push({
+ value: keyframes[i],
+ at: motionDom.mixNumber(startTime, endTime, offset[i]),
+ easing: motionUtils.getEasingForSegment(easing, i),
+ });
+ }
+}
+
+/**
+ * Take an array of times that represent repeated keyframes. For instance
+ * if we have original times of [0, 0.5, 1] then our repeated times will
+ * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back
+ * down to a 0-1 scale.
+ */
+function normalizeTimes(times, repeat) {
+ for (let i = 0; i < times.length; i++) {
+ times[i] = times[i] / (repeat + 1);
+ }
+}
+
+function compareByTime(a, b) {
+ if (a.at === b.at) {
+ if (a.value === null)
+ return 1;
+ if (b.value === null)
+ return -1;
+ return 0;
+ }
+ else {
+ return a.at - b.at;
+ }
+}
+
+const defaultSegmentEasing = "easeInOut";
+const MAX_REPEAT = 20;
+function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {
+ const defaultDuration = defaultTransition.duration || 0.3;
+ const animationDefinitions = new Map();
+ const sequences = new Map();
+ const elementCache = {};
+ const timeLabels = new Map();
+ let prevTime = 0;
+ let currentTime = 0;
+ let totalDuration = 0;
+ /**
+ * Build the timeline by mapping over the sequence array and converting
+ * the definitions into keyframes and offsets with absolute time values.
+ * These will later get converted into relative offsets in a second pass.
+ */
+ for (let i = 0; i < sequence.length; i++) {
+ const segment = sequence[i];
+ /**
+ * If this is a timeline label, mark it and skip the rest of this iteration.
+ */
+ if (typeof segment === "string") {
+ timeLabels.set(segment, currentTime);
+ continue;
+ }
+ else if (!Array.isArray(segment)) {
+ timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));
+ continue;
+ }
+ let [subject, keyframes, transition = {}] = segment;
+ /**
+ * If a relative or absolute time value has been specified we need to resolve
+ * it in relation to the currentTime.
+ */
+ if (transition.at !== undefined) {
+ currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);
+ }
+ /**
+ * Keep track of the maximum duration in this definition. This will be
+ * applied to currentTime once the definition has been parsed.
+ */
+ let maxDuration = 0;
+ const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {
+ const valueKeyframesAsList = keyframesAsList(valueKeyframes);
+ const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;
+ let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition;
+ /**
+ * Resolve stagger() if defined.
+ */
+ const calculatedDelay = typeof delay === "function"
+ ? delay(elementIndex, numSubjects)
+ : delay;
+ /**
+ * If this animation should and can use a spring, generate a spring easing function.
+ */
+ const numKeyframes = valueKeyframesAsList.length;
+ const createGenerator = motionDom.isGenerator(type)
+ ? type
+ : generators?.[type || "keyframes"];
+ if (numKeyframes <= 2 && createGenerator) {
+ /**
+ * As we're creating an easing function from a spring,
+ * ideally we want to generate it using the real distance
+ * between the two keyframes. However this isn't always
+ * possible - in these situations we use 0-100.
+ */
+ let absoluteDelta = 100;
+ if (numKeyframes === 2 &&
+ isNumberKeyframesArray(valueKeyframesAsList)) {
+ const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];
+ absoluteDelta = Math.abs(delta);
+ }
+ const springTransition = {
+ ...defaultTransition,
+ ...remainingTransition,
+ };
+ if (duration !== undefined) {
+ springTransition.duration = motionUtils.secondsToMilliseconds(duration);
+ }
+ const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator);
+ ease = springEasing.ease;
+ duration = springEasing.duration;
+ }
+ duration ?? (duration = defaultDuration);
+ const startTime = currentTime + calculatedDelay;
+ /**
+ * If there's only one time offset of 0, fill in a second with length 1
+ */
+ if (times.length === 1 && times[0] === 0) {
+ times[1] = 1;
+ }
+ /**
+ * Fill out if offset if fewer offsets than keyframes
+ */
+ const remainder = times.length - valueKeyframesAsList.length;
+ remainder > 0 && motionDom.fillOffset(times, remainder);
+ /**
+ * If only one value has been set, ie [1], push a null to the start of
+ * the keyframe array. This will let us mark a keyframe at this point
+ * that will later be hydrated with the previous value.
+ */
+ valueKeyframesAsList.length === 1 &&
+ valueKeyframesAsList.unshift(null);
+ /**
+ * Handle repeat options
+ */
+ if (repeat) {
+ motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
+ duration = calculateRepeatDuration(duration, repeat);
+ const originalKeyframes = [...valueKeyframesAsList];
+ const originalTimes = [...times];
+ ease = Array.isArray(ease) ? [...ease] : [ease];
+ const originalEase = [...ease];
+ for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {
+ valueKeyframesAsList.push(...originalKeyframes);
+ for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {
+ times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));
+ ease.push(keyframeIndex === 0
+ ? "linear"
+ : motionUtils.getEasingForSegment(originalEase, keyframeIndex - 1));
+ }
+ }
+ normalizeTimes(times, repeat);
+ }
+ const targetTime = startTime + duration;
+ /**
+ * Add keyframes, mapping offsets to absolute time.
+ */
+ addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);
+ maxDuration = Math.max(calculatedDelay + duration, maxDuration);
+ totalDuration = Math.max(targetTime, totalDuration);
+ };
+ if (motionDom.isMotionValue(subject)) {
+ const subjectSequence = getSubjectSequence(subject, sequences);
+ resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence));
+ }
+ else {
+ const subjects = resolveSubjects(subject, keyframes, scope, elementCache);
+ const numSubjects = subjects.length;
+ /**
+ * For every element in this segment, process the defined values.
+ */
+ for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {
+ /**
+ * Cast necessary, but we know these are of this type
+ */
+ keyframes = keyframes;
+ transition = transition;
+ const thisSubject = subjects[subjectIndex];
+ const subjectSequence = getSubjectSequence(thisSubject, sequences);
+ for (const key in keyframes) {
+ resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);
+ }
+ }
+ }
+ prevTime = currentTime;
+ currentTime += maxDuration;
+ }
+ /**
+ * For every element and value combination create a new animation.
+ */
+ sequences.forEach((valueSequences, element) => {
+ for (const key in valueSequences) {
+ const valueSequence = valueSequences[key];
+ /**
+ * Arrange all the keyframes in ascending time order.
+ */
+ valueSequence.sort(compareByTime);
+ const keyframes = [];
+ const valueOffset = [];
+ const valueEasing = [];
+ /**
+ * For each keyframe, translate absolute times into
+ * relative offsets based on the total duration of the timeline.
+ */
+ for (let i = 0; i < valueSequence.length; i++) {
+ const { at, value, easing } = valueSequence[i];
+ keyframes.push(value);
+ valueOffset.push(motionUtils.progress(0, totalDuration, at));
+ valueEasing.push(easing || "easeOut");
+ }
+ /**
+ * If the first keyframe doesn't land on offset: 0
+ * provide one by duplicating the initial keyframe. This ensures
+ * it snaps to the first keyframe when the animation starts.
+ */
+ if (valueOffset[0] !== 0) {
+ valueOffset.unshift(0);
+ keyframes.unshift(keyframes[0]);
+ valueEasing.unshift(defaultSegmentEasing);
+ }
+ /**
+ * If the last keyframe doesn't land on offset: 1
+ * provide one with a null wildcard value. This will ensure it
+ * stays static until the end of the animation.
+ */
+ if (valueOffset[valueOffset.length - 1] !== 1) {
+ valueOffset.push(1);
+ keyframes.push(null);
+ }
+ if (!animationDefinitions.has(element)) {
+ animationDefinitions.set(element, {
+ keyframes: {},
+ transition: {},
+ });
+ }
+ const definition = animationDefinitions.get(element);
+ definition.keyframes[key] = keyframes;
+ /**
+ * Exclude `type` from defaultTransition since springs have been
+ * converted to duration-based easing functions in resolveValueSequence.
+ * Including `type: "spring"` would cause JSAnimation to error when
+ * the merged keyframes array has more than 2 keyframes.
+ */
+ const { type: _type, ...remainingDefaultTransition } = defaultTransition;
+ definition.transition[key] = {
+ ...remainingDefaultTransition,
+ duration: totalDuration,
+ ease: valueEasing,
+ times: valueOffset,
+ ...sequenceTransition,
+ };
+ }
+ });
+ return animationDefinitions;
+}
+function getSubjectSequence(subject, sequences) {
+ !sequences.has(subject) && sequences.set(subject, {});
+ return sequences.get(subject);
+}
+function getValueSequence(name, sequences) {
+ if (!sequences[name])
+ sequences[name] = [];
+ return sequences[name];
+}
+function keyframesAsList(keyframes) {
+ return Array.isArray(keyframes) ? keyframes : [keyframes];
+}
+function getValueTransition(transition, key) {
+ return transition && transition[key]
+ ? {
+ ...transition,
+ ...transition[key],
+ }
+ : { ...transition };
+}
+const isNumber = (keyframe) => typeof keyframe === "number";
+const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);
+
+function createDOMVisualElement(element) {
+ const options = {
+ presenceContext: null,
+ props: {},
+ visualState: {
+ renderState: {
+ transform: {},
+ transformOrigin: {},
+ style: {},
+ vars: {},
+ attrs: {},
+ },
+ latestValues: {},
+ },
+ };
+ const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element)
+ ? new motionDom.SVGVisualElement(options)
+ : new motionDom.HTMLVisualElement(options);
+ node.mount(element);
+ motionDom.visualElementStore.set(element, node);
+}
+function createObjectVisualElement(subject) {
+ const options = {
+ presenceContext: null,
+ props: {},
+ visualState: {
+ renderState: {
+ output: {},
+ },
+ latestValues: {},
+ },
+ };
+ const node = new motionDom.ObjectVisualElement(options);
+ node.mount(subject);
+ motionDom.visualElementStore.set(subject, node);
+}
+
+function isSingleValue(subject, keyframes) {
+ return (motionDom.isMotionValue(subject) ||
+ typeof subject === "number" ||
+ (typeof subject === "string" && !isDOMKeyframes(keyframes)));
+}
+/**
+ * Implementation
+ */
+function animateSubject(subject, keyframes, options, scope) {
+ const animations = [];
+ if (isSingleValue(subject, keyframes)) {
+ animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes)
+ ? keyframes.default || keyframes
+ : keyframes, options ? options.default || options : options));
+ }
+ else {
+ // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)
+ if (subject == null) {
+ return animations;
+ }
+ const subjects = resolveSubjects(subject, keyframes, scope);
+ const numSubjects = subjects.length;
+ motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements");
+ for (let i = 0; i < numSubjects; i++) {
+ const thisSubject = subjects[i];
+ const createVisualElement = thisSubject instanceof Element
+ ? createDOMVisualElement
+ : createObjectVisualElement;
+ if (!motionDom.visualElementStore.has(thisSubject)) {
+ createVisualElement(thisSubject);
+ }
+ const visualElement = motionDom.visualElementStore.get(thisSubject);
+ const transition = { ...options };
+ /**
+ * Resolve stagger function if provided.
+ */
+ if ("delay" in transition &&
+ typeof transition.delay === "function") {
+ transition.delay = transition.delay(i, numSubjects);
+ }
+ animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {}));
+ }
+ }
+ return animations;
+}
+
+function animateSequence(sequence, options, scope) {
+ const animations = [];
+ /**
+ * Pre-process: replace function segments with MotionValue segments,
+ * subscribe callbacks immediately
+ */
+ const processedSequence = sequence.map((segment) => {
+ if (Array.isArray(segment) && typeof segment[0] === "function") {
+ const callback = segment[0];
+ const mv = motionDom.motionValue(0);
+ mv.on("change", callback);
+ if (segment.length === 1) {
+ return [mv, [0, 1]];
+ }
+ else if (segment.length === 2) {
+ return [mv, [0, 1], segment[1]];
+ }
+ else {
+ return [mv, segment[1], segment[2]];
+ }
+ }
+ return segment;
+ });
+ const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring });
+ animationDefinitions.forEach(({ keyframes, transition }, subject) => {
+ animations.push(...animateSubject(subject, keyframes, transition));
+ });
+ return animations;
+}
+
+function isSequence(value) {
+ return Array.isArray(value) && value.some(Array.isArray);
+}
+/**
+ * Creates an animation function that is optionally scoped
+ * to a specific element.
+ */
+function createScopedAnimate(options = {}) {
+ const { scope, reduceMotion } = options;
+ /**
+ * Implementation
+ */
+ function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {
+ let animations = [];
+ let animationOnComplete;
+ if (isSequence(subjectOrSequence)) {
+ animations = animateSequence(subjectOrSequence, reduceMotion !== undefined
+ ? { reduceMotion, ...optionsOrKeyframes }
+ : optionsOrKeyframes, scope);
+ }
+ else {
+ // Extract top-level onComplete so it doesn't get applied per-value
+ const { onComplete, ...rest } = options || {};
+ if (typeof onComplete === "function") {
+ animationOnComplete = onComplete;
+ }
+ animations = animateSubject(subjectOrSequence, optionsOrKeyframes, (reduceMotion !== undefined
+ ? { reduceMotion, ...rest }
+ : rest), scope);
+ }
+ const animation = new motionDom.GroupAnimationWithThen(animations);
+ if (animationOnComplete) {
+ animation.finished.then(animationOnComplete);
+ }
+ if (scope) {
+ scope.animations.push(animation);
+ animation.finished.then(() => {
+ motionUtils.removeItem(scope.animations, animation);
+ });
+ }
+ return animation;
+ }
+ return scopedAnimate;
+}
+const animate = createScopedAnimate();
+
+function animateElements(elementOrSelector, keyframes, options, scope) {
+ // Gracefully handle null/undefined elements (e.g., from querySelector returning null)
+ if (elementOrSelector == null) {
+ return [];
+ }
+ const elements = motionDom.resolveElements(elementOrSelector, scope);
+ const numElements = elements.length;
+ motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
+ /**
+ * WAAPI doesn't support interrupting animations.
+ *
+ * Therefore, starting animations requires a three-step process:
+ * 1. Stop existing animations (write styles to DOM)
+ * 2. Resolve keyframes (read styles from DOM)
+ * 3. Create new animations (write styles to DOM)
+ *
+ * The hybrid `animate()` function uses AsyncAnimation to resolve
+ * keyframes before creating new animations, which removes style
+ * thrashing. Here, we have much stricter filesize constraints.
+ * Therefore we do this in a synchronous way that ensures that
+ * at least within `animate()` calls there is no style thrashing.
+ *
+ * In the motion-native-animate-mini-interrupt benchmark this
+ * was 80% faster than a single loop.
+ */
+ const animationDefinitions = [];
+ /**
+ * Step 1: Build options and stop existing animations (write)
+ */
+ for (let i = 0; i < numElements; i++) {
+ const element = elements[i];
+ const elementTransition = { ...options };
+ /**
+ * Resolve stagger function if provided.
+ */
+ if (typeof elementTransition.delay === "function") {
+ elementTransition.delay = elementTransition.delay(i, numElements);
+ }
+ for (const valueName in keyframes) {
+ let valueKeyframes = keyframes[valueName];
+ if (!Array.isArray(valueKeyframes)) {
+ valueKeyframes = [valueKeyframes];
+ }
+ const valueOptions = {
+ ...motionDom.getValueTransition(elementTransition, valueName),
+ };
+ valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration));
+ valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay));
+ /**
+ * If there's an existing animation playing on this element then stop it
+ * before creating a new one.
+ */
+ const map = motionDom.getAnimationMap(element);
+ const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || "");
+ const currentAnimation = map.get(key);
+ currentAnimation && currentAnimation.stop();
+ animationDefinitions.push({
+ map,
+ key,
+ unresolvedKeyframes: valueKeyframes,
+ options: {
+ ...valueOptions,
+ element,
+ name: valueName,
+ allowFlatten: !elementTransition.type && !elementTransition.ease,
+ },
+ });
+ }
+ }
+ /**
+ * Step 2: Resolve keyframes (read)
+ */
+ for (let i = 0; i < animationDefinitions.length; i++) {
+ const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i];
+ const { element, name, pseudoElement } = animationOptions;
+ if (!pseudoElement && unresolvedKeyframes[0] === null) {
+ unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name);
+ }
+ motionDom.fillWildcards(unresolvedKeyframes);
+ motionDom.applyPxDefaults(unresolvedKeyframes, name);
+ /**
+ * If we only have one keyframe, explicitly read the initial keyframe
+ * from the computed style. This is to ensure consistency with WAAPI behaviour
+ * for restarting animations, for instance .play() after finish, when it
+ * has one vs two keyframes.
+ */
+ if (!pseudoElement && unresolvedKeyframes.length < 2) {
+ unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name));
+ }
+ animationOptions.keyframes = unresolvedKeyframes;
+ }
+ /**
+ * Step 3: Create new animations (write)
+ */
+ const animations = [];
+ for (let i = 0; i < animationDefinitions.length; i++) {
+ const { map, key, options: animationOptions } = animationDefinitions[i];
+ const animation = new motionDom.NativeAnimation(animationOptions);
+ map.set(key, animation);
+ animation.finished.finally(() => map.delete(key));
+ animations.push(animation);
+ }
+ return animations;
+}
+
+const createScopedWaapiAnimate = (scope) => {
+ function scopedAnimate(elementOrSelector, keyframes, options) {
+ return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope));
+ }
+ return scopedAnimate;
+};
+const animateMini = /*@__PURE__*/ createScopedWaapiAnimate();
+
+/**
+ * A time in milliseconds, beyond which we consider the scroll velocity to be 0.
+ */
+const maxElapsed = 50;
+const createAxisInfo = () => ({
+ current: 0,
+ offset: [],
+ progress: 0,
+ scrollLength: 0,
+ targetOffset: 0,
+ targetLength: 0,
+ containerLength: 0,
+ velocity: 0,
+});
+const createScrollInfo = () => ({
+ time: 0,
+ x: createAxisInfo(),
+ y: createAxisInfo(),
+});
+const keys = {
+ x: {
+ length: "Width",
+ position: "Left",
+ },
+ y: {
+ length: "Height",
+ position: "Top",
+ },
+};
+function updateAxisInfo(element, axisName, info, time) {
+ const axis = info[axisName];
+ const { length, position } = keys[axisName];
+ const prev = axis.current;
+ const prevTime = info.time;
+ axis.current = element[`scroll${position}`];
+ axis.scrollLength = element[`scroll${length}`] - element[`client${length}`];
+ axis.offset.length = 0;
+ axis.offset[0] = 0;
+ axis.offset[1] = axis.scrollLength;
+ axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current);
+ const elapsed = time - prevTime;
+ axis.velocity =
+ elapsed > maxElapsed
+ ? 0
+ : motionUtils.velocityPerSecond(axis.current - prev, elapsed);
+}
+function updateScrollInfo(element, info, time) {
+ updateAxisInfo(element, "x", info, time);
+ updateAxisInfo(element, "y", info, time);
+ info.time = time;
+}
+
+function calcInset(element, container) {
+ const inset = { x: 0, y: 0 };
+ let current = element;
+ while (current && current !== container) {
+ if (motionDom.isHTMLElement(current)) {
+ inset.x += current.offsetLeft;
+ inset.y += current.offsetTop;
+ current = current.offsetParent;
+ }
+ else if (current.tagName === "svg") {
+ /**
+ * This isn't an ideal approach to measuring the offset of tags.
+ * It would be preferable, given they behave like HTMLElements in most ways
+ * to use offsetLeft/Top. But these don't exist on . Likewise we
+ * can't use .getBBox() like most SVG elements as these provide the offset
+ * relative to the SVG itself, which for is usually 0x0.
+ */
+ const svgBoundingBox = current.getBoundingClientRect();
+ current = current.parentElement;
+ const parentBoundingBox = current.getBoundingClientRect();
+ inset.x += svgBoundingBox.left - parentBoundingBox.left;
+ inset.y += svgBoundingBox.top - parentBoundingBox.top;
+ }
+ else if (current instanceof SVGGraphicsElement) {
+ const { x, y } = current.getBBox();
+ inset.x += x;
+ inset.y += y;
+ let svg = null;
+ let parent = current.parentNode;
+ while (!svg) {
+ if (parent.tagName === "svg") {
+ svg = parent;
+ }
+ parent = current.parentNode;
+ }
+ current = svg;
+ }
+ else {
+ break;
+ }
+ }
+ return inset;
+}
+
+const namedEdges = {
+ start: 0,
+ center: 0.5,
+ end: 1,
+};
+function resolveEdge(edge, length, inset = 0) {
+ let delta = 0;
+ /**
+ * If we have this edge defined as a preset, replace the definition
+ * with the numerical value.
+ */
+ if (edge in namedEdges) {
+ edge = namedEdges[edge];
+ }
+ /**
+ * Handle unit values
+ */
+ if (typeof edge === "string") {
+ const asNumber = parseFloat(edge);
+ if (edge.endsWith("px")) {
+ delta = asNumber;
+ }
+ else if (edge.endsWith("%")) {
+ edge = asNumber / 100;
+ }
+ else if (edge.endsWith("vw")) {
+ delta = (asNumber / 100) * document.documentElement.clientWidth;
+ }
+ else if (edge.endsWith("vh")) {
+ delta = (asNumber / 100) * document.documentElement.clientHeight;
+ }
+ else {
+ edge = asNumber;
+ }
+ }
+ /**
+ * If the edge is defined as a number, handle as a progress value.
+ */
+ if (typeof edge === "number") {
+ delta = length * edge;
+ }
+ return inset + delta;
+}
+
+const defaultOffset = [0, 0];
+function resolveOffset(offset, containerLength, targetLength, targetInset) {
+ let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;
+ let targetPoint = 0;
+ let containerPoint = 0;
+ if (typeof offset === "number") {
+ /**
+ * If we're provided offset: [0, 0.5, 1] then each number x should become
+ * [x, x], so we default to the behaviour of mapping 0 => 0 of both target
+ * and container etc.
+ */
+ offsetDefinition = [offset, offset];
+ }
+ else if (typeof offset === "string") {
+ offset = offset.trim();
+ if (offset.includes(" ")) {
+ offsetDefinition = offset.split(" ");
+ }
+ else {
+ /**
+ * If we're provided a definition like "100px" then we want to apply
+ * that only to the top of the target point, leaving the container at 0.
+ * Whereas a named offset like "end" should be applied to both.
+ */
+ offsetDefinition = [offset, namedEdges[offset] ? offset : `0`];
+ }
+ }
+ targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);
+ containerPoint = resolveEdge(offsetDefinition[1], containerLength);
+ return targetPoint - containerPoint;
+}
+
+const ScrollOffset = {
+ Enter: [
+ [0, 1],
+ [1, 1],
+ ],
+ Exit: [
+ [0, 0],
+ [1, 0],
+ ],
+ Any: [
+ [1, 0],
+ [0, 1],
+ ],
+ All: [
+ [0, 0],
+ [1, 1],
+ ],
+};
+
+const point = { x: 0, y: 0 };
+function getTargetSize(target) {
+ return "getBBox" in target && target.tagName !== "svg"
+ ? target.getBBox()
+ : { width: target.clientWidth, height: target.clientHeight };
+}
+function resolveOffsets(container, info, options) {
+ const { offset: offsetDefinition = ScrollOffset.All } = options;
+ const { target = container, axis = "y" } = options;
+ const lengthLabel = axis === "y" ? "height" : "width";
+ const inset = target !== container ? calcInset(target, container) : point;
+ /**
+ * Measure the target and container. If they're the same thing then we
+ * use the container's scrollWidth/Height as the target, from there
+ * all other calculations can remain the same.
+ */
+ const targetSize = target === container
+ ? { width: container.scrollWidth, height: container.scrollHeight }
+ : getTargetSize(target);
+ const containerSize = {
+ width: container.clientWidth,
+ height: container.clientHeight,
+ };
+ /**
+ * Reset the length of the resolved offset array rather than creating a new one.
+ * TODO: More reusable data structures for targetSize/containerSize would also be good.
+ */
+ info[axis].offset.length = 0;
+ /**
+ * Populate the offset array by resolving the user's offset definition into
+ * a list of pixel scroll offets.
+ */
+ let hasChanged = !info[axis].interpolate;
+ const numOffsets = offsetDefinition.length;
+ for (let i = 0; i < numOffsets; i++) {
+ const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);
+ if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {
+ hasChanged = true;
+ }
+ info[axis].offset[i] = offset;
+ }
+ /**
+ * If the pixel scroll offsets have changed, create a new interpolator function
+ * to map scroll value into a progress.
+ */
+ if (hasChanged) {
+ info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false });
+ info[axis].interpolatorOffsets = [...info[axis].offset];
+ }
+ info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current));
+}
+
+function measure(container, target = container, info) {
+ /**
+ * Find inset of target within scrollable container
+ */
+ info.x.targetOffset = 0;
+ info.y.targetOffset = 0;
+ if (target !== container) {
+ let node = target;
+ while (node && node !== container) {
+ info.x.targetOffset += node.offsetLeft;
+ info.y.targetOffset += node.offsetTop;
+ node = node.offsetParent;
+ }
+ }
+ info.x.targetLength =
+ target === container ? target.scrollWidth : target.clientWidth;
+ info.y.targetLength =
+ target === container ? target.scrollHeight : target.clientHeight;
+ info.x.containerLength = container.clientWidth;
+ info.y.containerLength = container.clientHeight;
+ /**
+ * In development mode ensure scroll containers aren't position: static as this makes
+ * it difficult to measure their relative positions.
+ */
+ if (process.env.NODE_ENV !== "production") {
+ if (container && target && target !== container) {
+ motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.");
+ }
+ }
+}
+function createOnScrollHandler(element, onScroll, info, options = {}) {
+ return {
+ measure: (time) => {
+ measure(element, options.target, info);
+ updateScrollInfo(element, info, time);
+ if (options.offset || options.target) {
+ resolveOffsets(element, info, options);
+ }
+ },
+ notify: () => onScroll(info),
+ };
+}
+
+const scrollListeners = new WeakMap();
+const resizeListeners = new WeakMap();
+const onScrollHandlers = new WeakMap();
+const scrollSize = new WeakMap();
+const dimensionCheckProcesses = new WeakMap();
+const getEventTarget = (element) => element === document.scrollingElement ? window : element;
+function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) {
+ if (!container)
+ return motionUtils.noop;
+ let containerHandlers = onScrollHandlers.get(container);
+ /**
+ * Get the onScroll handlers for this container.
+ * If one isn't found, create a new one.
+ */
+ if (!containerHandlers) {
+ containerHandlers = new Set();
+ onScrollHandlers.set(container, containerHandlers);
+ }
+ /**
+ * Create a new onScroll handler for the provided callback.
+ */
+ const info = createScrollInfo();
+ const containerHandler = createOnScrollHandler(container, onScroll, info, options);
+ containerHandlers.add(containerHandler);
+ /**
+ * Check if there's a scroll event listener for this container.
+ * If not, create one.
+ */
+ if (!scrollListeners.has(container)) {
+ const measureAll = () => {
+ for (const handler of containerHandlers) {
+ handler.measure(motionDom.frameData.timestamp);
+ }
+ motionDom.frame.preUpdate(notifyAll);
+ };
+ const notifyAll = () => {
+ for (const handler of containerHandlers) {
+ handler.notify();
+ }
+ };
+ const listener = () => motionDom.frame.read(measureAll);
+ scrollListeners.set(container, listener);
+ const target = getEventTarget(container);
+ window.addEventListener("resize", listener);
+ if (container !== document.documentElement) {
+ resizeListeners.set(container, motionDom.resize(container, listener));
+ }
+ target.addEventListener("scroll", listener);
+ listener();
+ }
+ /**
+ * Enable content size tracking if requested and not already enabled.
+ */
+ if (trackContentSize && !dimensionCheckProcesses.has(container)) {
+ const listener = scrollListeners.get(container);
+ // Store initial scroll dimensions (object is reused to avoid allocation)
+ const size = {
+ width: container.scrollWidth,
+ height: container.scrollHeight,
+ };
+ scrollSize.set(container, size);
+ // Add frame-based scroll dimension checking to detect content changes
+ const checkScrollDimensions = () => {
+ const newWidth = container.scrollWidth;
+ const newHeight = container.scrollHeight;
+ if (size.width !== newWidth || size.height !== newHeight) {
+ listener();
+ size.width = newWidth;
+ size.height = newHeight;
+ }
+ };
+ // Schedule with keepAlive=true to run every frame
+ const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true);
+ dimensionCheckProcesses.set(container, dimensionCheckProcess);
+ }
+ const listener = scrollListeners.get(container);
+ motionDom.frame.read(listener, false, true);
+ return () => {
+ motionDom.cancelFrame(listener);
+ /**
+ * Check if we even have any handlers for this container.
+ */
+ const currentHandlers = onScrollHandlers.get(container);
+ if (!currentHandlers)
+ return;
+ currentHandlers.delete(containerHandler);
+ if (currentHandlers.size)
+ return;
+ /**
+ * If no more handlers, remove the scroll listener too.
+ */
+ const scrollListener = scrollListeners.get(container);
+ scrollListeners.delete(container);
+ if (scrollListener) {
+ getEventTarget(container).removeEventListener("scroll", scrollListener);
+ resizeListeners.get(container)?.();
+ window.removeEventListener("resize", scrollListener);
+ }
+ // Clean up scroll dimension checking
+ const dimensionCheckProcess = dimensionCheckProcesses.get(container);
+ if (dimensionCheckProcess) {
+ motionDom.cancelFrame(dimensionCheckProcess);
+ dimensionCheckProcesses.delete(container);
+ }
+ scrollSize.delete(container);
+ };
+}
+
+function canUseNativeTimeline(target) {
+ return (typeof window !== "undefined" && !target && motionDom.supportsScrollTimeline());
+}
+
+const timelineCache = new Map();
+function scrollTimelineFallback(options) {
+ const currentTime = { value: 0 };
+ const cancel = scrollInfo((info) => {
+ currentTime.value = info[options.axis].progress * 100;
+ }, options);
+ return { currentTime, cancel };
+}
+function getTimeline({ source, container, ...options }) {
+ const { axis } = options;
+ if (source)
+ container = source;
+ const containerCache = timelineCache.get(container) ?? new Map();
+ timelineCache.set(container, containerCache);
+ const targetKey = options.target ?? "self";
+ const targetCache = containerCache.get(targetKey) ?? {};
+ const axisKey = axis + (options.offset ?? []).join(",");
+ if (!targetCache[axisKey]) {
+ targetCache[axisKey] =
+ canUseNativeTimeline(options.target)
+ ? new ScrollTimeline({ source: container, axis })
+ : scrollTimelineFallback({ container, ...options });
+ }
+ return targetCache[axisKey];
+}
+
+function attachToAnimation(animation, options) {
+ const timeline = getTimeline(options);
+ return animation.attachTimeline({
+ timeline: options.target ? undefined : timeline,
+ observe: (valueAnimation) => {
+ valueAnimation.pause();
+ return motionDom.observeTimeline((progress) => {
+ valueAnimation.time =
+ valueAnimation.iterationDuration * progress;
+ }, timeline);
+ },
+ });
+}
+
+/**
+ * If the onScroll function has two arguments, it's expecting
+ * more specific information about the scroll from scrollInfo.
+ */
+function isOnScrollWithInfo(onScroll) {
+ return onScroll.length === 2;
+}
+function attachToFunction(onScroll, options) {
+ if (isOnScrollWithInfo(onScroll)) {
+ return scrollInfo((info) => {
+ onScroll(info[options.axis].progress, info);
+ }, options);
+ }
+ else {
+ return motionDom.observeTimeline(onScroll, getTimeline(options));
+ }
+}
+
+function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) {
+ if (!container)
+ return motionUtils.noop;
+ const optionsWithDefaults = { axis, container, ...options };
+ return typeof onScroll === "function"
+ ? attachToFunction(onScroll, optionsWithDefaults)
+ : attachToAnimation(onScroll, optionsWithDefaults);
+}
+
+const thresholds = {
+ some: 0,
+ all: 1,
+};
+function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) {
+ const elements = motionDom.resolveElements(elementOrSelector);
+ const activeIntersections = new WeakMap();
+ const onIntersectionChange = (entries) => {
+ entries.forEach((entry) => {
+ const onEnd = activeIntersections.get(entry.target);
+ /**
+ * If there's no change to the intersection, we don't need to
+ * do anything here.
+ */
+ if (entry.isIntersecting === Boolean(onEnd))
+ return;
+ if (entry.isIntersecting) {
+ const newOnEnd = onStart(entry.target, entry);
+ if (typeof newOnEnd === "function") {
+ activeIntersections.set(entry.target, newOnEnd);
+ }
+ else {
+ observer.unobserve(entry.target);
+ }
+ }
+ else if (typeof onEnd === "function") {
+ onEnd(entry);
+ activeIntersections.delete(entry.target);
+ }
+ });
+ };
+ const observer = new IntersectionObserver(onIntersectionChange, {
+ root,
+ rootMargin,
+ threshold: typeof amount === "number" ? amount : thresholds[amount],
+ });
+ elements.forEach((element) => observer.observe(element));
+ return () => observer.disconnect();
+}
+
+const distance = (a, b) => Math.abs(a - b);
+function distance2D(a, b) {
+ // Multi-dimensional
+ const xDelta = distance(a.x, b.x);
+ const yDelta = distance(a.y, b.y);
+ return Math.sqrt(xDelta ** 2 + yDelta ** 2);
+}
+
+Object.defineProperty(exports, "delay", {
+ enumerable: true,
+ get: function () { return motionDom.delayInSeconds; }
+});
+exports.animate = animate;
+exports.animateMini = animateMini;
+exports.createScopedAnimate = createScopedAnimate;
+exports.distance = distance;
+exports.distance2D = distance2D;
+exports.inView = inView;
+exports.scroll = scroll;
+exports.scrollInfo = scrollInfo;
+Object.keys(motionDom).forEach(function (k) {
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
+ enumerable: true,
+ get: function () { return motionDom[k]; }
+ });
+});
+Object.keys(motionUtils).forEach(function (k) {
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
+ enumerable: true,
+ get: function () { return motionUtils[k]; }
+ });
+});
+//# sourceMappingURL=dom.js.map
diff --git a/node_modules/framer-motion/dist/cjs/dom.js.map b/node_modules/framer-motion/dist/cjs/dom.js.map
new file mode 100644
index 0000000..b7167a1
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/dom.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"dom.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/utils/distance.ts"],"sourcesContent":["import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n","import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n","export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n _repeatDelay: number\n): number {\n return duration * (repeat + 1)\n}\n","import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n current: number,\n next: SequenceTime,\n prev: number,\n labels: Map\n): number {\n if (typeof next === \"number\") {\n return next\n } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next))\n } else if (next === \"<\") {\n return prev\n } else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)))\n } else {\n return labels.get(next) ?? current\n }\n}\n","import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n sequence: ValueSequence,\n startTime: number,\n endTime: number\n): void {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i]\n\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe)\n\n // If we remove this item we have to push the pointer back one\n i--\n }\n }\n}\n\nexport function addKeyframes(\n sequence: ValueSequence,\n keyframes: UnresolvedValueKeyframe[],\n easing: Easing | Easing[],\n offset: number[],\n startTime: number,\n endTime: number\n): void {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime)\n\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n })\n }\n}\n","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times: number[], repeat: number): void {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1)\n }\n}\n","import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n","import {\n AnimationScope,\n createGeneratorEasing,\n defaultOffset,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n fillOffset,\n GeneratorFactory,\n isGenerator,\n isMotionValue,\n Transition,\n UnresolvedValueKeyframe,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport {\n Easing,\n getEasingForSegment,\n invariant,\n progress,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n AnimationSequence,\n At,\n ResolvedAnimationDefinitions,\n SequenceMap,\n SequenceOptions,\n ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n sequence: AnimationSequence,\n { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n scope?: AnimationScope,\n generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n const defaultDuration = defaultTransition.duration || 0.3\n const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n const sequences = new Map()\n const elementCache = {}\n const timeLabels = new Map()\n\n let prevTime = 0\n let currentTime = 0\n let totalDuration = 0\n\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i]\n\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime)\n continue\n } else if (!Array.isArray(segment)) {\n timeLabels.set(\n segment.name,\n calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n )\n continue\n }\n\n let [subject, keyframes, transition = {}] = segment\n\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(\n currentTime,\n transition.at,\n prevTime,\n timeLabels\n )\n }\n\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0\n\n const resolveValueSequence = (\n valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n valueTransition: Transition | DynamicAnimationOptions,\n valueSequence: ValueSequence,\n elementIndex = 0,\n numSubjects = 0\n ) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n const {\n delay = 0,\n times = defaultOffset(valueKeyframesAsList),\n type = defaultTransition.type || \"keyframes\",\n repeat,\n repeatType,\n repeatDelay = 0,\n ...remainingTransition\n } = valueTransition\n let { ease = defaultTransition.ease || \"easeOut\", duration } =\n valueTransition\n\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay =\n typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay\n\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"]\n\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100\n if (\n numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)\n ) {\n const delta =\n valueKeyframesAsList[1] - valueKeyframesAsList[0]\n absoluteDelta = Math.abs(delta)\n }\n\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n }\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration)\n }\n\n const springEasing = createGeneratorEasing(\n springTransition,\n absoluteDelta,\n createGenerator\n )\n\n ease = springEasing.ease\n duration = springEasing.duration\n }\n\n duration ??= defaultDuration\n\n const startTime = currentTime + calculatedDelay\n\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1\n }\n\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length\n remainder > 0 && fillOffset(times, remainder)\n\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null)\n\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(\n repeat < MAX_REPEAT,\n \"Repeat count too high, must be less than 20\",\n \"repeat-count-high\"\n )\n\n duration = calculateRepeatDuration(\n duration,\n repeat,\n repeatDelay\n )\n\n const originalKeyframes = [...valueKeyframesAsList]\n const originalTimes = [...times]\n ease = Array.isArray(ease) ? [...ease] : [ease]\n const originalEase = [...ease]\n\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes)\n\n for (\n let keyframeIndex = 0;\n keyframeIndex < originalKeyframes.length;\n keyframeIndex++\n ) {\n times.push(\n originalTimes[keyframeIndex] + (repeatIndex + 1)\n )\n ease.push(\n keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(\n originalEase,\n keyframeIndex - 1\n )\n )\n }\n }\n\n normalizeTimes(times, repeat)\n }\n\n const targetTime = startTime + duration\n\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(\n valueSequence,\n valueKeyframesAsList,\n ease as Easing | Easing[],\n times,\n startTime,\n targetTime\n )\n\n maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n totalDuration = Math.max(targetTime, totalDuration)\n }\n\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences)\n resolveValueSequence(\n keyframes as AnyResolvedKeyframe,\n transition,\n getValueSequence(\"default\", subjectSequence)\n )\n } else {\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope,\n elementCache\n )\n\n const numSubjects = subjects.length\n\n /**\n * For every element in this segment, process the defined values.\n */\n for (\n let subjectIndex = 0;\n subjectIndex < numSubjects;\n subjectIndex++\n ) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes as DOMKeyframesDefinition\n transition = transition as DynamicAnimationOptions\n\n const thisSubject = subjects[subjectIndex]\n const subjectSequence = getSubjectSequence(\n thisSubject,\n sequences\n )\n\n for (const key in keyframes) {\n resolveValueSequence(\n keyframes[\n key as keyof typeof keyframes\n ] as UnresolvedValueKeyframe,\n getValueTransition(transition, key),\n getValueSequence(key, subjectSequence),\n subjectIndex,\n numSubjects\n )\n }\n }\n }\n\n prevTime = currentTime\n currentTime += maxDuration\n }\n\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key]\n\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime)\n\n const keyframes: UnresolvedValueKeyframe[] = []\n const valueOffset: number[] = []\n const valueEasing: Easing[] = []\n\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i]\n keyframes.push(value)\n valueOffset.push(progress(0, totalDuration, at))\n valueEasing.push(easing || \"easeOut\")\n }\n\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0)\n keyframes.unshift(keyframes[0])\n valueEasing.unshift(defaultSegmentEasing)\n }\n\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1)\n keyframes.push(null)\n }\n\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n })\n }\n\n const definition = animationDefinitions.get(element)!\n\n definition.keyframes[key] = keyframes\n\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } =\n defaultTransition\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n }\n }\n })\n\n return animationDefinitions\n}\n\nfunction getSubjectSequence(\n subject: Element | MotionValue | O,\n sequences: Map\n): SequenceMap {\n !sequences.has(subject) && sequences.set(subject, {})\n return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n if (!sequences[name]) sequences[name] = []\n return sequences[name]\n}\n\nfunction keyframesAsList(\n keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n transition: DynamicAnimationOptions & At,\n key: string\n): DynamicAnimationOptions {\n return transition && transition[key as keyof typeof transition]\n ? {\n ...transition,\n ...(transition[key as keyof typeof transition] as Transition),\n }\n : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n","import {\n HTMLVisualElement,\n isSVGElement,\n isSVGSVGElement,\n ObjectVisualElement,\n SVGVisualElement,\n visualElementStore,\n} from \"motion-dom\"\n\nexport function createDOMVisualElement(element: HTMLElement | SVGElement) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n }\n const node =\n isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options)\n\n node.mount(element as any)\n\n visualElementStore.set(element, node)\n}\n\nexport function createObjectVisualElement(subject: Object) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n }\n const node = new ObjectVisualElement(options)\n\n node.mount(subject)\n\n visualElementStore.set(subject, node)\n}\n","import {\n animateTarget,\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n AnyResolvedKeyframe,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n isMotionValue,\n MotionValue,\n TargetAndTransition,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n visualElementStore,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport {\n createDOMVisualElement,\n createObjectVisualElement,\n} from \"../utils/create-visual-element\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\nimport { resolveSubjects } from \"./resolve-subjects\"\nimport { animateSingleValue } from \"motion-dom\"\n\nexport type AnimationSubject = Element | MotionValue | any\n\nfunction isSingleValue(\n subject: unknown,\n keyframes: unknown\n): subject is MotionValue | AnyResolvedKeyframe {\n return (\n isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes))\n )\n}\n\n/**\n * Animate a string\n */\nexport function animateSubject(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a Element\n */\nexport function animateSubject(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a object\n */\nexport function animateSubject(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[] {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n if (isSingleValue(subject, keyframes)) {\n animations.push(\n animateSingleValue(\n subject,\n isDOMKeyframes(keyframes)\n ? (keyframes as any).default || keyframes\n : keyframes,\n options ? (options as any).default || options : options\n )\n )\n } else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations\n }\n\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope\n )\n\n const numSubjects = subjects.length\n\n invariant(\n Boolean(numSubjects),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i]\n\n const createVisualElement =\n thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement\n\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject as any)\n }\n\n const visualElement = visualElementStore.get(thisSubject)!\n const transition = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (\n \"delay\" in transition &&\n typeof transition.delay === \"function\"\n ) {\n transition.delay = transition.delay(i, numSubjects)\n }\n\n animations.push(\n ...animateTarget(\n visualElement,\n { ...(keyframes as {}), transition } as TargetAndTransition,\n {}\n )\n )\n }\n }\n\n return animations\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n motionValue,\n spring,\n} from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../sequence/types\"\nimport { animateSubject } from \"./subject\"\n\nexport function animateSequence(\n sequence: AnimationSequence,\n options?: SequenceOptions,\n scope?: AnimationScope\n) {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n /**\n * Pre-process: replace function segments with MotionValue segments,\n * subscribe callbacks immediately\n */\n const processedSequence = sequence.map((segment) => {\n if (Array.isArray(segment) && typeof segment[0] === \"function\") {\n const callback = segment[0] as (value: any) => void\n const mv = motionValue(0)\n mv.on(\"change\", callback)\n\n if (segment.length === 1) {\n return [mv, [0, 1]] as any\n } else if (segment.length === 2) {\n return [mv, [0, 1], segment[1]] as any\n } else {\n return [mv, segment[1], segment[2]] as any\n }\n }\n return segment\n }) as AnimationSequence\n\n const animationDefinitions = createAnimationsFromSequence(\n processedSequence,\n options,\n scope,\n { spring }\n )\n\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition))\n })\n\n return animations\n}\n","import type {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n MotionValue,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"motion-dom\"\nimport { GroupAnimationWithThen } from \"motion-dom\"\nimport { removeItem } from \"motion-utils\"\nimport {\n AnimationSequence,\n ObjectTarget,\n SequenceOptions,\n} from \"../sequence/types\"\nimport { animateSequence } from \"./sequence\"\nimport { animateSubject } from \"./subject\"\n\nfunction isSequence(value: unknown): value is AnimationSequence {\n return Array.isArray(value) && value.some(Array.isArray)\n}\n\ninterface ScopedAnimateOptions {\n scope?: AnimationScope\n reduceMotion?: boolean\n}\n\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options: ScopedAnimateOptions = {}) {\n const { scope, reduceMotion } = options\n /**\n * Animate a sequence\n */\n function scopedAnimate(\n sequence: AnimationSequence,\n options?: SequenceOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a string\n */\n function scopedAnimate(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an Element\n */\n function scopedAnimate(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an object\n */\n function scopedAnimate(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n let animations: AnimationPlaybackControlsWithThen[] = []\n let animationOnComplete: VoidFunction | undefined\n\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(\n subjectOrSequence,\n reduceMotion !== undefined\n ? { reduceMotion, ...(optionsOrKeyframes as SequenceOptions) }\n : (optionsOrKeyframes as SequenceOptions),\n scope\n )\n } else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {}\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete as VoidFunction\n }\n animations = animateSubject(\n subjectOrSequence as ElementOrSelector,\n optionsOrKeyframes as DOMKeyframesDefinition,\n (reduceMotion !== undefined\n ? { reduceMotion, ...rest }\n : rest) as DynamicAnimationOptions,\n scope\n )\n }\n\n const animation = new GroupAnimationWithThen(animations)\n\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete)\n }\n\n if (scope) {\n scope.animations.push(animation)\n animation.finished.then(() => {\n removeItem(scope.animations, animation)\n })\n }\n\n return animation\n }\n\n return scopedAnimate\n}\n\nexport const animate = createScopedAnimate()\n","import {\n animationMapKey,\n AnimationPlaybackControls,\n AnimationScope,\n applyPxDefaults,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n fillWildcards,\n getAnimationMap,\n getComputedStyle,\n getValueTransition,\n NativeAnimation,\n NativeAnimationOptions,\n resolveElements,\n UnresolvedValueKeyframe,\n ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n map: Map>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\n keyframes?: ValueKeyframe[]\n }\n}\n\nexport function animateElements(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return []\n }\n\n const elements = resolveElements(elementOrSelector, scope) as Array<\n HTMLElement | SVGElement\n >\n const numElements = elements.length\n\n invariant(\n Boolean(numElements),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions: AnimationDefinition[] = []\n\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i]\n const elementTransition: DynamicAnimationOptions = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements)\n }\n\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes]\n }\n\n const valueOptions = {\n ...getValueTransition(elementTransition as any, valueName),\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element)\n const key = animationMapKey(\n valueName,\n valueOptions.pseudoElement || \"\"\n )\n const currentAnimation = map.get(key)\n currentAnimation && currentAnimation.stop()\n\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten:\n !elementTransition.type && !elementTransition.ease,\n },\n })\n }\n }\n\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } =\n animationDefinitions[i]\n\n const { element, name, pseudoElement } = animationOptions\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name)\n }\n\n fillWildcards(unresolvedKeyframes)\n applyPxDefaults(unresolvedKeyframes, name)\n\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name))\n }\n\n animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n }\n\n /**\n * Step 3: Create new animations (write)\n */\n const animations: AnimationPlaybackControls[] = []\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i]\n const animation = new NativeAnimation(\n animationOptions as NativeAnimationOptions\n )\n\n map.set(key, animation)\n animation.finished.finally(() => map.delete(key))\n\n animations.push(animation)\n }\n\n return animations\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n","import { progress, velocityPerSecond } from \"motion-utils\"\nimport { AxisScrollInfo, ScrollInfo } from \"./types\"\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50\n\nconst createAxisInfo = (): AxisScrollInfo => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n})\n\nexport const createScrollInfo = (): ScrollInfo => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n})\n\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n} as const\n\nfunction updateAxisInfo(\n element: Element,\n axisName: \"x\" | \"y\",\n info: ScrollInfo,\n time: number\n) {\n const axis = info[axisName]\n const { length, position } = keys[axisName]\n\n const prev = axis.current\n const prevTime = info.time\n\n axis.current = element[`scroll${position}`]\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]\n\n axis.offset.length = 0\n axis.offset[0] = 0\n axis.offset[1] = axis.scrollLength\n axis.progress = progress(0, axis.scrollLength, axis.current)\n\n const elapsed = time - prevTime\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed)\n}\n\nexport function updateScrollInfo(\n element: Element,\n info: ScrollInfo,\n time: number\n) {\n updateAxisInfo(element, \"x\", info, time)\n updateAxisInfo(element, \"y\", info, time)\n info.time = time\n}\n","import { isHTMLElement } from \"motion-dom\"\n\nexport function calcInset(element: Element, container: Element) {\n const inset = { x: 0, y: 0 }\n\n let current: Element | null = element\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft\n inset.y += current.offsetTop\n current = current.offsetParent\n } else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect()\n current = current.parentElement!\n const parentBoundingBox = current.getBoundingClientRect()\n inset.x += svgBoundingBox.left - parentBoundingBox.left\n inset.y += svgBoundingBox.top - parentBoundingBox.top\n } else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox()\n inset.x += x\n inset.y += y\n\n let svg: SVGElement | null = null\n let parent: SVGElement = current.parentNode as SVGElement\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent\n }\n parent = current.parentNode as SVGElement\n }\n current = svg\n } else {\n break\n }\n }\n\n return inset\n}\n","import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record = {\n start: 0,\n center: 0.5,\n end: 1,\n}\n\nexport function resolveEdge(edge: Edge, length: number, inset = 0) {\n let delta = 0\n\n /**\n * If we have this edge defined as a preset, replace the definition\n * with the numerical value.\n */\n if (edge in namedEdges) {\n edge = namedEdges[edge as NamedEdges]\n }\n\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge)\n\n if (edge.endsWith(\"px\")) {\n delta = asNumber\n } else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100\n } else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth\n } else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight\n } else {\n edge = asNumber\n }\n }\n\n /**\n * If the edge is defined as a number, handle as a progress value.\n */\n if (typeof edge === \"number\") {\n delta = length * edge\n }\n\n return inset + delta\n}\n","import { Edge, EdgeString, Intersection, ProgressIntersection } from \"../types\"\nimport { namedEdges, resolveEdge } from \"./edge\"\n\nconst defaultOffset: ProgressIntersection = [0, 0]\n\nexport function resolveOffset(\n offset: Edge | Intersection | ProgressIntersection,\n containerLength: number,\n targetLength: number,\n targetInset: number\n) {\n let offsetDefinition: ProgressIntersection | [EdgeString, EdgeString] =\n Array.isArray(offset) ? offset : defaultOffset\n\n let targetPoint = 0\n let containerPoint = 0\n\n if (typeof offset === \"number\") {\n /**\n * If we're provided offset: [0, 0.5, 1] then each number x should become\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n * and container etc.\n */\n offsetDefinition = [offset, offset]\n } else if (typeof offset === \"string\") {\n offset = offset.trim() as EdgeString\n\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \") as [EdgeString, EdgeString]\n } else {\n /**\n * If we're provided a definition like \"100px\" then we want to apply\n * that only to the top of the target point, leaving the container at 0.\n * Whereas a named offset like \"end\" should be applied to both.\n */\n offsetDefinition = [offset, namedEdges[offset as keyof typeof namedEdges] ? offset : `0`]\n }\n }\n\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset)\n containerPoint = resolveEdge(offsetDefinition[1], containerLength)\n\n return targetPoint - containerPoint\n}\n","import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record = {\n Enter: [\n [0, 1],\n [1, 1],\n ],\n Exit: [\n [0, 0],\n [1, 0],\n ],\n Any: [\n [1, 0],\n [0, 1],\n ],\n All: [\n [0, 0],\n [1, 1],\n ],\n}\n","import { defaultOffset, interpolate } from \"motion-dom\"\nimport { clamp } from \"motion-utils\"\nimport { ScrollInfo, ScrollInfoOptions } from \"../types\"\nimport { calcInset } from \"./inset\"\nimport { resolveOffset } from \"./offset\"\nimport { ScrollOffset } from \"./presets\"\n\nconst point = { x: 0, y: 0 }\n\nfunction getTargetSize(target: Element) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? (target as SVGGraphicsElement).getBBox()\n : { width: target.clientWidth, height: target.clientHeight }\n}\n\nexport function resolveOffsets(\n container: Element,\n info: ScrollInfo,\n options: ScrollInfoOptions\n) {\n const { offset: offsetDefinition = ScrollOffset.All } = options\n const { target = container, axis = \"y\" } = options\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\"\n\n const inset = target !== container ? calcInset(target, container) : point\n\n /**\n * Measure the target and container. If they're the same thing then we\n * use the container's scrollWidth/Height as the target, from there\n * all other calculations can remain the same.\n */\n const targetSize =\n target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target)\n\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\n }\n\n /**\n * Reset the length of the resolved offset array rather than creating a new one.\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\n */\n info[axis].offset.length = 0\n\n /**\n * Populate the offset array by resolving the user's offset definition into\n * a list of pixel scroll offets.\n */\n let hasChanged = !info[axis].interpolate\n\n const numOffsets = offsetDefinition.length\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(\n offsetDefinition[i],\n containerSize[lengthLabel],\n targetSize[lengthLabel],\n inset[axis]\n )\n\n if (!hasChanged && offset !== info[axis].interpolatorOffsets![i]) {\n hasChanged = true\n }\n\n info[axis].offset[i] = offset\n }\n\n /**\n * If the pixel scroll offsets have changed, create a new interpolator function\n * to map scroll value into a progress.\n */\n if (hasChanged) {\n info[axis].interpolate = interpolate(\n info[axis].offset,\n defaultOffset(offsetDefinition),\n { clamp: false }\n )\n\n info[axis].interpolatorOffsets = [...info[axis].offset]\n }\n\n info[axis].progress = clamp(\n 0,\n 1,\n info[axis].interpolate!(info[axis].current)\n )\n}\n","import { warnOnce } from \"motion-utils\"\nimport { updateScrollInfo } from \"./info\"\nimport { resolveOffsets } from \"./offsets/index\"\nimport {\n OnScrollHandler,\n OnScrollInfo,\n ScrollInfo,\n ScrollInfoOptions,\n} from \"./types\"\n\nfunction measure(\n container: Element,\n target: Element = container,\n info: ScrollInfo\n) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0\n info.y.targetOffset = 0\n if (target !== container) {\n let node = target as HTMLElement\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft\n info.y.targetOffset += node.offsetTop\n node = node.offsetParent as HTMLElement\n }\n }\n\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight\n info.x.containerLength = container.clientWidth\n info.y.containerLength = container.clientHeight\n\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(\n getComputedStyle(container).position !== \"static\",\n \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\"\n )\n }\n }\n}\n\nexport function createOnScrollHandler(\n element: Element,\n onScroll: OnScrollInfo,\n info: ScrollInfo,\n options: ScrollInfoOptions = {}\n): OnScrollHandler {\n return {\n measure: (time) => {\n measure(element, options.target, info)\n updateScrollInfo(element, info, time)\n\n if (options.offset || options.target) {\n resolveOffsets(element, info, options)\n }\n },\n notify: () => onScroll(info),\n }\n}\n","import { cancelFrame, frame, frameData, resize, Process } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { createScrollInfo } from \"./info\"\nimport { createOnScrollHandler } from \"./on-scroll-handler\"\nimport { OnScrollHandler, OnScrollInfo, ScrollInfoOptions } from \"./types\"\n\nconst scrollListeners = new WeakMap()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\n\nconst getEventTarget = (element: Element) =>\n element === document.scrollingElement ? window : element\n\nexport function scrollInfo(\n onScroll: OnScrollInfo,\n {\n container = document.scrollingElement as Element,\n trackContentSize = false,\n ...options\n }: ScrollInfoOptions = {}\n) {\n if (!container) return noop as VoidFunction\n\n let containerHandlers = onScrollHandlers.get(container)\n\n /**\n * Get the onScroll handlers for this container.\n * If one isn't found, create a new one.\n */\n if (!containerHandlers) {\n containerHandlers = new Set()\n onScrollHandlers.set(container, containerHandlers)\n }\n\n /**\n * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo()\n const containerHandler = createOnScrollHandler(\n container,\n onScroll,\n info,\n options\n )\n containerHandlers.add(containerHandler)\n\n /**\n * Check if there's a scroll event listener for this container.\n * If not, create one.\n */\n if (!scrollListeners.has(container)) {\n const measureAll = () => {\n for (const handler of containerHandlers) {\n handler.measure(frameData.timestamp)\n }\n\n frame.preUpdate(notifyAll)\n }\n\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify()\n }\n }\n\n const listener = () => frame.read(measureAll)\n\n scrollListeners.set(container, listener)\n\n const target = getEventTarget(container)\n window.addEventListener(\"resize\", listener)\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener))\n }\n\n target.addEventListener(\"scroll\", listener)\n\n listener()\n }\n\n /**\n * Enable content size tracking if requested and not already enabled.\n */\n if (trackContentSize && !dimensionCheckProcesses.has(container)) {\n const listener = scrollListeners.get(container)!\n\n // Store initial scroll dimensions (object is reused to avoid allocation)\n const size = {\n width: container.scrollWidth,\n height: container.scrollHeight,\n }\n scrollSize.set(container, size)\n\n // Add frame-based scroll dimension checking to detect content changes\n const checkScrollDimensions: Process = () => {\n const newWidth = container.scrollWidth\n const newHeight = container.scrollHeight\n\n if (size.width !== newWidth || size.height !== newHeight) {\n listener()\n size.width = newWidth\n size.height = newHeight\n }\n }\n\n // Schedule with keepAlive=true to run every frame\n const dimensionCheckProcess = frame.read(checkScrollDimensions, true)\n dimensionCheckProcesses.set(container, dimensionCheckProcess)\n }\n\n const listener = scrollListeners.get(container)!\n frame.read(listener, false, true)\n\n return () => {\n cancelFrame(listener)\n\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container)\n if (!currentHandlers) return\n\n currentHandlers.delete(containerHandler)\n\n if (currentHandlers.size) return\n\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container)\n scrollListeners.delete(container)\n\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\n \"scroll\",\n scrollListener\n )\n resizeListeners.get(container)?.()\n window.removeEventListener(\"resize\", scrollListener)\n }\n\n // Clean up scroll dimension checking\n const dimensionCheckProcess = dimensionCheckProcesses.get(container)\n if (dimensionCheckProcess) {\n cancelFrame(dimensionCheckProcess)\n dimensionCheckProcesses.delete(container)\n }\n scrollSize.delete(container)\n }\n}\n","import { supportsScrollTimeline } from \"motion-dom\"\n\nexport function canUseNativeTimeline(target?: Element) {\n return (\n typeof window !== \"undefined\" && !target && supportsScrollTimeline()\n )\n}\n","import { ProgressTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"../track\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n Element,\n Map\n>()\n\nfunction scrollTimelineFallback(options: ScrollOptionsWithDefaults) {\n const currentTime = { value: 0 }\n\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis!].progress * 100\n }, options)\n\n return { currentTime, cancel }\n}\n\nexport function getTimeline({\n source,\n container,\n ...options\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n const { axis } = options\n\n if (source) container = source\n\n const containerCache = timelineCache.get(container) ?? new Map()\n timelineCache.set(container, containerCache)\n\n const targetKey = options.target ?? \"self\"\n const targetCache = containerCache.get(targetKey) ?? {}\n\n const axisKey = axis + (options.offset ?? []).join(\",\")\n\n if (!targetCache[axisKey]) {\n targetCache[axisKey] =\n canUseNativeTimeline(options.target)\n ? new ScrollTimeline({ source: container, axis } as any)\n : scrollTimelineFallback({ container, ...options })\n }\n\n return targetCache[axisKey]!\n}\n","import { AnimationPlaybackControls, observeTimeline } from \"motion-dom\"\nimport { ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\nexport function attachToAnimation(\n animation: AnimationPlaybackControls,\n options: ScrollOptionsWithDefaults\n) {\n const timeline = getTimeline(options)\n\n return animation.attachTimeline({\n timeline: options.target ? undefined : timeline,\n observe: (valueAnimation) => {\n valueAnimation.pause()\n\n return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress\n }, timeline)\n },\n })\n}\n","import { observeTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"./track\"\nimport { OnScroll, OnScrollWithInfo, ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\n/**\n * If the onScroll function has two arguments, it's expecting\n * more specific information about the scroll from scrollInfo.\n */\nfunction isOnScrollWithInfo(onScroll: OnScroll): onScroll is OnScrollWithInfo {\n return onScroll.length === 2\n}\n\nexport function attachToFunction(\n onScroll: OnScroll,\n options: ScrollOptionsWithDefaults\n) {\n if (isOnScrollWithInfo(onScroll)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis!].progress, info)\n }, options)\n } else {\n return observeTimeline(onScroll, getTimeline(options))\n }\n}\n","import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { attachToFunction } from \"./attach-function\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n onScroll: OnScroll | AnimationPlaybackControls,\n {\n axis = \"y\",\n container = document.scrollingElement as Element,\n ...options\n }: ScrollOptions = {}\n): VoidFunction {\n if (!container) return noop as VoidFunction\n\n const optionsWithDefaults = { axis, container, ...options }\n\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults)\n}\n","import { ElementOrSelector, resolveElements } from \"motion-dom\"\n\nexport type ViewChangeHandler = (entry: IntersectionObserverEntry) => void\n\ntype MarginValue = `${number}${\"px\" | \"%\"}`\ntype MarginType =\n | MarginValue\n | `${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`\n\nexport interface InViewOptions {\n root?: Element | Document\n margin?: MarginType\n amount?: \"some\" | \"all\" | number\n}\n\nconst thresholds = {\n some: 0,\n all: 1,\n}\n\nexport function inView(\n elementOrSelector: ElementOrSelector,\n onStart: (\n element: Element,\n entry: IntersectionObserverEntry\n ) => void | ViewChangeHandler,\n { root, margin: rootMargin, amount = \"some\" }: InViewOptions = {}\n): VoidFunction {\n const elements = resolveElements(elementOrSelector)\n\n const activeIntersections = new WeakMap()\n\n const onIntersectionChange: IntersectionObserverCallback = (entries) => {\n entries.forEach((entry) => {\n const onEnd = activeIntersections.get(entry.target)\n\n /**\n * If there's no change to the intersection, we don't need to\n * do anything here.\n */\n if (entry.isIntersecting === Boolean(onEnd)) return\n\n if (entry.isIntersecting) {\n const newOnEnd = onStart(entry.target, entry)\n if (typeof newOnEnd === \"function\") {\n activeIntersections.set(entry.target, newOnEnd)\n } else {\n observer.unobserve(entry.target)\n }\n } else if (typeof onEnd === \"function\") {\n onEnd(entry)\n activeIntersections.delete(entry.target)\n }\n })\n }\n\n const observer = new IntersectionObserver(onIntersectionChange, {\n root,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n })\n\n elements.forEach((element) => observer.observe(element))\n\n return () => observer.disconnect()\n}\n","import { Point } from \"motion-utils\"\n\nexport const distance = (a: number, b: number) => Math.abs(a - b)\n\nexport function distance2D(a: Point, b: Point): number {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x)\n const yDelta = distance(a.y, b.y)\n return Math.sqrt(xDelta ** 2 + yDelta ** 2)\n}\n"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","invariant","isMotionValue","progress","isSVGElement","isSVGSVGElement","SVGVisualElement","HTMLVisualElement","visualElementStore","ObjectVisualElement","animateSingleValue","animateTarget","motionValue","spring","GroupAnimationWithThen","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","velocityPerSecond","isHTMLElement","interpolate","clamp","warnOnce","noop","frameData","frame","resize","cancelFrame","supportsScrollTimeline","observeTimeline"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACrE;;ACGM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE,CAAA;KACZ;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAOA,yBAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,CAAA;KACxD;AAAM,SAAA,IAAI,OAAO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AAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAA;AAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/framer-motion/dist/cjs/feature-bundle-CUI5saed.js b/node_modules/framer-motion/dist/cjs/feature-bundle-CUI5saed.js
new file mode 100644
index 0000000..5ca9765
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/feature-bundle-CUI5saed.js
@@ -0,0 +1,2377 @@
+'use strict';
+
+var motionDom = require('motion-dom');
+var React = require('react');
+var jsxRuntime = require('react/jsx-runtime');
+var motionUtils = require('motion-utils');
+
+const LayoutGroupContext = React.createContext({});
+
+/**
+ * Creates a constant value over the lifecycle of a component.
+ *
+ * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
+ * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
+ * you can ensure that initialisers don't execute twice or more.
+ */
+function useConstant(init) {
+ const ref = React.useRef(null);
+ if (ref.current === null) {
+ ref.current = init();
+ }
+ return ref.current;
+}
+
+const isBrowser = typeof window !== "undefined";
+
+const useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect;
+
+/**
+ * @public
+ */
+const PresenceContext =
+/* @__PURE__ */ React.createContext(null);
+
+/**
+ * @public
+ */
+const MotionConfigContext = React.createContext({
+ transformPagePoint: (p) => p,
+ isStatic: false,
+ reducedMotion: "never",
+});
+
+/**
+ * When a component is the child of `AnimatePresence`, it can use `usePresence`
+ * to access information about whether it's still present in the React tree.
+ *
+ * ```jsx
+ * import { usePresence } from "framer-motion"
+ *
+ * export const Component = () => {
+ * const [isPresent, safeToRemove] = usePresence()
+ *
+ * useEffect(() => {
+ * !isPresent && setTimeout(safeToRemove, 1000)
+ * }, [isPresent])
+ *
+ * return
+ * }
+ * ```
+ *
+ * If `isPresent` is `false`, it means that a component has been removed from the tree,
+ * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.
+ *
+ * @public
+ */
+function usePresence(subscribe = true) {
+ const context = React.useContext(PresenceContext);
+ if (context === null)
+ return [true, null];
+ const { isPresent, onExitComplete, register } = context;
+ // It's safe to call the following hooks conditionally (after an early return) because the context will always
+ // either be null or non-null for the lifespan of the component.
+ const id = React.useId();
+ React.useEffect(() => {
+ if (subscribe) {
+ return register(id);
+ }
+ }, [subscribe]);
+ const safeToRemove = React.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);
+ return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
+}
+/**
+ * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
+ * There is no `safeToRemove` function.
+ *
+ * ```jsx
+ * import { useIsPresent } from "framer-motion"
+ *
+ * export const Component = () => {
+ * const isPresent = useIsPresent()
+ *
+ * useEffect(() => {
+ * !isPresent && console.log("I've been removed!")
+ * }, [isPresent])
+ *
+ * return
+ * }
+ * ```
+ *
+ * @public
+ */
+function useIsPresent() {
+ return isPresent(React.useContext(PresenceContext));
+}
+function isPresent(context) {
+ return context === null ? true : context.isPresent;
+}
+
+const LazyContext = React.createContext({ strict: false });
+
+const featureProps = {
+ animation: [
+ "animate",
+ "variants",
+ "whileHover",
+ "whileTap",
+ "exit",
+ "whileInView",
+ "whileFocus",
+ "whileDrag",
+ ],
+ exit: ["exit"],
+ drag: ["drag", "dragControls"],
+ focus: ["whileFocus"],
+ hover: ["whileHover", "onHoverStart", "onHoverEnd"],
+ tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
+ pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
+ inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
+ layout: ["layout", "layoutId"],
+};
+let isInitialized = false;
+/**
+ * Initialize feature definitions with isEnabled checks.
+ * This must be called before any motion components are rendered.
+ */
+function initFeatureDefinitions() {
+ if (isInitialized)
+ return;
+ const initialFeatureDefinitions = {};
+ for (const key in featureProps) {
+ initialFeatureDefinitions[key] = {
+ isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
+ };
+ }
+ motionDom.setFeatureDefinitions(initialFeatureDefinitions);
+ isInitialized = true;
+}
+/**
+ * Get the current feature definitions, initializing if needed.
+ */
+function getInitializedFeatureDefinitions() {
+ initFeatureDefinitions();
+ return motionDom.getFeatureDefinitions();
+}
+
+function loadFeatures(features) {
+ const featureDefinitions = getInitializedFeatureDefinitions();
+ for (const key in features) {
+ featureDefinitions[key] = {
+ ...featureDefinitions[key],
+ ...features[key],
+ };
+ }
+ motionDom.setFeatureDefinitions(featureDefinitions);
+}
+
+/**
+ * A list of all valid MotionProps.
+ *
+ * @privateRemarks
+ * This doesn't throw if a `MotionProp` name is missing - it should.
+ */
+const validMotionProps = new Set([
+ "animate",
+ "exit",
+ "variants",
+ "initial",
+ "style",
+ "values",
+ "variants",
+ "transition",
+ "transformTemplate",
+ "custom",
+ "inherit",
+ "onBeforeLayoutMeasure",
+ "onAnimationStart",
+ "onAnimationComplete",
+ "onUpdate",
+ "onDragStart",
+ "onDrag",
+ "onDragEnd",
+ "onMeasureDragConstraints",
+ "onDirectionLock",
+ "onDragTransitionEnd",
+ "_dragX",
+ "_dragY",
+ "onHoverStart",
+ "onHoverEnd",
+ "onViewportEnter",
+ "onViewportLeave",
+ "globalTapTarget",
+ "propagate",
+ "ignoreStrict",
+ "viewport",
+]);
+/**
+ * Check whether a prop name is a valid `MotionProp` key.
+ *
+ * @param key - Name of the property to check
+ * @returns `true` is key is a valid `MotionProp`.
+ *
+ * @public
+ */
+function isValidMotionProp(key) {
+ return (key.startsWith("while") ||
+ (key.startsWith("drag") && key !== "draggable") ||
+ key.startsWith("layout") ||
+ key.startsWith("onTap") ||
+ key.startsWith("onPan") ||
+ key.startsWith("onLayout") ||
+ validMotionProps.has(key));
+}
+
+let shouldForward = (key) => !isValidMotionProp(key);
+function loadExternalIsValidProp(isValidProp) {
+ if (typeof isValidProp !== "function")
+ return;
+ // Explicitly filter our events
+ shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
+}
+/**
+ * Emotion and Styled Components both allow users to pass through arbitrary props to their components
+ * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which
+ * of these should be passed to the underlying DOM node.
+ *
+ * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props
+ * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props
+ * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of
+ * `@emotion/is-prop-valid`, however to fix this problem we need to use it.
+ *
+ * By making it an optionalDependency we can offer this functionality only in the situations where it's
+ * actually required.
+ */
+try {
+ /**
+ * We attempt to import this package but require won't be defined in esm environments, in that case
+ * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed
+ * in favour of explicit injection.
+ */
+ loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
+}
+catch {
+ // We don't need to actually do anything here - the fallback is the existing `isPropValid`.
+}
+function filterProps(props, isDom, forwardMotionProps) {
+ const filteredProps = {};
+ for (const key in props) {
+ /**
+ * values is considered a valid prop by Emotion, so if it's present
+ * this will be rendered out to the DOM unless explicitly filtered.
+ *
+ * We check the type as it could be used with the `feColorMatrix`
+ * element, which we support.
+ */
+ if (key === "values" && typeof props.values === "object")
+ continue;
+ if (shouldForward(key) ||
+ (forwardMotionProps === true && isValidMotionProp(key)) ||
+ (!isDom && !isValidMotionProp(key)) ||
+ // If trying to use native HTML drag events, forward drag listeners
+ (props["draggable"] &&
+ key.startsWith("onDrag"))) {
+ filteredProps[key] =
+ props[key];
+ }
+ }
+ return filteredProps;
+}
+
+/**
+ * We keep these listed separately as we use the lowercase tag names as part
+ * of the runtime bundle to detect SVG components
+ */
+const lowercaseSVGElements = [
+ "animate",
+ "circle",
+ "defs",
+ "desc",
+ "ellipse",
+ "g",
+ "image",
+ "line",
+ "filter",
+ "marker",
+ "mask",
+ "metadata",
+ "path",
+ "pattern",
+ "polygon",
+ "polyline",
+ "rect",
+ "stop",
+ "switch",
+ "symbol",
+ "svg",
+ "text",
+ "tspan",
+ "use",
+ "view",
+];
+
+function isSVGComponent(Component) {
+ if (
+ /**
+ * If it's not a string, it's a custom React component. Currently we only support
+ * HTML custom React components.
+ */
+ typeof Component !== "string" ||
+ /**
+ * If it contains a dash, the element is a custom HTML webcomponent.
+ */
+ Component.includes("-")) {
+ return false;
+ }
+ else if (
+ /**
+ * If it's in our list of lowercase SVG tags, it's an SVG component
+ */
+ lowercaseSVGElements.indexOf(Component) > -1 ||
+ /**
+ * If it contains a capital letter, it's an SVG component
+ */
+ /[A-Z]/u.test(Component)) {
+ return true;
+ }
+ return false;
+}
+
+const createDomVisualElement = (Component, options) => {
+ /**
+ * Use explicit isSVG override if provided, otherwise auto-detect
+ */
+ const isSVG = options.isSVG ?? isSVGComponent(Component);
+ return isSVG
+ ? new motionDom.SVGVisualElement(options)
+ : new motionDom.HTMLVisualElement(options, {
+ allowProjection: Component !== React.Fragment,
+ });
+};
+
+const MotionContext = /* @__PURE__ */ React.createContext({});
+
+function getCurrentTreeVariants(props, context) {
+ if (motionDom.isControllingVariants(props)) {
+ const { initial, animate } = props;
+ return {
+ initial: initial === false || motionDom.isVariantLabel(initial)
+ ? initial
+ : undefined,
+ animate: motionDom.isVariantLabel(animate) ? animate : undefined,
+ };
+ }
+ return props.inherit !== false ? context : {};
+}
+
+function useCreateMotionContext(props) {
+ const { initial, animate } = getCurrentTreeVariants(props, React.useContext(MotionContext));
+ return React.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
+}
+function variantLabelsAsDependency(prop) {
+ return Array.isArray(prop) ? prop.join(" ") : prop;
+}
+
+const createHtmlRenderState = () => ({
+ style: {},
+ transform: {},
+ transformOrigin: {},
+ vars: {},
+});
+
+function copyRawValuesOnly(target, source, props) {
+ for (const key in source) {
+ if (!motionDom.isMotionValue(source[key]) && !motionDom.isForcedMotionValue(key, props)) {
+ target[key] = source[key];
+ }
+ }
+}
+function useInitialMotionValues({ transformTemplate }, visualState) {
+ return React.useMemo(() => {
+ const state = createHtmlRenderState();
+ motionDom.buildHTMLStyles(state, visualState, transformTemplate);
+ return Object.assign({}, state.vars, state.style);
+ }, [visualState]);
+}
+function useStyle(props, visualState) {
+ const styleProp = props.style || {};
+ const style = {};
+ /**
+ * Copy non-Motion Values straight into style
+ */
+ copyRawValuesOnly(style, styleProp, props);
+ Object.assign(style, useInitialMotionValues(props, visualState));
+ return style;
+}
+function useHTMLProps(props, visualState) {
+ // The `any` isn't ideal but it is the type of createElement props argument
+ const htmlProps = {};
+ const style = useStyle(props, visualState);
+ if (props.drag && props.dragListener !== false) {
+ // Disable the ghost element when a user drags
+ htmlProps.draggable = false;
+ // Disable text selection
+ style.userSelect =
+ style.WebkitUserSelect =
+ style.WebkitTouchCallout =
+ "none";
+ // Disable scrolling on the draggable direction
+ style.touchAction =
+ props.drag === true
+ ? "none"
+ : `pan-${props.drag === "x" ? "y" : "x"}`;
+ }
+ if (props.tabIndex === undefined &&
+ (props.onTap || props.onTapStart || props.whileTap)) {
+ htmlProps.tabIndex = 0;
+ }
+ htmlProps.style = style;
+ return htmlProps;
+}
+
+const createSvgRenderState = () => ({
+ ...createHtmlRenderState(),
+ attrs: {},
+});
+
+function useSVGProps(props, visualState, _isStatic, Component) {
+ const visualProps = React.useMemo(() => {
+ const state = createSvgRenderState();
+ motionDom.buildSVGAttrs(state, visualState, motionDom.isSVGTag(Component), props.transformTemplate, props.style);
+ return {
+ ...state.attrs,
+ style: { ...state.style },
+ };
+ }, [visualState]);
+ if (props.style) {
+ const rawStyles = {};
+ copyRawValuesOnly(rawStyles, props.style, props);
+ visualProps.style = { ...rawStyles, ...visualProps.style };
+ }
+ return visualProps;
+}
+
+function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) {
+ const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;
+ const visualProps = useVisualProps(props, latestValues, isStatic, Component);
+ const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
+ const elementProps = Component !== React.Fragment ? { ...filteredProps, ...visualProps, ref } : {};
+ /**
+ * If component has been handed a motion value as its child,
+ * memoise its initial value and render that. Subsequent updates
+ * will be handled by the onChange handler
+ */
+ const { children } = props;
+ const renderedChildren = React.useMemo(() => (motionDom.isMotionValue(children) ? children.get() : children), [children]);
+ return React.createElement(Component, {
+ ...elementProps,
+ children: renderedChildren,
+ });
+}
+
+function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {
+ const state = {
+ latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
+ renderState: createRenderState(),
+ };
+ return state;
+}
+function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
+ const values = {};
+ const motionValues = scrapeMotionValues(props, {});
+ for (const key in motionValues) {
+ values[key] = motionDom.resolveMotionValue(motionValues[key]);
+ }
+ let { initial, animate } = props;
+ const isControllingVariants = motionDom.isControllingVariants(props);
+ const isVariantNode = motionDom.isVariantNode(props);
+ if (context &&
+ isVariantNode &&
+ !isControllingVariants &&
+ props.inherit !== false) {
+ if (initial === undefined)
+ initial = context.initial;
+ if (animate === undefined)
+ animate = context.animate;
+ }
+ let isInitialAnimationBlocked = presenceContext
+ ? presenceContext.initial === false
+ : false;
+ isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;
+ const variantToSet = isInitialAnimationBlocked ? animate : initial;
+ if (variantToSet &&
+ typeof variantToSet !== "boolean" &&
+ !motionDom.isAnimationControls(variantToSet)) {
+ const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
+ for (let i = 0; i < list.length; i++) {
+ const resolved = motionDom.resolveVariantFromProps(props, list[i]);
+ if (resolved) {
+ const { transitionEnd, transition, ...target } = resolved;
+ for (const key in target) {
+ let valueTarget = target[key];
+ if (Array.isArray(valueTarget)) {
+ /**
+ * Take final keyframe if the initial animation is blocked because
+ * we want to initialise at the end of that blocked animation.
+ */
+ const index = isInitialAnimationBlocked
+ ? valueTarget.length - 1
+ : 0;
+ valueTarget = valueTarget[index];
+ }
+ if (valueTarget !== null) {
+ values[key] = valueTarget;
+ }
+ }
+ for (const key in transitionEnd) {
+ values[key] = transitionEnd[key];
+ }
+ }
+ }
+ }
+ return values;
+}
+const makeUseVisualState = (config) => (props, isStatic) => {
+ const context = React.useContext(MotionContext);
+ const presenceContext = React.useContext(PresenceContext);
+ const make = () => makeState(config, props, context, presenceContext);
+ return isStatic ? make() : useConstant(make);
+};
+
+const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({
+ scrapeMotionValuesFromProps: motionDom.scrapeHTMLMotionValuesFromProps,
+ createRenderState: createHtmlRenderState,
+});
+
+const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({
+ scrapeMotionValuesFromProps: motionDom.scrapeSVGMotionValuesFromProps,
+ createRenderState: createSvgRenderState,
+});
+
+const motionComponentSymbol = Symbol.for("motionComponentSymbol");
+
+/**
+ * Creates a ref function that, when called, hydrates the provided
+ * external ref and VisualElement.
+ */
+function useMotionRef(visualState, visualElement, externalRef) {
+ /**
+ * Store externalRef in a ref to avoid including it in the useCallback
+ * dependency array. Including externalRef in dependencies causes issues
+ * with libraries like Radix UI that create new callback refs on each render
+ * when using asChild - this would cause the callback to be recreated,
+ * triggering element remounts and breaking AnimatePresence exit animations.
+ */
+ const externalRefContainer = React.useRef(externalRef);
+ React.useInsertionEffect(() => {
+ externalRefContainer.current = externalRef;
+ });
+ // Store cleanup function returned by callback refs (React 19 feature)
+ const refCleanup = React.useRef(null);
+ return React.useCallback((instance) => {
+ if (instance) {
+ visualState.onMount?.(instance);
+ }
+ if (visualElement) {
+ instance ? visualElement.mount(instance) : visualElement.unmount();
+ }
+ const ref = externalRefContainer.current;
+ if (typeof ref === "function") {
+ if (instance) {
+ const cleanup = ref(instance);
+ if (typeof cleanup === "function") {
+ refCleanup.current = cleanup;
+ }
+ }
+ else if (refCleanup.current) {
+ refCleanup.current();
+ refCleanup.current = null;
+ }
+ else {
+ ref(instance);
+ }
+ }
+ else if (ref) {
+ ref.current = instance;
+ }
+ }, [visualElement]);
+}
+
+/**
+ * Internal, exported only for usage in Framer
+ */
+const SwitchLayoutGroupContext = React.createContext({});
+
+function isRefObject(ref) {
+ return (ref &&
+ typeof ref === "object" &&
+ Object.prototype.hasOwnProperty.call(ref, "current"));
+}
+
+function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {
+ const { visualElement: parent } = React.useContext(MotionContext);
+ const lazyContext = React.useContext(LazyContext);
+ const presenceContext = React.useContext(PresenceContext);
+ const motionConfig = React.useContext(MotionConfigContext);
+ const reducedMotionConfig = motionConfig.reducedMotion;
+ const skipAnimations = motionConfig.skipAnimations;
+ const visualElementRef = React.useRef(null);
+ /**
+ * Track whether the component has been through React's commit phase.
+ * Used to detect when LazyMotion features load after the component has mounted.
+ */
+ const hasMountedOnce = React.useRef(false);
+ /**
+ * If we haven't preloaded a renderer, check to see if we have one lazy-loaded
+ */
+ createVisualElement =
+ createVisualElement ||
+ lazyContext.renderer;
+ if (!visualElementRef.current && createVisualElement) {
+ visualElementRef.current = createVisualElement(Component, {
+ visualState,
+ parent,
+ props,
+ presenceContext,
+ blockInitialAnimation: presenceContext
+ ? presenceContext.initial === false
+ : false,
+ reducedMotionConfig,
+ skipAnimations,
+ isSVG,
+ });
+ /**
+ * If the component has already mounted before features loaded (e.g. via
+ * LazyMotion with async feature loading), we need to force the initial
+ * animation to run. Otherwise state changes that occurred before features
+ * loaded will be lost and the element will snap to its final state.
+ */
+ if (hasMountedOnce.current && visualElementRef.current) {
+ visualElementRef.current.manuallyAnimateOnMount = true;
+ }
+ }
+ const visualElement = visualElementRef.current;
+ /**
+ * Load Motion gesture and animation features. These are rendered as renderless
+ * components so each feature can optionally make use of React lifecycle methods.
+ */
+ const initialLayoutGroupConfig = React.useContext(SwitchLayoutGroupContext);
+ if (visualElement &&
+ !visualElement.projection &&
+ ProjectionNodeConstructor &&
+ (visualElement.type === "html" || visualElement.type === "svg")) {
+ createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
+ }
+ const isMounted = React.useRef(false);
+ React.useInsertionEffect(() => {
+ /**
+ * Check the component has already mounted before calling
+ * `update` unnecessarily. This ensures we skip the initial update.
+ */
+ if (visualElement && isMounted.current) {
+ visualElement.update(props, presenceContext);
+ }
+ });
+ /**
+ * Cache this value as we want to know whether HandoffAppearAnimations
+ * was present on initial render - it will be deleted after this.
+ */
+ const optimisedAppearId = props[motionDom.optimizedAppearDataAttribute];
+ const wantsHandoff = React.useRef(Boolean(optimisedAppearId) &&
+ !window.MotionHandoffIsComplete?.(optimisedAppearId) &&
+ window.MotionHasOptimisedAnimation?.(optimisedAppearId));
+ useIsomorphicLayoutEffect(() => {
+ /**
+ * Track that this component has mounted. This is used to detect when
+ * LazyMotion features load after the component has already committed.
+ */
+ hasMountedOnce.current = true;
+ if (!visualElement)
+ return;
+ isMounted.current = true;
+ window.MotionIsMounted = true;
+ visualElement.updateFeatures();
+ visualElement.scheduleRenderMicrotask();
+ /**
+ * Ideally this function would always run in a useEffect.
+ *
+ * However, if we have optimised appear animations to handoff from,
+ * it needs to happen synchronously to ensure there's no flash of
+ * incorrect styles in the event of a hydration error.
+ *
+ * So if we detect a situtation where optimised appear animations
+ * are running, we use useLayoutEffect to trigger animations.
+ */
+ if (wantsHandoff.current && visualElement.animationState) {
+ visualElement.animationState.animateChanges();
+ }
+ });
+ React.useEffect(() => {
+ if (!visualElement)
+ return;
+ if (!wantsHandoff.current && visualElement.animationState) {
+ visualElement.animationState.animateChanges();
+ }
+ if (wantsHandoff.current) {
+ // This ensures all future calls to animateChanges() in this component will run in useEffect
+ queueMicrotask(() => {
+ window.MotionHandoffMarkAsComplete?.(optimisedAppearId);
+ });
+ wantsHandoff.current = false;
+ }
+ /**
+ * Now we've finished triggering animations for this element we
+ * can wipe the enteringChildren set for the next render.
+ */
+ visualElement.enteringChildren = undefined;
+ });
+ return visualElement;
+}
+function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
+ const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;
+ visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
+ ? undefined
+ : getClosestProjectingNode(visualElement.parent));
+ visualElement.projection.setOptions({
+ layoutId,
+ layout,
+ alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),
+ visualElement,
+ /**
+ * TODO: Update options in an effect. This could be tricky as it'll be too late
+ * to update by the time layout animations run.
+ * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
+ * ensuring it gets called if there's no potential layout animations.
+ *
+ */
+ animationType: typeof layout === "string" ? layout : "both",
+ initialPromotionConfig,
+ crossfade: layoutCrossfade,
+ layoutScroll,
+ layoutRoot,
+ });
+}
+function getClosestProjectingNode(visualElement) {
+ if (!visualElement)
+ return undefined;
+ return visualElement.options.allowProjection !== false
+ ? visualElement.projection
+ : getClosestProjectingNode(visualElement.parent);
+}
+
+/**
+ * Create a `motion` component.
+ *
+ * This function accepts a Component argument, which can be either a string (ie "div"
+ * for `motion.div`), or an actual React component.
+ *
+ * Alongside this is a config option which provides a way of rendering the provided
+ * component "offline", or outside the React render cycle.
+ */
+function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {
+ preloadedFeatures && loadFeatures(preloadedFeatures);
+ /**
+ * Determine whether to use SVG or HTML rendering based on:
+ * 1. Explicit `type` option (highest priority)
+ * 2. Auto-detection via `isSVGComponent`
+ */
+ const isSVG = type ? type === "svg" : isSVGComponent(Component);
+ const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;
+ function MotionDOMComponent(props, externalRef) {
+ /**
+ * If we need to measure the element we load this functionality in a
+ * separate class component in order to gain access to getSnapshotBeforeUpdate.
+ */
+ let MeasureLayout;
+ const configAndProps = {
+ ...React.useContext(MotionConfigContext),
+ ...props,
+ layoutId: useLayoutId(props),
+ };
+ const { isStatic } = configAndProps;
+ const context = useCreateMotionContext(props);
+ const visualState = useVisualState(props, isStatic);
+ if (!isStatic && isBrowser) {
+ useStrictMode(configAndProps, preloadedFeatures);
+ const layoutProjection = getProjectionFunctionality(configAndProps);
+ MeasureLayout = layoutProjection.MeasureLayout;
+ /**
+ * Create a VisualElement for this component. A VisualElement provides a common
+ * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
+ * providing a way of rendering to these APIs outside of the React render loop
+ * for more performant animations and interactions
+ */
+ context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);
+ }
+ /**
+ * The mount order and hierarchy is specific to ensure our element ref
+ * is hydrated by the time features fire their effects.
+ */
+ return (jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsxRuntime.jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] }));
+ }
+ MotionDOMComponent.displayName = `motion.${typeof Component === "string"
+ ? Component
+ : `create(${Component.displayName ?? Component.name ?? ""})`}`;
+ const ForwardRefMotionComponent = React.forwardRef(MotionDOMComponent);
+ ForwardRefMotionComponent[motionComponentSymbol] = Component;
+ return ForwardRefMotionComponent;
+}
+function useLayoutId({ layoutId }) {
+ const layoutGroupId = React.useContext(LayoutGroupContext).id;
+ return layoutGroupId && layoutId !== undefined
+ ? layoutGroupId + "-" + layoutId
+ : layoutId;
+}
+function useStrictMode(configAndProps, preloadedFeatures) {
+ const isStrict = React.useContext(LazyContext).strict;
+ /**
+ * If we're in development mode, check to make sure we're not rendering a motion component
+ * as a child of LazyMotion, as this will break the file-size benefits of using it.
+ */
+ if (process.env.NODE_ENV !== "production" &&
+ preloadedFeatures &&
+ isStrict) {
+ const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
+ configAndProps.ignoreStrict
+ ? motionUtils.warning(false, strictMessage, "lazy-strict-mode")
+ : motionUtils.invariant(false, strictMessage, "lazy-strict-mode");
+ }
+}
+function getProjectionFunctionality(props) {
+ const featureDefinitions = getInitializedFeatureDefinitions();
+ const { drag, layout } = featureDefinitions;
+ if (!drag && !layout)
+ return {};
+ const combined = { ...drag, ...layout };
+ return {
+ MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)
+ ? combined.MeasureLayout
+ : undefined,
+ ProjectionNode: combined.ProjectionNode,
+ };
+}
+
+class AnimationFeature extends motionDom.Feature {
+ /**
+ * We dynamically generate the AnimationState manager as it contains a reference
+ * to the underlying animation library. We only want to load that if we load this,
+ * so people can optionally code split it out using the `m` component.
+ */
+ constructor(node) {
+ super(node);
+ node.animationState || (node.animationState = motionDom.createAnimationState(node));
+ }
+ updateAnimationControlsSubscription() {
+ const { animate } = this.node.getProps();
+ if (motionDom.isAnimationControls(animate)) {
+ this.unmountControls = animate.subscribe(this.node);
+ }
+ }
+ /**
+ * Subscribe any provided AnimationControls to the component's VisualElement
+ */
+ mount() {
+ this.updateAnimationControlsSubscription();
+ }
+ update() {
+ const { animate } = this.node.getProps();
+ const { animate: prevAnimate } = this.node.prevProps || {};
+ if (animate !== prevAnimate) {
+ this.updateAnimationControlsSubscription();
+ }
+ }
+ unmount() {
+ this.node.animationState.reset();
+ this.unmountControls?.();
+ }
+}
+
+let id = 0;
+class ExitAnimationFeature extends motionDom.Feature {
+ constructor() {
+ super(...arguments);
+ this.id = id++;
+ }
+ update() {
+ if (!this.node.presenceContext)
+ return;
+ const { isPresent, onExitComplete } = this.node.presenceContext;
+ const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
+ if (!this.node.animationState || isPresent === prevIsPresent) {
+ return;
+ }
+ const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
+ if (onExitComplete && !isPresent) {
+ exitAnimation.then(() => {
+ onExitComplete(this.id);
+ });
+ }
+ }
+ mount() {
+ const { register, onExitComplete } = this.node.presenceContext || {};
+ if (onExitComplete) {
+ onExitComplete(this.id);
+ }
+ if (register) {
+ this.unmount = register(this.id);
+ }
+ }
+ unmount() { }
+}
+
+const animations = {
+ animation: {
+ Feature: AnimationFeature,
+ },
+ exit: {
+ Feature: ExitAnimationFeature,
+ },
+};
+
+function extractEventInfo(event) {
+ return {
+ point: {
+ x: event.pageX,
+ y: event.pageY,
+ },
+ };
+}
+const addPointerInfo = (handler) => {
+ return (event) => motionDom.isPrimaryPointer(event) && handler(event, extractEventInfo(event));
+};
+
+function addPointerEvent(target, eventName, handler, options) {
+ return motionDom.addDomEvent(target, eventName, addPointerInfo(handler), options);
+}
+
+// Fixes https://github.com/motiondivision/motion/issues/2270
+const getContextWindow = ({ current }) => {
+ return current ? current.ownerDocument.defaultView : null;
+};
+
+const distance = (a, b) => Math.abs(a - b);
+function distance2D(a, b) {
+ // Multi-dimensional
+ const xDelta = distance(a.x, b.x);
+ const yDelta = distance(a.y, b.y);
+ return Math.sqrt(xDelta ** 2 + yDelta ** 2);
+}
+
+const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]);
+/**
+ * @internal
+ */
+class PanSession {
+ constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {
+ /**
+ * @internal
+ */
+ this.startEvent = null;
+ /**
+ * @internal
+ */
+ this.lastMoveEvent = null;
+ /**
+ * @internal
+ */
+ this.lastMoveEventInfo = null;
+ /**
+ * @internal
+ */
+ this.handlers = {};
+ /**
+ * @internal
+ */
+ this.contextWindow = window;
+ /**
+ * Scroll positions of scrollable ancestors and window.
+ * @internal
+ */
+ this.scrollPositions = new Map();
+ /**
+ * Cleanup function for scroll listeners.
+ * @internal
+ */
+ this.removeScrollListeners = null;
+ this.onElementScroll = (event) => {
+ this.handleScroll(event.target);
+ };
+ this.onWindowScroll = () => {
+ this.handleScroll(window);
+ };
+ this.updatePoint = () => {
+ if (!(this.lastMoveEvent && this.lastMoveEventInfo))
+ return;
+ const info = getPanInfo(this.lastMoveEventInfo, this.history);
+ const isPanStarted = this.startEvent !== null;
+ // Only start panning if the offset is larger than 3 pixels. If we make it
+ // any larger than this we'll want to reset the pointer history
+ // on the first update to avoid visual snapping to the cursor.
+ const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;
+ if (!isPanStarted && !isDistancePastThreshold)
+ return;
+ const { point } = info;
+ const { timestamp } = motionDom.frameData;
+ this.history.push({ ...point, timestamp });
+ const { onStart, onMove } = this.handlers;
+ if (!isPanStarted) {
+ onStart && onStart(this.lastMoveEvent, info);
+ this.startEvent = this.lastMoveEvent;
+ }
+ onMove && onMove(this.lastMoveEvent, info);
+ };
+ this.handlePointerMove = (event, info) => {
+ this.lastMoveEvent = event;
+ this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
+ // Throttle mouse move event to once per frame
+ motionDom.frame.update(this.updatePoint, true);
+ };
+ this.handlePointerUp = (event, info) => {
+ this.end();
+ const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
+ // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)
+ // This ensures constraint animations continue when interrupted by a click
+ if (this.dragSnapToOrigin || !this.startEvent) {
+ resumeAnimation && resumeAnimation();
+ }
+ if (!(this.lastMoveEvent && this.lastMoveEventInfo))
+ return;
+ const panInfo = getPanInfo(event.type === "pointercancel"
+ ? this.lastMoveEventInfo
+ : transformPoint(info, this.transformPagePoint), this.history);
+ if (this.startEvent && onEnd) {
+ onEnd(event, panInfo);
+ }
+ onSessionEnd && onSessionEnd(event, panInfo);
+ };
+ // If we have more than one touch, don't start detecting this gesture
+ if (!motionDom.isPrimaryPointer(event))
+ return;
+ this.dragSnapToOrigin = dragSnapToOrigin;
+ this.handlers = handlers;
+ this.transformPagePoint = transformPagePoint;
+ this.distanceThreshold = distanceThreshold;
+ this.contextWindow = contextWindow || window;
+ const info = extractEventInfo(event);
+ const initialInfo = transformPoint(info, this.transformPagePoint);
+ const { point } = initialInfo;
+ const { timestamp } = motionDom.frameData;
+ this.history = [{ ...point, timestamp }];
+ const { onSessionStart } = handlers;
+ onSessionStart &&
+ onSessionStart(event, getPanInfo(initialInfo, this.history));
+ this.removeListeners = motionUtils.pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
+ // Start scroll tracking if element provided
+ if (element) {
+ this.startScrollTracking(element);
+ }
+ }
+ /**
+ * Start tracking scroll on ancestors and window.
+ */
+ startScrollTracking(element) {
+ // Store initial scroll positions for scrollable ancestors
+ let current = element.parentElement;
+ while (current) {
+ const style = getComputedStyle(current);
+ if (overflowStyles.has(style.overflowX) ||
+ overflowStyles.has(style.overflowY)) {
+ this.scrollPositions.set(current, {
+ x: current.scrollLeft,
+ y: current.scrollTop,
+ });
+ }
+ current = current.parentElement;
+ }
+ // Track window scroll
+ this.scrollPositions.set(window, {
+ x: window.scrollX,
+ y: window.scrollY,
+ });
+ // Capture listener catches element scroll events as they bubble
+ window.addEventListener("scroll", this.onElementScroll, {
+ capture: true,
+ });
+ // Direct window scroll listener (window scroll doesn't bubble)
+ window.addEventListener("scroll", this.onWindowScroll);
+ this.removeScrollListeners = () => {
+ window.removeEventListener("scroll", this.onElementScroll, {
+ capture: true,
+ });
+ window.removeEventListener("scroll", this.onWindowScroll);
+ };
+ }
+ /**
+ * Handle scroll compensation during drag.
+ *
+ * For element scroll: adjusts history origin since pageX/pageY doesn't change.
+ * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.
+ */
+ handleScroll(target) {
+ const initial = this.scrollPositions.get(target);
+ if (!initial)
+ return;
+ const isWindow = target === window;
+ const current = isWindow
+ ? { x: window.scrollX, y: window.scrollY }
+ : {
+ x: target.scrollLeft,
+ y: target.scrollTop,
+ };
+ const delta = { x: current.x - initial.x, y: current.y - initial.y };
+ if (delta.x === 0 && delta.y === 0)
+ return;
+ if (isWindow) {
+ // Window scroll: pageX/pageY changes, so update lastMoveEventInfo
+ if (this.lastMoveEventInfo) {
+ this.lastMoveEventInfo.point.x += delta.x;
+ this.lastMoveEventInfo.point.y += delta.y;
+ }
+ }
+ else {
+ // Element scroll: pageX/pageY unchanged, so adjust history origin
+ if (this.history.length > 0) {
+ this.history[0].x -= delta.x;
+ this.history[0].y -= delta.y;
+ }
+ }
+ this.scrollPositions.set(target, current);
+ motionDom.frame.update(this.updatePoint, true);
+ }
+ updateHandlers(handlers) {
+ this.handlers = handlers;
+ }
+ end() {
+ this.removeListeners && this.removeListeners();
+ this.removeScrollListeners && this.removeScrollListeners();
+ this.scrollPositions.clear();
+ motionDom.cancelFrame(this.updatePoint);
+ }
+}
+function transformPoint(info, transformPagePoint) {
+ return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
+}
+function subtractPoint(a, b) {
+ return { x: a.x - b.x, y: a.y - b.y };
+}
+function getPanInfo({ point }, history) {
+ return {
+ point,
+ delta: subtractPoint(point, lastDevicePoint(history)),
+ offset: subtractPoint(point, startDevicePoint(history)),
+ velocity: getVelocity(history, 0.1),
+ };
+}
+function startDevicePoint(history) {
+ return history[0];
+}
+function lastDevicePoint(history) {
+ return history[history.length - 1];
+}
+function getVelocity(history, timeDelta) {
+ if (history.length < 2) {
+ return { x: 0, y: 0 };
+ }
+ let i = history.length - 1;
+ let timestampedPoint = null;
+ const lastPoint = lastDevicePoint(history);
+ while (i >= 0) {
+ timestampedPoint = history[i];
+ if (lastPoint.timestamp - timestampedPoint.timestamp >
+ motionUtils.secondsToMilliseconds(timeDelta)) {
+ break;
+ }
+ i--;
+ }
+ if (!timestampedPoint) {
+ return { x: 0, y: 0 };
+ }
+ /**
+ * If the selected point is the pointer-down origin (history[0]),
+ * there are better movement points available, and the time gap
+ * is suspiciously large (>2x timeDelta), use the next point instead.
+ * This prevents stale pointer-down points from diluting velocity
+ * in hold-then-flick gestures.
+ */
+ if (timestampedPoint === history[0] &&
+ history.length > 2 &&
+ lastPoint.timestamp - timestampedPoint.timestamp >
+ motionUtils.secondsToMilliseconds(timeDelta) * 2) {
+ timestampedPoint = history[1];
+ }
+ const time = motionUtils.millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
+ if (time === 0) {
+ return { x: 0, y: 0 };
+ }
+ const currentVelocity = {
+ x: (lastPoint.x - timestampedPoint.x) / time,
+ y: (lastPoint.y - timestampedPoint.y) / time,
+ };
+ if (currentVelocity.x === Infinity) {
+ currentVelocity.x = 0;
+ }
+ if (currentVelocity.y === Infinity) {
+ currentVelocity.y = 0;
+ }
+ return currentVelocity;
+}
+
+/**
+ * Apply constraints to a point. These constraints are both physical along an
+ * axis, and an elastic factor that determines how much to constrain the point
+ * by if it does lie outside the defined parameters.
+ */
+function applyConstraints(point, { min, max }, elastic) {
+ if (min !== undefined && point < min) {
+ // If we have a min point defined, and this is outside of that, constrain
+ point = elastic
+ ? motionDom.mixNumber(min, point, elastic.min)
+ : Math.max(point, min);
+ }
+ else if (max !== undefined && point > max) {
+ // If we have a max point defined, and this is outside of that, constrain
+ point = elastic
+ ? motionDom.mixNumber(max, point, elastic.max)
+ : Math.min(point, max);
+ }
+ return point;
+}
+/**
+ * Calculate constraints in terms of the viewport when defined relatively to the
+ * measured axis. This is measured from the nearest edge, so a max constraint of 200
+ * on an axis with a max value of 300 would return a constraint of 500 - axis length
+ */
+function calcRelativeAxisConstraints(axis, min, max) {
+ return {
+ min: min !== undefined ? axis.min + min : undefined,
+ max: max !== undefined
+ ? axis.max + max - (axis.max - axis.min)
+ : undefined,
+ };
+}
+/**
+ * Calculate constraints in terms of the viewport when
+ * defined relatively to the measured bounding box.
+ */
+function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
+ return {
+ x: calcRelativeAxisConstraints(layoutBox.x, left, right),
+ y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),
+ };
+}
+/**
+ * Calculate viewport constraints when defined as another viewport-relative axis
+ */
+function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
+ let min = constraintsAxis.min - layoutAxis.min;
+ let max = constraintsAxis.max - layoutAxis.max;
+ // If the constraints axis is actually smaller than the layout axis then we can
+ // flip the constraints
+ if (constraintsAxis.max - constraintsAxis.min <
+ layoutAxis.max - layoutAxis.min) {
+ [min, max] = [max, min];
+ }
+ return { min, max };
+}
+/**
+ * Calculate viewport constraints when defined as another viewport-relative box
+ */
+function calcViewportConstraints(layoutBox, constraintsBox) {
+ return {
+ x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
+ y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),
+ };
+}
+/**
+ * Calculate a transform origin relative to the source axis, between 0-1, that results
+ * in an asthetically pleasing scale/transform needed to project from source to target.
+ */
+function calcOrigin(source, target) {
+ let origin = 0.5;
+ const sourceLength = motionDom.calcLength(source);
+ const targetLength = motionDom.calcLength(target);
+ if (targetLength > sourceLength) {
+ origin = motionUtils.progress(target.min, target.max - sourceLength, source.min);
+ }
+ else if (sourceLength > targetLength) {
+ origin = motionUtils.progress(source.min, source.max - targetLength, target.min);
+ }
+ return motionUtils.clamp(0, 1, origin);
+}
+/**
+ * Rebase the calculated viewport constraints relative to the layout.min point.
+ */
+function rebaseAxisConstraints(layout, constraints) {
+ const relativeConstraints = {};
+ if (constraints.min !== undefined) {
+ relativeConstraints.min = constraints.min - layout.min;
+ }
+ if (constraints.max !== undefined) {
+ relativeConstraints.max = constraints.max - layout.min;
+ }
+ return relativeConstraints;
+}
+const defaultElastic = 0.35;
+/**
+ * Accepts a dragElastic prop and returns resolved elastic values for each axis.
+ */
+function resolveDragElastic(dragElastic = defaultElastic) {
+ if (dragElastic === false) {
+ dragElastic = 0;
+ }
+ else if (dragElastic === true) {
+ dragElastic = defaultElastic;
+ }
+ return {
+ x: resolveAxisElastic(dragElastic, "left", "right"),
+ y: resolveAxisElastic(dragElastic, "top", "bottom"),
+ };
+}
+function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
+ return {
+ min: resolvePointElastic(dragElastic, minLabel),
+ max: resolvePointElastic(dragElastic, maxLabel),
+ };
+}
+function resolvePointElastic(dragElastic, label) {
+ return typeof dragElastic === "number"
+ ? dragElastic
+ : dragElastic[label] || 0;
+}
+
+const elementDragControls = new WeakMap();
+class VisualElementDragControls {
+ constructor(visualElement) {
+ this.openDragLock = null;
+ this.isDragging = false;
+ this.currentDirection = null;
+ this.originPoint = { x: 0, y: 0 };
+ /**
+ * The permitted boundaries of travel, in pixels.
+ */
+ this.constraints = false;
+ this.hasMutatedConstraints = false;
+ /**
+ * The per-axis resolved elastic values.
+ */
+ this.elastic = motionDom.createBox();
+ /**
+ * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.
+ */
+ this.latestPointerEvent = null;
+ /**
+ * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.
+ */
+ this.latestPanInfo = null;
+ this.visualElement = visualElement;
+ }
+ start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {
+ /**
+ * Don't start dragging if this component is exiting
+ */
+ const { presenceContext } = this.visualElement;
+ if (presenceContext && presenceContext.isPresent === false)
+ return;
+ const onSessionStart = (event) => {
+ if (snapToCursor) {
+ this.snapToCursor(extractEventInfo(event).point);
+ }
+ this.stopAnimation();
+ };
+ const onStart = (event, info) => {
+ // Attempt to grab the global drag gesture lock - maybe make this part of PanSession
+ const { drag, dragPropagation, onDragStart } = this.getProps();
+ if (drag && !dragPropagation) {
+ if (this.openDragLock)
+ this.openDragLock();
+ this.openDragLock = motionDom.setDragLock(drag);
+ // If we don 't have the lock, don't start dragging
+ if (!this.openDragLock)
+ return;
+ }
+ this.latestPointerEvent = event;
+ this.latestPanInfo = info;
+ this.isDragging = true;
+ this.currentDirection = null;
+ this.resolveConstraints();
+ if (this.visualElement.projection) {
+ this.visualElement.projection.isAnimationBlocked = true;
+ this.visualElement.projection.target = undefined;
+ }
+ /**
+ * Record gesture origin and pointer offset
+ */
+ motionDom.eachAxis((axis) => {
+ let current = this.getAxisMotionValue(axis).get() || 0;
+ /**
+ * If the MotionValue is a percentage value convert to px
+ */
+ if (motionDom.percent.test(current)) {
+ const { projection } = this.visualElement;
+ if (projection && projection.layout) {
+ const measuredAxis = projection.layout.layoutBox[axis];
+ if (measuredAxis) {
+ const length = motionDom.calcLength(measuredAxis);
+ current = length * (parseFloat(current) / 100);
+ }
+ }
+ }
+ this.originPoint[axis] = current;
+ });
+ // Fire onDragStart event
+ if (onDragStart) {
+ motionDom.frame.update(() => onDragStart(event, info), false, true);
+ }
+ motionDom.addValueToWillChange(this.visualElement, "transform");
+ const { animationState } = this.visualElement;
+ animationState && animationState.setActive("whileDrag", true);
+ };
+ const onMove = (event, info) => {
+ this.latestPointerEvent = event;
+ this.latestPanInfo = info;
+ const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();
+ // If we didn't successfully receive the gesture lock, early return.
+ if (!dragPropagation && !this.openDragLock)
+ return;
+ const { offset } = info;
+ // Attempt to detect drag direction if directionLock is true
+ if (dragDirectionLock && this.currentDirection === null) {
+ this.currentDirection = getCurrentDirection(offset);
+ // If we've successfully set a direction, notify listener
+ if (this.currentDirection !== null) {
+ onDirectionLock && onDirectionLock(this.currentDirection);
+ }
+ return;
+ }
+ // Update each point with the latest position
+ this.updateAxis("x", info.point, offset);
+ this.updateAxis("y", info.point, offset);
+ /**
+ * Ideally we would leave the renderer to fire naturally at the end of
+ * this frame but if the element is about to change layout as the result
+ * of a re-render we want to ensure the browser can read the latest
+ * bounding box to ensure the pointer and element don't fall out of sync.
+ */
+ this.visualElement.render();
+ /**
+ * This must fire after the render call as it might trigger a state
+ * change which itself might trigger a layout update.
+ */
+ if (onDrag) {
+ motionDom.frame.update(() => onDrag(event, info), false, true);
+ }
+ };
+ const onSessionEnd = (event, info) => {
+ this.latestPointerEvent = event;
+ this.latestPanInfo = info;
+ this.stop(event, info);
+ this.latestPointerEvent = null;
+ this.latestPanInfo = null;
+ };
+ const resumeAnimation = () => {
+ const { dragSnapToOrigin: snap } = this.getProps();
+ if (snap || this.constraints) {
+ this.startAnimation({ x: 0, y: 0 });
+ }
+ };
+ const { dragSnapToOrigin } = this.getProps();
+ this.panSession = new PanSession(originEvent, {
+ onSessionStart,
+ onStart,
+ onMove,
+ onSessionEnd,
+ resumeAnimation,
+ }, {
+ transformPagePoint: this.visualElement.getTransformPagePoint(),
+ dragSnapToOrigin,
+ distanceThreshold,
+ contextWindow: getContextWindow(this.visualElement),
+ element: this.visualElement.current,
+ });
+ }
+ /**
+ * @internal
+ */
+ stop(event, panInfo) {
+ const finalEvent = event || this.latestPointerEvent;
+ const finalPanInfo = panInfo || this.latestPanInfo;
+ const isDragging = this.isDragging;
+ this.cancel();
+ if (!isDragging || !finalPanInfo || !finalEvent)
+ return;
+ const { velocity } = finalPanInfo;
+ this.startAnimation(velocity);
+ const { onDragEnd } = this.getProps();
+ if (onDragEnd) {
+ motionDom.frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));
+ }
+ }
+ /**
+ * @internal
+ */
+ cancel() {
+ this.isDragging = false;
+ const { projection, animationState } = this.visualElement;
+ if (projection) {
+ projection.isAnimationBlocked = false;
+ }
+ this.endPanSession();
+ const { dragPropagation } = this.getProps();
+ if (!dragPropagation && this.openDragLock) {
+ this.openDragLock();
+ this.openDragLock = null;
+ }
+ animationState && animationState.setActive("whileDrag", false);
+ }
+ /**
+ * Clean up the pan session without modifying other drag state.
+ * This is used during unmount to ensure event listeners are removed
+ * without affecting projection animations or drag locks.
+ * @internal
+ */
+ endPanSession() {
+ this.panSession && this.panSession.end();
+ this.panSession = undefined;
+ }
+ updateAxis(axis, _point, offset) {
+ const { drag } = this.getProps();
+ // If we're not dragging this axis, do an early return.
+ if (!offset || !shouldDrag(axis, drag, this.currentDirection))
+ return;
+ const axisValue = this.getAxisMotionValue(axis);
+ let next = this.originPoint[axis] + offset[axis];
+ // Apply constraints
+ if (this.constraints && this.constraints[axis]) {
+ next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);
+ }
+ axisValue.set(next);
+ }
+ resolveConstraints() {
+ const { dragConstraints, dragElastic } = this.getProps();
+ const layout = this.visualElement.projection &&
+ !this.visualElement.projection.layout
+ ? this.visualElement.projection.measure(false)
+ : this.visualElement.projection?.layout;
+ const prevConstraints = this.constraints;
+ if (dragConstraints && isRefObject(dragConstraints)) {
+ if (!this.constraints) {
+ this.constraints = this.resolveRefConstraints();
+ }
+ }
+ else {
+ if (dragConstraints && layout) {
+ this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);
+ }
+ else {
+ this.constraints = false;
+ }
+ }
+ this.elastic = resolveDragElastic(dragElastic);
+ /**
+ * If we're outputting to external MotionValues, we want to rebase the measured constraints
+ * from viewport-relative to component-relative. This only applies to relative (non-ref)
+ * constraints, as ref-based constraints from calcViewportConstraints are already in the
+ * correct coordinate space for the motion value transform offset.
+ */
+ if (prevConstraints !== this.constraints &&
+ !isRefObject(dragConstraints) &&
+ layout &&
+ this.constraints &&
+ !this.hasMutatedConstraints) {
+ motionDom.eachAxis((axis) => {
+ if (this.constraints !== false &&
+ this.getAxisMotionValue(axis)) {
+ this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);
+ }
+ });
+ }
+ }
+ resolveRefConstraints() {
+ const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
+ if (!constraints || !isRefObject(constraints))
+ return false;
+ const constraintsElement = constraints.current;
+ motionUtils.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
+ const { projection } = this.visualElement;
+ // TODO
+ if (!projection || !projection.layout)
+ return false;
+ const constraintsBox = motionDom.measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());
+ let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);
+ /**
+ * If there's an onMeasureDragConstraints listener we call it and
+ * if different constraints are returned, set constraints to that
+ */
+ if (onMeasureDragConstraints) {
+ const userConstraints = onMeasureDragConstraints(motionDom.convertBoxToBoundingBox(measuredConstraints));
+ this.hasMutatedConstraints = !!userConstraints;
+ if (userConstraints) {
+ measuredConstraints = motionDom.convertBoundingBoxToBox(userConstraints);
+ }
+ }
+ return measuredConstraints;
+ }
+ startAnimation(velocity) {
+ const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();
+ const constraints = this.constraints || {};
+ const momentumAnimations = motionDom.eachAxis((axis) => {
+ if (!shouldDrag(axis, drag, this.currentDirection)) {
+ return;
+ }
+ let transition = (constraints && constraints[axis]) || {};
+ if (dragSnapToOrigin)
+ transition = { min: 0, max: 0 };
+ /**
+ * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame
+ * of spring animations so we should look into adding a disable spring option to `inertia`.
+ * We could do something here where we affect the `bounceStiffness` and `bounceDamping`
+ * using the value of `dragElastic`.
+ */
+ const bounceStiffness = dragElastic ? 200 : 1000000;
+ const bounceDamping = dragElastic ? 40 : 10000000;
+ const inertia = {
+ type: "inertia",
+ velocity: dragMomentum ? velocity[axis] : 0,
+ bounceStiffness,
+ bounceDamping,
+ timeConstant: 750,
+ restDelta: 1,
+ restSpeed: 10,
+ ...dragTransition,
+ ...transition,
+ };
+ // If we're not animating on an externally-provided `MotionValue` we can use the
+ // component's animation controls which will handle interactions with whileHover (etc),
+ // otherwise we just have to animate the `MotionValue` itself.
+ return this.startAxisValueAnimation(axis, inertia);
+ });
+ // Run all animations and then resolve the new drag constraints.
+ return Promise.all(momentumAnimations).then(onDragTransitionEnd);
+ }
+ startAxisValueAnimation(axis, transition) {
+ const axisValue = this.getAxisMotionValue(axis);
+ motionDom.addValueToWillChange(this.visualElement, axis);
+ return axisValue.start(motionDom.animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));
+ }
+ stopAnimation() {
+ motionDom.eachAxis((axis) => this.getAxisMotionValue(axis).stop());
+ }
+ /**
+ * Drag works differently depending on which props are provided.
+ *
+ * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
+ * - Otherwise, we apply the delta to the x/y motion values.
+ */
+ getAxisMotionValue(axis) {
+ const dragKey = `_drag${axis.toUpperCase()}`;
+ const props = this.visualElement.getProps();
+ const externalMotionValue = props[dragKey];
+ return externalMotionValue
+ ? externalMotionValue
+ : this.visualElement.getValue(axis, (props.initial
+ ? props.initial[axis]
+ : undefined) || 0);
+ }
+ snapToCursor(point) {
+ motionDom.eachAxis((axis) => {
+ const { drag } = this.getProps();
+ // If we're not dragging this axis, do an early return.
+ if (!shouldDrag(axis, drag, this.currentDirection))
+ return;
+ const { projection } = this.visualElement;
+ const axisValue = this.getAxisMotionValue(axis);
+ if (projection && projection.layout) {
+ const { min, max } = projection.layout.layoutBox[axis];
+ /**
+ * The layout measurement includes the current transform value,
+ * so we need to add it back to get the correct snap position.
+ * This fixes an issue where elements with initial coordinates
+ * would snap to the wrong position on the first drag.
+ */
+ const current = axisValue.get() || 0;
+ axisValue.set(point[axis] - motionDom.mixNumber(min, max, 0.5) + current);
+ }
+ });
+ }
+ /**
+ * When the viewport resizes we want to check if the measured constraints
+ * have changed and, if so, reposition the element within those new constraints
+ * relative to where it was before the resize.
+ */
+ scalePositionWithinConstraints() {
+ if (!this.visualElement.current)
+ return;
+ const { drag, dragConstraints } = this.getProps();
+ const { projection } = this.visualElement;
+ if (!isRefObject(dragConstraints) || !projection || !this.constraints)
+ return;
+ /**
+ * Stop current animations as there can be visual glitching if we try to do
+ * this mid-animation
+ */
+ this.stopAnimation();
+ /**
+ * Record the relative position of the dragged element relative to the
+ * constraints box and save as a progress value.
+ */
+ const boxProgress = { x: 0, y: 0 };
+ motionDom.eachAxis((axis) => {
+ const axisValue = this.getAxisMotionValue(axis);
+ if (axisValue && this.constraints !== false) {
+ const latest = axisValue.get();
+ boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);
+ }
+ });
+ /**
+ * Update the layout of this element and resolve the latest drag constraints
+ */
+ const { transformTemplate } = this.visualElement.getProps();
+ this.visualElement.current.style.transform = transformTemplate
+ ? transformTemplate({}, "")
+ : "none";
+ projection.root && projection.root.updateScroll();
+ projection.updateLayout();
+ /**
+ * Reset constraints so resolveConstraints() will recalculate them
+ * with the freshly measured layout rather than returning the cached value.
+ */
+ this.constraints = false;
+ this.resolveConstraints();
+ /**
+ * For each axis, calculate the current progress of the layout axis
+ * within the new constraints.
+ */
+ motionDom.eachAxis((axis) => {
+ if (!shouldDrag(axis, drag, null))
+ return;
+ /**
+ * Calculate a new transform based on the previous box progress
+ */
+ const axisValue = this.getAxisMotionValue(axis);
+ const { min, max } = this.constraints[axis];
+ axisValue.set(motionDom.mixNumber(min, max, boxProgress[axis]));
+ });
+ /**
+ * Flush the updated transform to the DOM synchronously to prevent
+ * a visual flash at the element's CSS layout position (0,0) when
+ * the transform was stripped for measurement.
+ */
+ this.visualElement.render();
+ }
+ addListeners() {
+ if (!this.visualElement.current)
+ return;
+ elementDragControls.set(this.visualElement, this);
+ const element = this.visualElement.current;
+ /**
+ * Attach a pointerdown event listener on this DOM element to initiate drag tracking.
+ */
+ const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
+ const { drag, dragListener = true } = this.getProps();
+ const target = event.target;
+ /**
+ * Only block drag if clicking on a text input child element
+ * (input, textarea, select, contenteditable) where users might
+ * want to select text or interact with the control.
+ *
+ * Buttons and links don't block drag since they don't have
+ * click-and-move actions of their own.
+ */
+ const isClickingTextInputChild = target !== element && motionDom.isElementTextInput(target);
+ if (drag && dragListener && !isClickingTextInputChild) {
+ this.start(event);
+ }
+ });
+ /**
+ * If using ref-based constraints, observe both the draggable element
+ * and the constraint container for size changes via ResizeObserver.
+ * Setup is deferred because dragConstraints.current is null when
+ * addListeners first runs (React hasn't committed the ref yet).
+ */
+ let stopResizeObservers;
+ const measureDragConstraints = () => {
+ const { dragConstraints } = this.getProps();
+ if (isRefObject(dragConstraints) && dragConstraints.current) {
+ this.constraints = this.resolveRefConstraints();
+ if (!stopResizeObservers) {
+ stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());
+ }
+ }
+ };
+ const { projection } = this.visualElement;
+ const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints);
+ if (projection && !projection.layout) {
+ projection.root && projection.root.updateScroll();
+ projection.updateLayout();
+ }
+ motionDom.frame.read(measureDragConstraints);
+ /**
+ * Attach a window resize listener to scale the draggable target within its defined
+ * constraints as the window resizes.
+ */
+ const stopResizeListener = motionDom.addDomEvent(window, "resize", () => this.scalePositionWithinConstraints());
+ /**
+ * If the element's layout changes, calculate the delta and apply that to
+ * the drag gesture's origin point.
+ */
+ const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => {
+ if (this.isDragging && hasLayoutChanged) {
+ motionDom.eachAxis((axis) => {
+ const motionValue = this.getAxisMotionValue(axis);
+ if (!motionValue)
+ return;
+ this.originPoint[axis] += delta[axis].translate;
+ motionValue.set(motionValue.get() + delta[axis].translate);
+ });
+ this.visualElement.render();
+ }
+ }));
+ return () => {
+ stopResizeListener();
+ stopPointerListener();
+ stopMeasureLayoutListener();
+ stopLayoutUpdateListener && stopLayoutUpdateListener();
+ stopResizeObservers && stopResizeObservers();
+ };
+ }
+ getProps() {
+ const props = this.visualElement.getProps();
+ const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;
+ return {
+ ...props,
+ drag,
+ dragDirectionLock,
+ dragPropagation,
+ dragConstraints,
+ dragElastic,
+ dragMomentum,
+ };
+ }
+}
+function skipFirstCall(callback) {
+ let isFirst = true;
+ return () => {
+ if (isFirst) {
+ isFirst = false;
+ return;
+ }
+ callback();
+ };
+}
+function startResizeObservers(element, constraintsElement, onResize) {
+ const stopElement = motionDom.resize(element, skipFirstCall(onResize));
+ const stopContainer = motionDom.resize(constraintsElement, skipFirstCall(onResize));
+ return () => {
+ stopElement();
+ stopContainer();
+ };
+}
+function shouldDrag(direction, drag, currentDirection) {
+ return ((drag === true || drag === direction) &&
+ (currentDirection === null || currentDirection === direction));
+}
+/**
+ * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
+ * than the provided threshold, return `null`.
+ *
+ * @param offset - The x/y offset from origin.
+ * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
+ */
+function getCurrentDirection(offset, lockThreshold = 10) {
+ let direction = null;
+ if (Math.abs(offset.y) > lockThreshold) {
+ direction = "y";
+ }
+ else if (Math.abs(offset.x) > lockThreshold) {
+ direction = "x";
+ }
+ return direction;
+}
+
+class DragGesture extends motionDom.Feature {
+ constructor(node) {
+ super(node);
+ this.removeGroupControls = motionUtils.noop;
+ this.removeListeners = motionUtils.noop;
+ this.controls = new VisualElementDragControls(node);
+ }
+ mount() {
+ // If we've been provided a DragControls for manual control over the drag gesture,
+ // subscribe this component to it on mount.
+ const { dragControls } = this.node.getProps();
+ if (dragControls) {
+ this.removeGroupControls = dragControls.subscribe(this.controls);
+ }
+ this.removeListeners = this.controls.addListeners() || motionUtils.noop;
+ }
+ update() {
+ const { dragControls } = this.node.getProps();
+ const { dragControls: prevDragControls } = this.node.prevProps || {};
+ if (dragControls !== prevDragControls) {
+ this.removeGroupControls();
+ if (dragControls) {
+ this.removeGroupControls = dragControls.subscribe(this.controls);
+ }
+ }
+ }
+ unmount() {
+ this.removeGroupControls();
+ this.removeListeners();
+ /**
+ * In React 19, during list reorder reconciliation, components may
+ * briefly unmount and remount while the drag is still active. If we're
+ * actively dragging, we should NOT end the pan session - it will
+ * continue tracking pointer events via its window-level listeners.
+ *
+ * The pan session will be properly cleaned up when:
+ * 1. The drag ends naturally (pointerup/pointercancel)
+ * 2. The component is truly removed from the DOM
+ */
+ if (!this.controls.isDragging) {
+ this.controls.endPanSession();
+ }
+ }
+}
+
+const asyncHandler = (handler) => (event, info) => {
+ if (handler) {
+ motionDom.frame.update(() => handler(event, info), false, true);
+ }
+};
+class PanGesture extends motionDom.Feature {
+ constructor() {
+ super(...arguments);
+ this.removePointerDownListener = motionUtils.noop;
+ }
+ onPointerDown(pointerDownEvent) {
+ this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
+ transformPagePoint: this.node.getTransformPagePoint(),
+ contextWindow: getContextWindow(this.node),
+ });
+ }
+ createPanHandlers() {
+ const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
+ return {
+ onSessionStart: asyncHandler(onPanSessionStart),
+ onStart: asyncHandler(onPanStart),
+ onMove: asyncHandler(onPan),
+ onEnd: (event, info) => {
+ delete this.session;
+ if (onPanEnd) {
+ motionDom.frame.postRender(() => onPanEnd(event, info));
+ }
+ },
+ };
+ }
+ mount() {
+ this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
+ }
+ update() {
+ this.session && this.session.updateHandlers(this.createPanHandlers());
+ }
+ unmount() {
+ this.removePointerDownListener();
+ this.session && this.session.end();
+ }
+}
+
+/**
+ * Track whether we've taken any snapshots yet. If not,
+ * we can safely skip notification of didUpdate.
+ *
+ * Difficult to capture in a test but to prevent flickering
+ * we must set this to true either on update or unmount.
+ * Running `next-env/layout-id` in Safari will show this behaviour if broken.
+ */
+let hasTakenAnySnapshot = false;
+class MeasureLayoutWithContext extends React.Component {
+ /**
+ * This only mounts projection nodes for components that
+ * need measuring, we might want to do it for all components
+ * in order to incorporate transforms
+ */
+ componentDidMount() {
+ const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
+ const { projection } = visualElement;
+ if (projection) {
+ if (layoutGroup.group)
+ layoutGroup.group.add(projection);
+ if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {
+ switchLayoutGroup.register(projection);
+ }
+ if (hasTakenAnySnapshot) {
+ projection.root.didUpdate();
+ }
+ projection.addEventListener("animationComplete", () => {
+ this.safeToRemove();
+ });
+ projection.setOptions({
+ ...projection.options,
+ layoutDependency: this.props.layoutDependency,
+ onExitComplete: () => this.safeToRemove(),
+ });
+ }
+ motionDom.globalProjectionState.hasEverUpdated = true;
+ }
+ getSnapshotBeforeUpdate(prevProps) {
+ const { layoutDependency, visualElement, drag, isPresent } = this.props;
+ const { projection } = visualElement;
+ if (!projection)
+ return null;
+ /**
+ * TODO: We use this data in relegate to determine whether to
+ * promote a previous element. There's no guarantee its presence data
+ * will have updated by this point - if a bug like this arises it will
+ * have to be that we markForRelegation and then find a new lead some other way,
+ * perhaps in didUpdate
+ */
+ projection.isPresent = isPresent;
+ if (prevProps.layoutDependency !== layoutDependency) {
+ projection.setOptions({
+ ...projection.options,
+ layoutDependency,
+ });
+ }
+ hasTakenAnySnapshot = true;
+ if (drag ||
+ prevProps.layoutDependency !== layoutDependency ||
+ layoutDependency === undefined ||
+ prevProps.isPresent !== isPresent) {
+ projection.willUpdate();
+ }
+ else {
+ this.safeToRemove();
+ }
+ if (prevProps.isPresent !== isPresent) {
+ if (isPresent) {
+ projection.promote();
+ }
+ else if (!projection.relegate()) {
+ /**
+ * If there's another stack member taking over from this one,
+ * it's in charge of the exit animation and therefore should
+ * be in charge of the safe to remove. Otherwise we call it here.
+ */
+ motionDom.frame.postRender(() => {
+ const stack = projection.getStack();
+ if (!stack || !stack.members.length) {
+ this.safeToRemove();
+ }
+ });
+ }
+ }
+ return null;
+ }
+ componentDidUpdate() {
+ const { projection } = this.props.visualElement;
+ if (projection) {
+ projection.root.didUpdate();
+ motionDom.microtask.postRender(() => {
+ if (!projection.currentAnimation && projection.isLead()) {
+ this.safeToRemove();
+ }
+ });
+ }
+ }
+ componentWillUnmount() {
+ const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;
+ const { projection } = visualElement;
+ hasTakenAnySnapshot = true;
+ if (projection) {
+ projection.scheduleCheckAfterUnmount();
+ if (layoutGroup && layoutGroup.group)
+ layoutGroup.group.remove(projection);
+ if (promoteContext && promoteContext.deregister)
+ promoteContext.deregister(projection);
+ }
+ }
+ safeToRemove() {
+ const { safeToRemove } = this.props;
+ safeToRemove && safeToRemove();
+ }
+ render() {
+ return null;
+ }
+}
+function MeasureLayout(props) {
+ const [isPresent, safeToRemove] = usePresence();
+ const layoutGroup = React.useContext(LayoutGroupContext);
+ return (jsxRuntime.jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: React.useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));
+}
+
+const drag = {
+ pan: {
+ Feature: PanGesture,
+ },
+ drag: {
+ Feature: DragGesture,
+ ProjectionNode: motionDom.HTMLProjectionNode,
+ MeasureLayout,
+ },
+};
+
+function handleHoverEvent(node, event, lifecycle) {
+ const { props } = node;
+ if (node.animationState && props.whileHover) {
+ node.animationState.setActive("whileHover", lifecycle === "Start");
+ }
+ const eventName = ("onHover" + lifecycle);
+ const callback = props[eventName];
+ if (callback) {
+ motionDom.frame.postRender(() => callback(event, extractEventInfo(event)));
+ }
+}
+class HoverGesture extends motionDom.Feature {
+ mount() {
+ const { current } = this.node;
+ if (!current)
+ return;
+ this.unmount = motionDom.hover(current, (_element, startEvent) => {
+ handleHoverEvent(this.node, startEvent, "Start");
+ return (endEvent) => handleHoverEvent(this.node, endEvent, "End");
+ });
+ }
+ unmount() { }
+}
+
+class FocusGesture extends motionDom.Feature {
+ constructor() {
+ super(...arguments);
+ this.isActive = false;
+ }
+ onFocus() {
+ let isFocusVisible = false;
+ /**
+ * If this element doesn't match focus-visible then don't
+ * apply whileHover. But, if matches throws that focus-visible
+ * is not a valid selector then in that browser outline styles will be applied
+ * to the element by default and we want to match that behaviour with whileFocus.
+ */
+ try {
+ isFocusVisible = this.node.current.matches(":focus-visible");
+ }
+ catch (e) {
+ isFocusVisible = true;
+ }
+ if (!isFocusVisible || !this.node.animationState)
+ return;
+ this.node.animationState.setActive("whileFocus", true);
+ this.isActive = true;
+ }
+ onBlur() {
+ if (!this.isActive || !this.node.animationState)
+ return;
+ this.node.animationState.setActive("whileFocus", false);
+ this.isActive = false;
+ }
+ mount() {
+ this.unmount = motionUtils.pipe(motionDom.addDomEvent(this.node.current, "focus", () => this.onFocus()), motionDom.addDomEvent(this.node.current, "blur", () => this.onBlur()));
+ }
+ unmount() { }
+}
+
+function handlePressEvent(node, event, lifecycle) {
+ const { props } = node;
+ if (node.current instanceof HTMLButtonElement && node.current.disabled) {
+ return;
+ }
+ if (node.animationState && props.whileTap) {
+ node.animationState.setActive("whileTap", lifecycle === "Start");
+ }
+ const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle));
+ const callback = props[eventName];
+ if (callback) {
+ motionDom.frame.postRender(() => callback(event, extractEventInfo(event)));
+ }
+}
+class PressGesture extends motionDom.Feature {
+ mount() {
+ const { current } = this.node;
+ if (!current)
+ return;
+ const { globalTapTarget, propagate } = this.node.props;
+ this.unmount = motionDom.press(current, (_element, startEvent) => {
+ handlePressEvent(this.node, startEvent, "Start");
+ return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel");
+ }, {
+ useGlobalTarget: globalTapTarget,
+ stopPropagation: propagate?.tap === false,
+ });
+ }
+ unmount() { }
+}
+
+/**
+ * Map an IntersectionHandler callback to an element. We only ever make one handler for one
+ * element, so even though these handlers might all be triggered by different
+ * observers, we can keep them in the same map.
+ */
+const observerCallbacks = new WeakMap();
+/**
+ * Multiple observers can be created for multiple element/document roots. Each with
+ * different settings. So here we store dictionaries of observers to each root,
+ * using serialised settings (threshold/margin) as lookup keys.
+ */
+const observers = new WeakMap();
+const fireObserverCallback = (entry) => {
+ const callback = observerCallbacks.get(entry.target);
+ callback && callback(entry);
+};
+const fireAllObserverCallbacks = (entries) => {
+ entries.forEach(fireObserverCallback);
+};
+function initIntersectionObserver({ root, ...options }) {
+ const lookupRoot = root || document;
+ /**
+ * If we don't have an observer lookup map for this root, create one.
+ */
+ if (!observers.has(lookupRoot)) {
+ observers.set(lookupRoot, {});
+ }
+ const rootObservers = observers.get(lookupRoot);
+ const key = JSON.stringify(options);
+ /**
+ * If we don't have an observer for this combination of root and settings,
+ * create one.
+ */
+ if (!rootObservers[key]) {
+ rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });
+ }
+ return rootObservers[key];
+}
+function observeIntersection(element, options, callback) {
+ const rootInteresectionObserver = initIntersectionObserver(options);
+ observerCallbacks.set(element, callback);
+ rootInteresectionObserver.observe(element);
+ return () => {
+ observerCallbacks.delete(element);
+ rootInteresectionObserver.unobserve(element);
+ };
+}
+
+const thresholdNames = {
+ some: 0,
+ all: 1,
+};
+class InViewFeature extends motionDom.Feature {
+ constructor() {
+ super(...arguments);
+ this.hasEnteredView = false;
+ this.isInView = false;
+ }
+ startObserver() {
+ this.unmount();
+ const { viewport = {} } = this.node.getProps();
+ const { root, margin: rootMargin, amount = "some", once } = viewport;
+ const options = {
+ root: root ? root.current : undefined,
+ rootMargin,
+ threshold: typeof amount === "number" ? amount : thresholdNames[amount],
+ };
+ const onIntersectionUpdate = (entry) => {
+ const { isIntersecting } = entry;
+ /**
+ * If there's been no change in the viewport state, early return.
+ */
+ if (this.isInView === isIntersecting)
+ return;
+ this.isInView = isIntersecting;
+ /**
+ * Handle hasEnteredView. If this is only meant to run once, and
+ * element isn't visible, early return. Otherwise set hasEnteredView to true.
+ */
+ if (once && !isIntersecting && this.hasEnteredView) {
+ return;
+ }
+ else if (isIntersecting) {
+ this.hasEnteredView = true;
+ }
+ if (this.node.animationState) {
+ this.node.animationState.setActive("whileInView", isIntersecting);
+ }
+ /**
+ * Use the latest committed props rather than the ones in scope
+ * when this observer is created
+ */
+ const { onViewportEnter, onViewportLeave } = this.node.getProps();
+ const callback = isIntersecting ? onViewportEnter : onViewportLeave;
+ callback && callback(entry);
+ };
+ return observeIntersection(this.node.current, options, onIntersectionUpdate);
+ }
+ mount() {
+ this.startObserver();
+ }
+ update() {
+ if (typeof IntersectionObserver === "undefined")
+ return;
+ const { props, prevProps } = this.node;
+ const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps));
+ if (hasOptionsChanged) {
+ this.startObserver();
+ }
+ }
+ unmount() { }
+}
+function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {
+ return (name) => viewport[name] !== prevViewport[name];
+}
+
+const gestureAnimations = {
+ inView: {
+ Feature: InViewFeature,
+ },
+ tap: {
+ Feature: PressGesture,
+ },
+ focus: {
+ Feature: FocusGesture,
+ },
+ hover: {
+ Feature: HoverGesture,
+ },
+};
+
+const layout = {
+ layout: {
+ ProjectionNode: motionDom.HTMLProjectionNode,
+ MeasureLayout,
+ },
+};
+
+const featureBundle = {
+ ...animations,
+ ...gestureAnimations,
+ ...drag,
+ ...layout,
+};
+
+exports.LayoutGroupContext = LayoutGroupContext;
+exports.LazyContext = LazyContext;
+exports.MotionConfigContext = MotionConfigContext;
+exports.MotionContext = MotionContext;
+exports.PresenceContext = PresenceContext;
+exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext;
+exports.addPointerEvent = addPointerEvent;
+exports.addPointerInfo = addPointerInfo;
+exports.animations = animations;
+exports.createDomVisualElement = createDomVisualElement;
+exports.createMotionComponent = createMotionComponent;
+exports.distance = distance;
+exports.distance2D = distance2D;
+exports.drag = drag;
+exports.featureBundle = featureBundle;
+exports.filterProps = filterProps;
+exports.gestureAnimations = gestureAnimations;
+exports.isBrowser = isBrowser;
+exports.isValidMotionProp = isValidMotionProp;
+exports.layout = layout;
+exports.loadExternalIsValidProp = loadExternalIsValidProp;
+exports.loadFeatures = loadFeatures;
+exports.makeUseVisualState = makeUseVisualState;
+exports.motionComponentSymbol = motionComponentSymbol;
+exports.useConstant = useConstant;
+exports.useIsPresent = useIsPresent;
+exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
+exports.usePresence = usePresence;
+//# sourceMappingURL=feature-bundle-CUI5saed.js.map
diff --git a/node_modules/framer-motion/dist/cjs/feature-bundle-CUI5saed.js.map b/node_modules/framer-motion/dist/cjs/feature-bundle-CUI5saed.js.map
new file mode 100644
index 0000000..ab1722e
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/feature-bundle-CUI5saed.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"feature-bundle-CUI5saed.js","sources":["../../src/context/LayoutGroupContext.ts","../../src/utils/use-constant.ts","../../src/utils/is-browser.ts","../../src/utils/use-isomorphic-effect.ts","../../src/context/PresenceContext.ts","../../src/context/MotionConfigContext.tsx","../../src/components/AnimatePresence/use-presence.ts","../../src/context/LazyContext.ts","../../src/motion/features/definitions.ts","../../src/motion/features/load-features.ts","../../src/motion/utils/valid-prop.ts","../../src/render/dom/utils/filter-props.ts","../../src/render/svg/lowercase-elements.ts","../../src/render/dom/utils/is-svg-component.ts","../../src/render/dom/create-visual-element.ts","../../src/context/MotionContext/index.ts","../../src/context/MotionContext/utils.ts","../../src/context/MotionContext/create.ts","../../src/render/html/utils/create-render-state.ts","../../src/render/html/use-props.ts","../../src/render/svg/utils/create-render-state.ts","../../src/render/svg/use-props.ts","../../src/render/dom/use-render.ts","../../src/motion/utils/use-visual-state.ts","../../src/render/html/use-html-visual-state.ts","../../src/render/svg/use-svg-visual-state.ts","../../src/motion/utils/symbol.ts","../../src/motion/utils/use-motion-ref.ts","../../src/context/SwitchLayoutGroupContext.ts","../../src/utils/is-ref-object.ts","../../src/motion/utils/use-visual-element.ts","../../src/motion/index.tsx","../../src/motion/features/animation/index.ts","../../src/motion/features/animation/exit.ts","../../src/motion/features/animations.ts","../../src/events/event-info.ts","../../src/events/add-pointer-event.ts","../../src/utils/get-context-window.ts","../../src/utils/distance.ts","../../src/gestures/pan/PanSession.ts","../../src/gestures/drag/utils/constraints.ts","../../src/gestures/drag/VisualElementDragControls.ts","../../src/gestures/drag/index.ts","../../src/gestures/pan/index.ts","../../src/motion/features/layout/MeasureLayout.tsx","../../src/motion/features/drag.ts","../../src/gestures/hover.ts","../../src/gestures/focus.ts","../../src/gestures/press.ts","../../src/motion/features/viewport/observers.ts","../../src/motion/features/viewport/index.ts","../../src/motion/features/gestures.ts","../../src/motion/features/layout.ts","../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { NodeGroup } from \"motion-dom\"\n\nexport interface LayoutGroupContextProps {\n id?: string\n group?: NodeGroup\n forceRender?: VoidFunction\n}\n\nexport const LayoutGroupContext = createContext({})\n","\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","export const isBrowser = typeof window !== \"undefined\"\n","\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n","\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n","\"use client\"\n\nimport { useCallback, useContext, useEffect, useId } from \"react\"\nimport {\n PresenceContext,\n PresenceContextProps,\n} from \"../../context/PresenceContext\"\n\nexport type SafeToRemove = () => void\n\ntype AlwaysPresent = [true, null]\n\ntype Present = [true]\n\ntype NotPresent = [false, SafeToRemove]\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return \n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(\n subscribe: boolean = true\n): AlwaysPresent | Present | NotPresent {\n const context = useContext(PresenceContext)\n\n if (context === null) return [true, null]\n\n const { isPresent, onExitComplete, register } = context\n\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n\n const id = useId()\n useEffect(() => {\n if (subscribe) {\n return register(id)\n }\n }, [subscribe])\n\n const safeToRemove = useCallback(\n () => subscribe && onExitComplete && onExitComplete(id),\n [id, onExitComplete, subscribe]\n )\n\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true]\n}\n\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext))\n}\n\nexport function isPresent(context: PresenceContextProps | null) {\n return context === null ? true : context.isPresent\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n","import { setFeatureDefinitions } from \"motion-dom\"\nimport { getInitializedFeatureDefinitions } from \"./definitions\"\nimport { FeaturePackages } from \"./types\"\n\nexport function loadFeatures(features: FeaturePackages) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n\n for (const key in features) {\n featureDefinitions[key as keyof typeof featureDefinitions] = {\n ...featureDefinitions[key as keyof typeof featureDefinitions],\n ...features[key as keyof typeof features],\n } as any\n }\n\n setFeatureDefinitions(featureDefinitions)\n}\n","import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n","import type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\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} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (\n 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\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n","import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\"\nimport { ComponentType, Fragment } from \"react\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType>,\n options: VisualElementOptions\n) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component)\n\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n","import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n","import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n","\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n","import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n","\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n","\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n","\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n","\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n","import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n","\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n","\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { isBrowser } from \"../utils/is-browser\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps
[\"children\"]\n : MotionComponentProps
[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n","import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n","import { Feature } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature {\n private id: number = id++\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n","import { AnimationFeature } from \"./animation\"\nimport { ExitAnimationFeature } from \"./animation/exit\"\nimport { FeaturePackages } from \"./types\"\n\nexport const animations: FeaturePackages = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n}\n","import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo = (\n handler: EventListenerWithPointInfo\n): EventListener => {\n return (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n}\n","import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n","import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement) => {\n return current ? current.ownerDocument.defaultView : null\n}\n","import { Point } from \"motion-utils\"\n\nexport const distance = (a: number, b: number) => Math.abs(a - b)\n\nexport function distance2D(a: Point, b: Point): number {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x)\n const yDelta = distance(a.y, b.y)\n return Math.sqrt(xDelta ** 2 + yDelta ** 2)\n}\n","import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll)\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n","import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial\n): Partial {\n const relativeConstraints: Partial = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n","import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (dragSnapToOrigin) transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n (props.initial\n ? props.initial[axis as keyof typeof props.initial]\n : undefined) || 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n","import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n","import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n","\"use client\"\n\nimport { frame, microtask, globalProjectionState, type VisualElement } from \"motion-dom\"\nimport { Component, useContext } from \"react\"\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../../context/LayoutGroupContext\"\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../types\"\n\ninterface MeasureContextProps {\n layoutGroup: LayoutGroupContextProps\n switchLayoutGroup?: SwitchLayoutGroupContext\n isPresent: boolean\n safeToRemove?: VoidFunction | null\n}\n\ntype MeasureProps = MotionProps &\n MeasureContextProps & { visualElement: VisualElement }\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } =\n this.props\n const { projection } = visualElement\n\n if (projection) {\n if (layoutGroup.group) layoutGroup.group.add(projection)\n\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection)\n }\n\n if (hasTakenAnySnapshot) {\n projection.root!.didUpdate()\n }\n\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove()\n })\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n })\n }\n\n globalProjectionState.hasEverUpdated = true\n }\n\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props\n const { projection } = visualElement\n\n if (!projection) return null\n\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent\n\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n })\n }\n\n hasTakenAnySnapshot = true\n\n if (\n drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent\n ) {\n projection.willUpdate()\n } else {\n this.safeToRemove()\n }\n\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote()\n } else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack()\n if (!stack || !stack.members.length) {\n this.safeToRemove()\n }\n })\n }\n }\n\n return null\n }\n\n componentDidUpdate() {\n const { projection } = this.props.visualElement\n if (projection) {\n projection.root!.didUpdate()\n\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove()\n }\n })\n }\n }\n\n componentWillUnmount() {\n const {\n visualElement,\n layoutGroup,\n switchLayoutGroup: promoteContext,\n } = this.props\n const { projection } = visualElement\n\n hasTakenAnySnapshot = true\n\n if (projection) {\n projection.scheduleCheckAfterUnmount()\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection)\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection)\n }\n }\n\n safeToRemove() {\n const { safeToRemove } = this.props\n safeToRemove && safeToRemove()\n }\n\n render() {\n return null\n }\n}\n\nexport function MeasureLayout(\n props: MotionProps & { visualElement: VisualElement }\n) {\n const [isPresent, safeToRemove] = usePresence()\n const layoutGroup = useContext(LayoutGroupContext)\n\n return (\n \n )\n}\n","import { DragGesture } from \"../../gestures/drag\"\nimport { PanGesture } from \"../../gestures/pan\"\nimport { HTMLProjectionNode } from \"../../projection\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const drag: FeaturePackages = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n","import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n","import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n }\n )\n }\n\n unmount() {}\n}\n","type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)\n }\n}\n","import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature {\n private hasEnteredView = false\n\n private isInView = false\n\n private startObserver() {\n this.unmount()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n return observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {}\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n","import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n","import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":["createContext","useRef","useLayoutEffect","useEffect","useContext","useId","useCallback","setFeatureDefinitions","getFeatureDefinitions","SVGVisualElement","HTMLVisualElement","Fragment","isControllingVariants","isVariantLabel","useMemo","isMotionValue","isForcedMotionValue","buildHTMLStyles","buildSVGAttrs","isSVGTag","createElement","resolveMotionValue","checkIsControllingVariants","checkIsVariantNode","isAnimationControls","resolveVariantFromProps","scrapeHTMLMotionValuesFromProps","scrapeSVGMotionValuesFromProps","useInsertionEffect","optimizedAppearDataAttribute","_jsxs","_jsx","forwardRef","warning","invariant","Feature","createAnimationState","isPrimaryPointer","addDomEvent","frameData","frame","pipe","cancelFrame","secondsToMilliseconds","millisecondsToSeconds","mixNumber","calcLength","calcProgress","clamp","createBox","setDragLock","eachAxis","percent","addValueToWillChange","measurePageBox","convertBoxToBoundingBox","convertBoundingBoxToBox","animateMotionValue","isElementTextInput","resize","noop","Component","globalProjectionState","microtask","HTMLProjectionNode","hover","press"],"mappings":";;;;;;;MAWa,kBAAkB,GAAGA,mBAAa,CAA0B,EAAE;;ACL3E;;;;;;AAMG;AACG,SAAU,WAAW,CAAI,IAAa,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGC,YAAM,CAAW,IAAI,CAAC,CAAA;AAElC,IAAA,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE;AACtB,QAAA,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE,CAAA;KACvB;IAED,OAAO,GAAG,CAAC,OAAO,CAAA;AACtB;;MCrBa,SAAS,GAAG,OAAO,MAAM,KAAK;;ACKpC,MAAM,yBAAyB,GAAG,SAAS,GAAGC,qBAAe,GAAGC;;ACEvE;;AAEG;MACU,eAAe;AACxB,gBAAgBH,mBAAa,CAA8B,IAAI;;AC8CnE;;AAE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B,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/framer-motion/dist/cjs/index.js b/node_modules/framer-motion/dist/cjs/index.js
new file mode 100644
index 0000000..e886a59
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/index.js
@@ -0,0 +1,3383 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var jsxRuntime = require('react/jsx-runtime');
+var React = require('react');
+var featureBundle = require('./feature-bundle-CUI5saed.js');
+var motionDom = require('motion-dom');
+var motionUtils = require('motion-utils');
+
+function _interopNamespaceDefault(e) {
+ var n = Object.create(null);
+ if (e) {
+ Object.keys(e).forEach(function (k) {
+ if (k !== 'default') {
+ var d = Object.getOwnPropertyDescriptor(e, k);
+ Object.defineProperty(n, k, d.get ? d : {
+ enumerable: true,
+ get: function () { return e[k]; }
+ });
+ }
+ });
+ }
+ n.default = e;
+ return Object.freeze(n);
+}
+
+var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
+
+/**
+ * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx
+ */
+/**
+ * Set a given ref to a given value
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
+ */
+function setRef(ref, value) {
+ if (typeof ref === "function") {
+ return ref(value);
+ }
+ else if (ref !== null && ref !== undefined) {
+ ref.current = value;
+ }
+}
+/**
+ * A utility to compose multiple refs together
+ * Accepts callback refs and RefObject(s)
+ */
+function composeRefs(...refs) {
+ return (node) => {
+ let hasCleanup = false;
+ const cleanups = refs.map((ref) => {
+ const cleanup = setRef(ref, node);
+ if (!hasCleanup && typeof cleanup === "function") {
+ hasCleanup = true;
+ }
+ return cleanup;
+ });
+ // React <19 will log an error to the console if a callback ref returns a
+ // value. We don't use ref cleanups internally so this will only happen if a
+ // user's ref callback returns a value, which we only expect if they are
+ // using the cleanup functionality added in React 19.
+ if (hasCleanup) {
+ return () => {
+ for (let i = 0; i < cleanups.length; i++) {
+ const cleanup = cleanups[i];
+ if (typeof cleanup === "function") {
+ cleanup();
+ }
+ else {
+ setRef(refs[i], null);
+ }
+ }
+ };
+ }
+ };
+}
+/**
+ * A custom hook that composes multiple refs
+ * Accepts callback refs and RefObject(s)
+ */
+function useComposedRefs(...refs) {
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ return React__namespace.useCallback(composeRefs(...refs), refs);
+}
+
+/**
+ * Measurement functionality has to be within a separate component
+ * to leverage snapshot lifecycle.
+ */
+class PopChildMeasure extends React__namespace.Component {
+ getSnapshotBeforeUpdate(prevProps) {
+ const element = this.props.childRef.current;
+ if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {
+ const parent = element.offsetParent;
+ const parentWidth = motionDom.isHTMLElement(parent)
+ ? parent.offsetWidth || 0
+ : 0;
+ const parentHeight = motionDom.isHTMLElement(parent)
+ ? parent.offsetHeight || 0
+ : 0;
+ const size = this.props.sizeRef.current;
+ size.height = element.offsetHeight || 0;
+ size.width = element.offsetWidth || 0;
+ size.top = element.offsetTop;
+ size.left = element.offsetLeft;
+ size.right = parentWidth - size.width - size.left;
+ size.bottom = parentHeight - size.height - size.top;
+ }
+ return null;
+ }
+ /**
+ * Required with getSnapshotBeforeUpdate to stop React complaining.
+ */
+ componentDidUpdate() { }
+ render() {
+ return this.props.children;
+ }
+}
+function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) {
+ const id = React.useId();
+ const ref = React.useRef(null);
+ const size = React.useRef({
+ width: 0,
+ height: 0,
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ });
+ const { nonce } = React.useContext(featureBundle.MotionConfigContext);
+ /**
+ * In React 19, refs are passed via props.ref instead of element.ref.
+ * We check props.ref first (React 19) and fall back to element.ref (React 18).
+ */
+ const childRef = children.props?.ref ??
+ children?.ref;
+ const composedRef = useComposedRefs(ref, childRef);
+ /**
+ * We create and inject a style block so we can apply this explicit
+ * sizing in a non-destructive manner by just deleting the style block.
+ *
+ * We can't apply size via render as the measurement happens
+ * in getSnapshotBeforeUpdate (post-render), likewise if we apply the
+ * styles directly on the DOM node, we might be overwriting
+ * styles set via the style prop.
+ */
+ React.useInsertionEffect(() => {
+ const { width, height, top, left, right, bottom } = size.current;
+ if (isPresent || pop === false || !ref.current || !width || !height)
+ return;
+ const x = anchorX === "left" ? `left: ${left}` : `right: ${right}`;
+ const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`;
+ ref.current.dataset.motionPopId = id;
+ const style = document.createElement("style");
+ if (nonce)
+ style.nonce = nonce;
+ const parent = root ?? document.head;
+ parent.appendChild(style);
+ if (style.sheet) {
+ style.sheet.insertRule(`
+ [data-motion-pop-id="${id}"] {
+ position: absolute !important;
+ width: ${width}px !important;
+ height: ${height}px !important;
+ ${x}px !important;
+ ${y}px !important;
+ }
+ `);
+ }
+ return () => {
+ if (parent.contains(style)) {
+ parent.removeChild(style);
+ }
+ };
+ }, [isPresent]);
+ return (jsxRuntime.jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false
+ ? children
+ : React__namespace.cloneElement(children, { ref: composedRef }) }));
+}
+
+const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => {
+ const presenceChildren = featureBundle.useConstant(newChildrenMap);
+ const id = React.useId();
+ let isReusedContext = true;
+ let context = React.useMemo(() => {
+ isReusedContext = false;
+ return {
+ id,
+ initial,
+ isPresent,
+ custom,
+ onExitComplete: (childId) => {
+ presenceChildren.set(childId, true);
+ for (const isComplete of presenceChildren.values()) {
+ if (!isComplete)
+ return; // can stop searching when any is incomplete
+ }
+ onExitComplete && onExitComplete();
+ },
+ register: (childId) => {
+ presenceChildren.set(childId, false);
+ return () => presenceChildren.delete(childId);
+ },
+ };
+ }, [isPresent, presenceChildren, onExitComplete]);
+ /**
+ * If the presence of a child affects the layout of the components around it,
+ * we want to make a new context value to ensure they get re-rendered
+ * so they can detect that layout change.
+ */
+ if (presenceAffectsLayout && isReusedContext) {
+ context = { ...context };
+ }
+ React.useMemo(() => {
+ presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
+ }, [isPresent]);
+ /**
+ * If there's no `motion` components to fire exit animations, we want to remove this
+ * component immediately.
+ */
+ React__namespace.useEffect(() => {
+ !isPresent &&
+ !presenceChildren.size &&
+ onExitComplete &&
+ onExitComplete();
+ }, [isPresent]);
+ children = (jsxRuntime.jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children }));
+ return (jsxRuntime.jsx(featureBundle.PresenceContext.Provider, { value: context, children: children }));
+};
+function newChildrenMap() {
+ return new Map();
+}
+
+const getChildKey = (child) => child.key || "";
+function onlyElements(children) {
+ const filtered = [];
+ // We use forEach here instead of map as map mutates the component key by preprending `.$`
+ React.Children.forEach(children, (child) => {
+ if (React.isValidElement(child))
+ filtered.push(child);
+ });
+ return filtered;
+}
+
+/**
+ * `AnimatePresence` enables the animation of components that have been removed from the tree.
+ *
+ * When adding/removing more than a single child, every child **must** be given a unique `key` prop.
+ *
+ * Any `motion` components that have an `exit` property defined will animate out when removed from
+ * the tree.
+ *
+ * ```jsx
+ * import { motion, AnimatePresence } from 'framer-motion'
+ *
+ * export const Items = ({ items }) => (
+ *
+ * {items.map(item => (
+ *
+ * ))}
+ *
+ * )
+ * ```
+ *
+ * You can sequence exit animations throughout a tree using variants.
+ *
+ * If a child contains multiple `motion` components with `exit` props, it will only unmount the child
+ * once all `motion` components have finished animating out. Likewise, any components using
+ * `usePresence` all need to call `safeToRemove`.
+ *
+ * @public
+ */
+const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => {
+ const [isParentPresent, safeToRemove] = featureBundle.usePresence(propagate);
+ /**
+ * Filter any children that aren't ReactElements. We can only track components
+ * between renders with a props.key.
+ */
+ const presentChildren = React.useMemo(() => onlyElements(children), [children]);
+ /**
+ * Track the keys of the currently rendered children. This is used to
+ * determine which children are exiting.
+ */
+ const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);
+ /**
+ * If `initial={false}` we only want to pass this to components in the first render.
+ */
+ const isInitialRender = React.useRef(true);
+ /**
+ * A ref containing the currently present children. When all exit animations
+ * are complete, we use this to re-render the component with the latest children
+ * *committed* rather than the latest children *rendered*.
+ */
+ const pendingPresentChildren = React.useRef(presentChildren);
+ /**
+ * Track which exiting children have finished animating out.
+ */
+ const exitComplete = featureBundle.useConstant(() => new Map());
+ /**
+ * Track which components are currently processing exit to prevent duplicate processing.
+ */
+ const exitingComponents = React.useRef(new Set());
+ /**
+ * Save children to render as React state. To ensure this component is concurrent-safe,
+ * we check for exiting children via an effect.
+ */
+ const [diffedChildren, setDiffedChildren] = React.useState(presentChildren);
+ const [renderedChildren, setRenderedChildren] = React.useState(presentChildren);
+ featureBundle.useIsomorphicLayoutEffect(() => {
+ isInitialRender.current = false;
+ pendingPresentChildren.current = presentChildren;
+ /**
+ * Update complete status of exiting children.
+ */
+ for (let i = 0; i < renderedChildren.length; i++) {
+ const key = getChildKey(renderedChildren[i]);
+ if (!presentKeys.includes(key)) {
+ if (exitComplete.get(key) !== true) {
+ exitComplete.set(key, false);
+ }
+ }
+ else {
+ exitComplete.delete(key);
+ exitingComponents.current.delete(key);
+ }
+ }
+ }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
+ const exitingChildren = [];
+ if (presentChildren !== diffedChildren) {
+ let nextChildren = [...presentChildren];
+ /**
+ * Loop through all the currently rendered components and decide which
+ * are exiting.
+ */
+ for (let i = 0; i < renderedChildren.length; i++) {
+ const child = renderedChildren[i];
+ const key = getChildKey(child);
+ if (!presentKeys.includes(key)) {
+ nextChildren.splice(i, 0, child);
+ exitingChildren.push(child);
+ }
+ }
+ /**
+ * If we're in "wait" mode, and we have exiting children, we want to
+ * only render these until they've all exited.
+ */
+ if (mode === "wait" && exitingChildren.length) {
+ nextChildren = exitingChildren;
+ }
+ setRenderedChildren(onlyElements(nextChildren));
+ setDiffedChildren(presentChildren);
+ /**
+ * Early return to ensure once we've set state with the latest diffed
+ * children, we can immediately re-render.
+ */
+ return null;
+ }
+ if (process.env.NODE_ENV !== "production" &&
+ mode === "wait" &&
+ renderedChildren.length > 1) {
+ console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
+ }
+ /**
+ * If we've been provided a forceRender function by the LayoutGroupContext,
+ * we can use it to force a re-render amongst all surrounding components once
+ * all components have finished animating out.
+ */
+ const { forceRender } = React.useContext(featureBundle.LayoutGroupContext);
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderedChildren.map((child) => {
+ const key = getChildKey(child);
+ const isPresent = propagate && !isParentPresent
+ ? false
+ : presentChildren === renderedChildren ||
+ presentKeys.includes(key);
+ const onExit = () => {
+ if (exitingComponents.current.has(key)) {
+ return;
+ }
+ exitingComponents.current.add(key);
+ if (exitComplete.has(key)) {
+ exitComplete.set(key, true);
+ }
+ else {
+ return;
+ }
+ let isEveryExitComplete = true;
+ exitComplete.forEach((isExitComplete) => {
+ if (!isExitComplete)
+ isEveryExitComplete = false;
+ });
+ if (isEveryExitComplete) {
+ forceRender?.();
+ setRenderedChildren(pendingPresentChildren.current);
+ propagate && safeToRemove?.();
+ onExitComplete && onExitComplete();
+ }
+ };
+ return (jsxRuntime.jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial
+ ? undefined
+ : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key));
+ }) }));
+};
+
+/**
+ * Note: Still used by components generated by old versions of Framer
+ *
+ * @deprecated
+ */
+const DeprecatedLayoutGroupContext = React.createContext(null);
+
+function useIsMounted() {
+ const isMounted = React.useRef(false);
+ featureBundle.useIsomorphicLayoutEffect(() => {
+ isMounted.current = true;
+ return () => {
+ isMounted.current = false;
+ };
+ }, []);
+ return isMounted;
+}
+
+function useForceUpdate() {
+ const isMounted = useIsMounted();
+ const [forcedRenderCount, setForcedRenderCount] = React.useState(0);
+ const forceRender = React.useCallback(() => {
+ isMounted.current && setForcedRenderCount(forcedRenderCount + 1);
+ }, [forcedRenderCount]);
+ /**
+ * Defer this to the end of the next animation frame in case there are multiple
+ * synchronous calls.
+ */
+ const deferredForceRender = React.useCallback(() => motionDom.frame.postRender(forceRender), [forceRender]);
+ return [deferredForceRender, forcedRenderCount];
+}
+
+const shouldInheritGroup = (inherit) => inherit === true;
+const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id";
+const LayoutGroup = ({ children, id, inherit = true }) => {
+ const layoutGroupContext = React.useContext(featureBundle.LayoutGroupContext);
+ const deprecatedLayoutGroupContext = React.useContext(DeprecatedLayoutGroupContext);
+ const [forceRender, key] = useForceUpdate();
+ const context = React.useRef(null);
+ const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext;
+ if (context.current === null) {
+ if (shouldInheritId(inherit) && upstreamId) {
+ id = id ? upstreamId + "-" + id : upstreamId;
+ }
+ context.current = {
+ id,
+ group: shouldInheritGroup(inherit)
+ ? layoutGroupContext.group || motionDom.nodeGroup()
+ : motionDom.nodeGroup(),
+ };
+ }
+ const memoizedContext = React.useMemo(() => ({ ...context.current, forceRender }), [key]);
+ return (jsxRuntime.jsx(featureBundle.LayoutGroupContext.Provider, { value: memoizedContext, children: children }));
+};
+
+/**
+ * Used in conjunction with the `m` component to reduce bundle size.
+ *
+ * `m` is a version of the `motion` component that only loads functionality
+ * critical for the initial render.
+ *
+ * `LazyMotion` can then be used to either synchronously or asynchronously
+ * load animation and gesture support.
+ *
+ * ```jsx
+ * // Synchronous loading
+ * import { LazyMotion, m, domAnimation } from "framer-motion"
+ *
+ * function App() {
+ * return (
+ *
+ *
+ *
+ * )
+ * }
+ *
+ * // Asynchronous loading
+ * import { LazyMotion, m } from "framer-motion"
+ *
+ * function App() {
+ * return (
+ * import('./path/to/domAnimation')}>
+ *
+ *
+ * )
+ * }
+ * ```
+ *
+ * @public
+ */
+function LazyMotion({ children, features, strict = false }) {
+ const [, setIsLoaded] = React.useState(!isLazyBundle(features));
+ const loadedRenderer = React.useRef(undefined);
+ /**
+ * If this is a synchronous load, load features immediately
+ */
+ if (!isLazyBundle(features)) {
+ const { renderer, ...loadedFeatures } = features;
+ loadedRenderer.current = renderer;
+ featureBundle.loadFeatures(loadedFeatures);
+ }
+ React.useEffect(() => {
+ if (isLazyBundle(features)) {
+ features().then(({ renderer, ...loadedFeatures }) => {
+ featureBundle.loadFeatures(loadedFeatures);
+ loadedRenderer.current = renderer;
+ setIsLoaded(true);
+ });
+ }
+ }, []);
+ return (jsxRuntime.jsx(featureBundle.LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children }));
+}
+function isLazyBundle(features) {
+ return typeof features === "function";
+}
+
+/**
+ * `MotionConfig` is used to set configuration options for all children `motion` components.
+ *
+ * ```jsx
+ * import { motion, MotionConfig } from "framer-motion"
+ *
+ * export function App() {
+ * return (
+ *
+ *
+ *
+ * )
+ * }
+ * ```
+ *
+ * @public
+ */
+function MotionConfig({ children, isValidProp, ...config }) {
+ isValidProp && featureBundle.loadExternalIsValidProp(isValidProp);
+ /**
+ * Inherit props from any parent MotionConfig components
+ */
+ const parentConfig = React.useContext(featureBundle.MotionConfigContext);
+ config = { ...parentConfig, ...config };
+ config.transition = motionDom.resolveTransition(config.transition, parentConfig.transition);
+ /**
+ * Don't allow isStatic to change between renders as it affects how many hooks
+ * motion components fire.
+ */
+ config.isStatic = featureBundle.useConstant(() => config.isStatic);
+ /**
+ * Creating a new config context object will re-render every `motion` component
+ * every time it renders. So we only want to create a new one sparingly.
+ */
+ const context = React.useMemo(() => config, [
+ JSON.stringify(config.transition),
+ config.transformPagePoint,
+ config.reducedMotion,
+ config.skipAnimations,
+ ]);
+ return (jsxRuntime.jsx(featureBundle.MotionConfigContext.Provider, { value: context, children: children }));
+}
+
+const ReorderContext = React.createContext(null);
+
+function createMotionProxy(preloadedFeatures, createVisualElement) {
+ if (typeof Proxy === "undefined") {
+ return featureBundle.createMotionComponent;
+ }
+ /**
+ * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
+ * Rather than generating them anew every render.
+ */
+ const componentCache = new Map();
+ const factory = (Component, options) => {
+ return featureBundle.createMotionComponent(Component, options, preloadedFeatures, createVisualElement);
+ };
+ /**
+ * Support for deprecated`motion(Component)` pattern
+ */
+ const deprecatedFactoryFunction = (Component, options) => {
+ if (process.env.NODE_ENV !== "production") {
+ motionUtils.warnOnce(false, "motion() is deprecated. Use motion.create() instead.");
+ }
+ return factory(Component, options);
+ };
+ return new Proxy(deprecatedFactoryFunction, {
+ /**
+ * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
+ * The prop name is passed through as `key` and we can use that to generate a `motion`
+ * DOM component with that name.
+ */
+ get: (_target, key) => {
+ if (key === "create")
+ return factory;
+ /**
+ * If this element doesn't exist in the component cache, create it and cache.
+ */
+ if (!componentCache.has(key)) {
+ componentCache.set(key, featureBundle.createMotionComponent(key, undefined, preloadedFeatures, createVisualElement));
+ }
+ return componentCache.get(key);
+ },
+ });
+}
+
+const motion = /*@__PURE__*/ createMotionProxy(featureBundle.featureBundle, featureBundle.createDomVisualElement);
+
+function checkReorder(order, value, offset, velocity) {
+ if (!velocity)
+ return order;
+ const index = order.findIndex((item) => item.value === value);
+ if (index === -1)
+ return order;
+ const nextOffset = velocity > 0 ? 1 : -1;
+ const nextItem = order[index + nextOffset];
+ if (!nextItem)
+ return order;
+ const item = order[index];
+ const nextLayout = nextItem.layout;
+ const nextItemCenter = motionDom.mixNumber(nextLayout.min, nextLayout.max, 0.5);
+ if ((nextOffset === 1 && item.layout.max + offset > nextItemCenter) ||
+ (nextOffset === -1 && item.layout.min + offset < nextItemCenter)) {
+ return motionUtils.moveItem(order, index, index + nextOffset);
+ }
+ return order;
+}
+
+function ReorderGroupComponent({ children, as = "ul", axis = "y", onReorder, values, ...props }, externalRef) {
+ const Component = featureBundle.useConstant(() => motion[as]);
+ const order = [];
+ const isReordering = React.useRef(false);
+ const groupRef = React.useRef(null);
+ motionUtils.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values");
+ const context = {
+ axis,
+ groupRef,
+ registerItem: (value, layout) => {
+ // If the entry was already added, update it rather than adding it again
+ const idx = order.findIndex((entry) => value === entry.value);
+ if (idx !== -1) {
+ order[idx].layout = layout[axis];
+ }
+ else {
+ order.push({ value: value, layout: layout[axis] });
+ }
+ order.sort(compareMin);
+ },
+ updateOrder: (item, offset, velocity) => {
+ if (isReordering.current)
+ return;
+ const newOrder = checkReorder(order, item, offset, velocity);
+ if (order !== newOrder) {
+ isReordering.current = true;
+ onReorder(newOrder
+ .map(getValue)
+ .filter((value) => values.indexOf(value) !== -1));
+ }
+ },
+ };
+ React.useEffect(() => {
+ isReordering.current = false;
+ });
+ // Combine refs if external ref is provided
+ const setRef = (element) => {
+ groupRef.current = element;
+ if (typeof externalRef === "function") {
+ externalRef(element);
+ }
+ else if (externalRef) {
+ externalRef.current = element;
+ }
+ };
+ /**
+ * Disable browser scroll anchoring on the group container.
+ * When items reorder, scroll anchoring can cause the browser to adjust
+ * the scroll position, which interferes with drag position calculations.
+ */
+ const groupStyle = {
+ overflowAnchor: "none",
+ ...props.style,
+ };
+ return (jsxRuntime.jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsxRuntime.jsx(ReorderContext.Provider, { value: context, children: children }) }));
+}
+const ReorderGroup = /*@__PURE__*/ React.forwardRef(ReorderGroupComponent);
+function getValue(item) {
+ return item.value;
+}
+function compareMin(a, b) {
+ return a.layout.min - b.layout.min;
+}
+
+/**
+ * Creates a `MotionValue` to track the state and velocity of a value.
+ *
+ * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.
+ *
+ * ```jsx
+ * export const MyComponent = () => {
+ * const scale = useMotionValue(1)
+ *
+ * return
+ * }
+ * ```
+ *
+ * @param initial - The initial state.
+ *
+ * @public
+ */
+function useMotionValue(initial) {
+ const value = featureBundle.useConstant(() => motionDom.motionValue(initial));
+ /**
+ * If this motion value is being used in static mode, like on
+ * the Framer canvas, force components to rerender when the motion
+ * value is updated.
+ */
+ const { isStatic } = React.useContext(featureBundle.MotionConfigContext);
+ if (isStatic) {
+ const [, setLatest] = React.useState(initial);
+ React.useEffect(() => value.on("change", setLatest), []);
+ }
+ return value;
+}
+
+function useCombineMotionValues(values, combineValues) {
+ /**
+ * Initialise the returned motion value. This remains the same between renders.
+ */
+ const value = useMotionValue(combineValues());
+ /**
+ * Create a function that will update the template motion value with the latest values.
+ * This is pre-bound so whenever a motion value updates it can schedule its
+ * execution in Framesync. If it's already been scheduled it won't be fired twice
+ * in a single frame.
+ */
+ const updateValue = () => value.set(combineValues());
+ /**
+ * Synchronously update the motion value with the latest values during the render.
+ * This ensures that within a React render, the styles applied to the DOM are up-to-date.
+ */
+ updateValue();
+ /**
+ * Subscribe to all motion values found within the template. Whenever any of them change,
+ * schedule an update.
+ */
+ featureBundle.useIsomorphicLayoutEffect(() => {
+ const scheduleUpdate = () => motionDom.frame.preRender(updateValue, false, true);
+ const subscriptions = values.map((v) => v.on("change", scheduleUpdate));
+ return () => {
+ subscriptions.forEach((unsubscribe) => unsubscribe());
+ motionDom.cancelFrame(updateValue);
+ };
+ });
+ return value;
+}
+
+function useComputed(compute) {
+ /**
+ * Open session of collectMotionValues. Any MotionValue that calls get()
+ * will be saved into this array.
+ */
+ motionDom.collectMotionValues.current = [];
+ compute();
+ const value = useCombineMotionValues(motionDom.collectMotionValues.current, compute);
+ /**
+ * Synchronously close session of collectMotionValues.
+ */
+ motionDom.collectMotionValues.current = undefined;
+ return value;
+}
+
+function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) {
+ if (typeof input === "function") {
+ return useComputed(input);
+ }
+ /**
+ * Detect if outputRangeOrMap is an output map (object with keys)
+ * rather than an output range (array).
+ */
+ const isOutputMap = outputRangeOrMap !== undefined &&
+ !Array.isArray(outputRangeOrMap) &&
+ typeof inputRangeOrTransformer !== "function";
+ if (isOutputMap) {
+ return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options);
+ }
+ const outputRange = outputRangeOrMap;
+ const transformer = typeof inputRangeOrTransformer === "function"
+ ? inputRangeOrTransformer
+ : motionDom.transform(inputRangeOrTransformer, outputRange, options);
+ const result = Array.isArray(input)
+ ? useListTransform(input, transformer)
+ : useListTransform([input], ([latest]) => transformer(latest));
+ const inputAccelerate = !Array.isArray(input)
+ ? input.accelerate
+ : undefined;
+ if (inputAccelerate &&
+ !inputAccelerate.isTransformed &&
+ typeof inputRangeOrTransformer !== "function" &&
+ Array.isArray(outputRangeOrMap) &&
+ options?.clamp !== false) {
+ result.accelerate = {
+ ...inputAccelerate,
+ times: inputRangeOrTransformer,
+ keyframes: outputRangeOrMap,
+ isTransformed: true,
+ ...(options?.ease ? { ease: options.ease } : {}),
+ };
+ }
+ return result;
+}
+function useListTransform(values, transformer) {
+ const latest = featureBundle.useConstant(() => []);
+ return useCombineMotionValues(values, () => {
+ latest.length = 0;
+ const numValues = values.length;
+ for (let i = 0; i < numValues; i++) {
+ latest[i] = values[i].get();
+ }
+ return transformer(latest);
+ });
+}
+function useMapTransform(inputValue, inputRange, outputMap, options) {
+ /**
+ * Capture keys once to ensure hooks are called in consistent order.
+ */
+ const keys = featureBundle.useConstant(() => Object.keys(outputMap));
+ const output = featureBundle.useConstant(() => ({}));
+ for (const key of keys) {
+ output[key] = useTransform(inputValue, inputRange, outputMap[key], options);
+ }
+ return output;
+}
+
+const threshold = 50;
+const maxSpeed = 25;
+const overflowStyles = new Set(["auto", "scroll"]);
+// Track initial scroll limits per scrollable element (Bug 1 fix)
+const initialScrollLimits = new WeakMap();
+const activeScrollEdge = new WeakMap();
+// Track which group element is currently dragging to clear state on end
+let currentGroupElement = null;
+function resetAutoScrollState() {
+ if (currentGroupElement) {
+ const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y");
+ if (scrollableAncestor) {
+ activeScrollEdge.delete(scrollableAncestor);
+ initialScrollLimits.delete(scrollableAncestor);
+ }
+ // Also try x axis
+ const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x");
+ if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {
+ activeScrollEdge.delete(scrollableAncestorX);
+ initialScrollLimits.delete(scrollableAncestorX);
+ }
+ currentGroupElement = null;
+ }
+}
+function isScrollableElement(element, axis) {
+ const style = getComputedStyle(element);
+ const overflow = axis === "x" ? style.overflowX : style.overflowY;
+ const isDocumentScroll = element === document.body ||
+ element === document.documentElement;
+ return overflowStyles.has(overflow) || isDocumentScroll;
+}
+function findScrollableAncestor(element, axis) {
+ let current = element?.parentElement;
+ while (current) {
+ if (isScrollableElement(current, axis)) {
+ return current;
+ }
+ current = current.parentElement;
+ }
+ return null;
+}
+function getScrollAmount(pointerPosition, scrollElement, axis) {
+ const rect = scrollElement.getBoundingClientRect();
+ const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top);
+ const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom);
+ const distanceFromStart = pointerPosition - start;
+ const distanceFromEnd = end - pointerPosition;
+ if (distanceFromStart < threshold) {
+ const intensity = 1 - distanceFromStart / threshold;
+ return { amount: -maxSpeed * intensity * intensity, edge: "start" };
+ }
+ else if (distanceFromEnd < threshold) {
+ const intensity = 1 - distanceFromEnd / threshold;
+ return { amount: maxSpeed * intensity * intensity, edge: "end" };
+ }
+ return { amount: 0, edge: null };
+}
+function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) {
+ if (!groupElement)
+ return;
+ // Track the group element for cleanup
+ currentGroupElement = groupElement;
+ const scrollableAncestor = findScrollableAncestor(groupElement, axis);
+ if (!scrollableAncestor)
+ return;
+ // Convert pointer position from page coordinates to viewport coordinates.
+ // The gesture system uses pageX/pageY but getBoundingClientRect() returns
+ // viewport-relative coordinates, so we need to account for page scroll.
+ const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY);
+ const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis);
+ // If not in any threshold zone, clear all state
+ if (edge === null) {
+ activeScrollEdge.delete(scrollableAncestor);
+ initialScrollLimits.delete(scrollableAncestor);
+ return;
+ }
+ const currentActiveEdge = activeScrollEdge.get(scrollableAncestor);
+ const isDocumentScroll = scrollableAncestor === document.body ||
+ scrollableAncestor === document.documentElement;
+ // If not currently scrolling this edge, check velocity to see if we should start
+ if (currentActiveEdge !== edge) {
+ // Only start scrolling if velocity is towards the edge
+ const shouldStart = (edge === "start" && velocity < 0) ||
+ (edge === "end" && velocity > 0);
+ if (!shouldStart)
+ return;
+ // Activate this edge
+ activeScrollEdge.set(scrollableAncestor, edge);
+ // Record initial scroll limit (prevents infinite scroll)
+ const maxScroll = axis === "x"
+ ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)
+ : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight);
+ initialScrollLimits.set(scrollableAncestor, maxScroll);
+ }
+ // Cap scrolling at initial limit (prevents infinite scroll)
+ if (scrollAmount > 0) {
+ const initialLimit = initialScrollLimits.get(scrollableAncestor);
+ const currentScroll = axis === "x"
+ ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)
+ : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop);
+ if (currentScroll >= initialLimit)
+ return;
+ }
+ // Apply scroll
+ if (axis === "x") {
+ if (isDocumentScroll) {
+ window.scrollBy({ left: scrollAmount });
+ }
+ else {
+ scrollableAncestor.scrollLeft += scrollAmount;
+ }
+ }
+ else {
+ if (isDocumentScroll) {
+ window.scrollBy({ top: scrollAmount });
+ }
+ else {
+ scrollableAncestor.scrollTop += scrollAmount;
+ }
+ }
+}
+
+function useDefaultMotionValue(value, defaultValue = 0) {
+ return motionDom.isMotionValue(value) ? value : useMotionValue(defaultValue);
+}
+function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) {
+ const Component = featureBundle.useConstant(() => motion[as]);
+ const context = React.useContext(ReorderContext);
+ const point = {
+ x: useDefaultMotionValue(style.x),
+ y: useDefaultMotionValue(style.y),
+ };
+ const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset");
+ motionUtils.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
+ const { axis, registerItem, updateOrder, groupRef } = context;
+ return (jsxRuntime.jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => {
+ const { velocity, point: pointerPoint } = gesturePoint;
+ const offset = point[axis].get();
+ // Always attempt to update order - checkReorder handles the logic
+ updateOrder(value, offset, velocity[axis]);
+ autoScrollIfNeeded(groupRef.current, pointerPoint[axis], axis, velocity[axis]);
+ onDrag && onDrag(event, gesturePoint);
+ }, onDragEnd: (event, gesturePoint) => {
+ resetAutoScrollState();
+ onDragEnd && onDragEnd(event, gesturePoint);
+ }, onLayoutMeasure: (measured) => {
+ registerItem(value, measured);
+ }, ref: externalRef, ignoreStrict: true, children: children }));
+}
+const ReorderItem = /*@__PURE__*/ React.forwardRef(ReorderItemComponent);
+
+var namespace = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ Group: ReorderGroup,
+ Item: ReorderItem
+});
+
+function isDOMKeyframes(keyframes) {
+ return typeof keyframes === "object" && !Array.isArray(keyframes);
+}
+
+function resolveSubjects(subject, keyframes, scope, selectorCache) {
+ if (subject == null) {
+ return [];
+ }
+ if (typeof subject === "string" && isDOMKeyframes(keyframes)) {
+ return motionDom.resolveElements(subject, scope, selectorCache);
+ }
+ else if (subject instanceof NodeList) {
+ return Array.from(subject);
+ }
+ else if (Array.isArray(subject)) {
+ return subject.filter((s) => s != null);
+ }
+ else {
+ return [subject];
+ }
+}
+
+function calculateRepeatDuration(duration, repeat, _repeatDelay) {
+ return duration * (repeat + 1);
+}
+
+/**
+ * Given a absolute or relative time definition and current/prev time state of the sequence,
+ * calculate an absolute time for the next keyframes.
+ */
+function calcNextTime(current, next, prev, labels) {
+ if (typeof next === "number") {
+ return next;
+ }
+ else if (next.startsWith("-") || next.startsWith("+")) {
+ return Math.max(0, current + parseFloat(next));
+ }
+ else if (next === "<") {
+ return prev;
+ }
+ else if (next.startsWith("<")) {
+ return Math.max(0, prev + parseFloat(next.slice(1)));
+ }
+ else {
+ return labels.get(next) ?? current;
+ }
+}
+
+function eraseKeyframes(sequence, startTime, endTime) {
+ for (let i = 0; i < sequence.length; i++) {
+ const keyframe = sequence[i];
+ if (keyframe.at > startTime && keyframe.at < endTime) {
+ motionUtils.removeItem(sequence, keyframe);
+ // If we remove this item we have to push the pointer back one
+ i--;
+ }
+ }
+}
+function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {
+ /**
+ * Erase every existing value between currentTime and targetTime,
+ * this will essentially splice this timeline into any currently
+ * defined ones.
+ */
+ eraseKeyframes(sequence, startTime, endTime);
+ for (let i = 0; i < keyframes.length; i++) {
+ sequence.push({
+ value: keyframes[i],
+ at: motionDom.mixNumber(startTime, endTime, offset[i]),
+ easing: motionUtils.getEasingForSegment(easing, i),
+ });
+ }
+}
+
+/**
+ * Take an array of times that represent repeated keyframes. For instance
+ * if we have original times of [0, 0.5, 1] then our repeated times will
+ * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back
+ * down to a 0-1 scale.
+ */
+function normalizeTimes(times, repeat) {
+ for (let i = 0; i < times.length; i++) {
+ times[i] = times[i] / (repeat + 1);
+ }
+}
+
+function compareByTime(a, b) {
+ if (a.at === b.at) {
+ if (a.value === null)
+ return 1;
+ if (b.value === null)
+ return -1;
+ return 0;
+ }
+ else {
+ return a.at - b.at;
+ }
+}
+
+const defaultSegmentEasing = "easeInOut";
+const MAX_REPEAT = 20;
+function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {
+ const defaultDuration = defaultTransition.duration || 0.3;
+ const animationDefinitions = new Map();
+ const sequences = new Map();
+ const elementCache = {};
+ const timeLabels = new Map();
+ let prevTime = 0;
+ let currentTime = 0;
+ let totalDuration = 0;
+ /**
+ * Build the timeline by mapping over the sequence array and converting
+ * the definitions into keyframes and offsets with absolute time values.
+ * These will later get converted into relative offsets in a second pass.
+ */
+ for (let i = 0; i < sequence.length; i++) {
+ const segment = sequence[i];
+ /**
+ * If this is a timeline label, mark it and skip the rest of this iteration.
+ */
+ if (typeof segment === "string") {
+ timeLabels.set(segment, currentTime);
+ continue;
+ }
+ else if (!Array.isArray(segment)) {
+ timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));
+ continue;
+ }
+ let [subject, keyframes, transition = {}] = segment;
+ /**
+ * If a relative or absolute time value has been specified we need to resolve
+ * it in relation to the currentTime.
+ */
+ if (transition.at !== undefined) {
+ currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);
+ }
+ /**
+ * Keep track of the maximum duration in this definition. This will be
+ * applied to currentTime once the definition has been parsed.
+ */
+ let maxDuration = 0;
+ const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {
+ const valueKeyframesAsList = keyframesAsList(valueKeyframes);
+ const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;
+ let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition;
+ /**
+ * Resolve stagger() if defined.
+ */
+ const calculatedDelay = typeof delay === "function"
+ ? delay(elementIndex, numSubjects)
+ : delay;
+ /**
+ * If this animation should and can use a spring, generate a spring easing function.
+ */
+ const numKeyframes = valueKeyframesAsList.length;
+ const createGenerator = motionDom.isGenerator(type)
+ ? type
+ : generators?.[type || "keyframes"];
+ if (numKeyframes <= 2 && createGenerator) {
+ /**
+ * As we're creating an easing function from a spring,
+ * ideally we want to generate it using the real distance
+ * between the two keyframes. However this isn't always
+ * possible - in these situations we use 0-100.
+ */
+ let absoluteDelta = 100;
+ if (numKeyframes === 2 &&
+ isNumberKeyframesArray(valueKeyframesAsList)) {
+ const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];
+ absoluteDelta = Math.abs(delta);
+ }
+ const springTransition = {
+ ...defaultTransition,
+ ...remainingTransition,
+ };
+ if (duration !== undefined) {
+ springTransition.duration = motionUtils.secondsToMilliseconds(duration);
+ }
+ const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator);
+ ease = springEasing.ease;
+ duration = springEasing.duration;
+ }
+ duration ?? (duration = defaultDuration);
+ const startTime = currentTime + calculatedDelay;
+ /**
+ * If there's only one time offset of 0, fill in a second with length 1
+ */
+ if (times.length === 1 && times[0] === 0) {
+ times[1] = 1;
+ }
+ /**
+ * Fill out if offset if fewer offsets than keyframes
+ */
+ const remainder = times.length - valueKeyframesAsList.length;
+ remainder > 0 && motionDom.fillOffset(times, remainder);
+ /**
+ * If only one value has been set, ie [1], push a null to the start of
+ * the keyframe array. This will let us mark a keyframe at this point
+ * that will later be hydrated with the previous value.
+ */
+ valueKeyframesAsList.length === 1 &&
+ valueKeyframesAsList.unshift(null);
+ /**
+ * Handle repeat options
+ */
+ if (repeat) {
+ motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
+ duration = calculateRepeatDuration(duration, repeat);
+ const originalKeyframes = [...valueKeyframesAsList];
+ const originalTimes = [...times];
+ ease = Array.isArray(ease) ? [...ease] : [ease];
+ const originalEase = [...ease];
+ for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {
+ valueKeyframesAsList.push(...originalKeyframes);
+ for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {
+ times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));
+ ease.push(keyframeIndex === 0
+ ? "linear"
+ : motionUtils.getEasingForSegment(originalEase, keyframeIndex - 1));
+ }
+ }
+ normalizeTimes(times, repeat);
+ }
+ const targetTime = startTime + duration;
+ /**
+ * Add keyframes, mapping offsets to absolute time.
+ */
+ addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);
+ maxDuration = Math.max(calculatedDelay + duration, maxDuration);
+ totalDuration = Math.max(targetTime, totalDuration);
+ };
+ if (motionDom.isMotionValue(subject)) {
+ const subjectSequence = getSubjectSequence(subject, sequences);
+ resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence));
+ }
+ else {
+ const subjects = resolveSubjects(subject, keyframes, scope, elementCache);
+ const numSubjects = subjects.length;
+ /**
+ * For every element in this segment, process the defined values.
+ */
+ for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {
+ /**
+ * Cast necessary, but we know these are of this type
+ */
+ keyframes = keyframes;
+ transition = transition;
+ const thisSubject = subjects[subjectIndex];
+ const subjectSequence = getSubjectSequence(thisSubject, sequences);
+ for (const key in keyframes) {
+ resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);
+ }
+ }
+ }
+ prevTime = currentTime;
+ currentTime += maxDuration;
+ }
+ /**
+ * For every element and value combination create a new animation.
+ */
+ sequences.forEach((valueSequences, element) => {
+ for (const key in valueSequences) {
+ const valueSequence = valueSequences[key];
+ /**
+ * Arrange all the keyframes in ascending time order.
+ */
+ valueSequence.sort(compareByTime);
+ const keyframes = [];
+ const valueOffset = [];
+ const valueEasing = [];
+ /**
+ * For each keyframe, translate absolute times into
+ * relative offsets based on the total duration of the timeline.
+ */
+ for (let i = 0; i < valueSequence.length; i++) {
+ const { at, value, easing } = valueSequence[i];
+ keyframes.push(value);
+ valueOffset.push(motionUtils.progress(0, totalDuration, at));
+ valueEasing.push(easing || "easeOut");
+ }
+ /**
+ * If the first keyframe doesn't land on offset: 0
+ * provide one by duplicating the initial keyframe. This ensures
+ * it snaps to the first keyframe when the animation starts.
+ */
+ if (valueOffset[0] !== 0) {
+ valueOffset.unshift(0);
+ keyframes.unshift(keyframes[0]);
+ valueEasing.unshift(defaultSegmentEasing);
+ }
+ /**
+ * If the last keyframe doesn't land on offset: 1
+ * provide one with a null wildcard value. This will ensure it
+ * stays static until the end of the animation.
+ */
+ if (valueOffset[valueOffset.length - 1] !== 1) {
+ valueOffset.push(1);
+ keyframes.push(null);
+ }
+ if (!animationDefinitions.has(element)) {
+ animationDefinitions.set(element, {
+ keyframes: {},
+ transition: {},
+ });
+ }
+ const definition = animationDefinitions.get(element);
+ definition.keyframes[key] = keyframes;
+ /**
+ * Exclude `type` from defaultTransition since springs have been
+ * converted to duration-based easing functions in resolveValueSequence.
+ * Including `type: "spring"` would cause JSAnimation to error when
+ * the merged keyframes array has more than 2 keyframes.
+ */
+ const { type: _type, ...remainingDefaultTransition } = defaultTransition;
+ definition.transition[key] = {
+ ...remainingDefaultTransition,
+ duration: totalDuration,
+ ease: valueEasing,
+ times: valueOffset,
+ ...sequenceTransition,
+ };
+ }
+ });
+ return animationDefinitions;
+}
+function getSubjectSequence(subject, sequences) {
+ !sequences.has(subject) && sequences.set(subject, {});
+ return sequences.get(subject);
+}
+function getValueSequence(name, sequences) {
+ if (!sequences[name])
+ sequences[name] = [];
+ return sequences[name];
+}
+function keyframesAsList(keyframes) {
+ return Array.isArray(keyframes) ? keyframes : [keyframes];
+}
+function getValueTransition(transition, key) {
+ return transition && transition[key]
+ ? {
+ ...transition,
+ ...transition[key],
+ }
+ : { ...transition };
+}
+const isNumber = (keyframe) => typeof keyframe === "number";
+const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);
+
+function createDOMVisualElement(element) {
+ const options = {
+ presenceContext: null,
+ props: {},
+ visualState: {
+ renderState: {
+ transform: {},
+ transformOrigin: {},
+ style: {},
+ vars: {},
+ attrs: {},
+ },
+ latestValues: {},
+ },
+ };
+ const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element)
+ ? new motionDom.SVGVisualElement(options)
+ : new motionDom.HTMLVisualElement(options);
+ node.mount(element);
+ motionDom.visualElementStore.set(element, node);
+}
+function createObjectVisualElement(subject) {
+ const options = {
+ presenceContext: null,
+ props: {},
+ visualState: {
+ renderState: {
+ output: {},
+ },
+ latestValues: {},
+ },
+ };
+ const node = new motionDom.ObjectVisualElement(options);
+ node.mount(subject);
+ motionDom.visualElementStore.set(subject, node);
+}
+
+function isSingleValue(subject, keyframes) {
+ return (motionDom.isMotionValue(subject) ||
+ typeof subject === "number" ||
+ (typeof subject === "string" && !isDOMKeyframes(keyframes)));
+}
+/**
+ * Implementation
+ */
+function animateSubject(subject, keyframes, options, scope) {
+ const animations = [];
+ if (isSingleValue(subject, keyframes)) {
+ animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes)
+ ? keyframes.default || keyframes
+ : keyframes, options ? options.default || options : options));
+ }
+ else {
+ // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)
+ if (subject == null) {
+ return animations;
+ }
+ const subjects = resolveSubjects(subject, keyframes, scope);
+ const numSubjects = subjects.length;
+ motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements");
+ for (let i = 0; i < numSubjects; i++) {
+ const thisSubject = subjects[i];
+ const createVisualElement = thisSubject instanceof Element
+ ? createDOMVisualElement
+ : createObjectVisualElement;
+ if (!motionDom.visualElementStore.has(thisSubject)) {
+ createVisualElement(thisSubject);
+ }
+ const visualElement = motionDom.visualElementStore.get(thisSubject);
+ const transition = { ...options };
+ /**
+ * Resolve stagger function if provided.
+ */
+ if ("delay" in transition &&
+ typeof transition.delay === "function") {
+ transition.delay = transition.delay(i, numSubjects);
+ }
+ animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {}));
+ }
+ }
+ return animations;
+}
+
+function animateSequence(sequence, options, scope) {
+ const animations = [];
+ /**
+ * Pre-process: replace function segments with MotionValue segments,
+ * subscribe callbacks immediately
+ */
+ const processedSequence = sequence.map((segment) => {
+ if (Array.isArray(segment) && typeof segment[0] === "function") {
+ const callback = segment[0];
+ const mv = motionDom.motionValue(0);
+ mv.on("change", callback);
+ if (segment.length === 1) {
+ return [mv, [0, 1]];
+ }
+ else if (segment.length === 2) {
+ return [mv, [0, 1], segment[1]];
+ }
+ else {
+ return [mv, segment[1], segment[2]];
+ }
+ }
+ return segment;
+ });
+ const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring });
+ animationDefinitions.forEach(({ keyframes, transition }, subject) => {
+ animations.push(...animateSubject(subject, keyframes, transition));
+ });
+ return animations;
+}
+
+function isSequence(value) {
+ return Array.isArray(value) && value.some(Array.isArray);
+}
+/**
+ * Creates an animation function that is optionally scoped
+ * to a specific element.
+ */
+function createScopedAnimate(options = {}) {
+ const { scope, reduceMotion } = options;
+ /**
+ * Implementation
+ */
+ function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {
+ let animations = [];
+ let animationOnComplete;
+ if (isSequence(subjectOrSequence)) {
+ animations = animateSequence(subjectOrSequence, reduceMotion !== undefined
+ ? { reduceMotion, ...optionsOrKeyframes }
+ : optionsOrKeyframes, scope);
+ }
+ else {
+ // Extract top-level onComplete so it doesn't get applied per-value
+ const { onComplete, ...rest } = options || {};
+ if (typeof onComplete === "function") {
+ animationOnComplete = onComplete;
+ }
+ animations = animateSubject(subjectOrSequence, optionsOrKeyframes, (reduceMotion !== undefined
+ ? { reduceMotion, ...rest }
+ : rest), scope);
+ }
+ const animation = new motionDom.GroupAnimationWithThen(animations);
+ if (animationOnComplete) {
+ animation.finished.then(animationOnComplete);
+ }
+ if (scope) {
+ scope.animations.push(animation);
+ animation.finished.then(() => {
+ motionUtils.removeItem(scope.animations, animation);
+ });
+ }
+ return animation;
+ }
+ return scopedAnimate;
+}
+const animate = createScopedAnimate();
+
+function animateElements(elementOrSelector, keyframes, options, scope) {
+ // Gracefully handle null/undefined elements (e.g., from querySelector returning null)
+ if (elementOrSelector == null) {
+ return [];
+ }
+ const elements = motionDom.resolveElements(elementOrSelector, scope);
+ const numElements = elements.length;
+ motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
+ /**
+ * WAAPI doesn't support interrupting animations.
+ *
+ * Therefore, starting animations requires a three-step process:
+ * 1. Stop existing animations (write styles to DOM)
+ * 2. Resolve keyframes (read styles from DOM)
+ * 3. Create new animations (write styles to DOM)
+ *
+ * The hybrid `animate()` function uses AsyncAnimation to resolve
+ * keyframes before creating new animations, which removes style
+ * thrashing. Here, we have much stricter filesize constraints.
+ * Therefore we do this in a synchronous way that ensures that
+ * at least within `animate()` calls there is no style thrashing.
+ *
+ * In the motion-native-animate-mini-interrupt benchmark this
+ * was 80% faster than a single loop.
+ */
+ const animationDefinitions = [];
+ /**
+ * Step 1: Build options and stop existing animations (write)
+ */
+ for (let i = 0; i < numElements; i++) {
+ const element = elements[i];
+ const elementTransition = { ...options };
+ /**
+ * Resolve stagger function if provided.
+ */
+ if (typeof elementTransition.delay === "function") {
+ elementTransition.delay = elementTransition.delay(i, numElements);
+ }
+ for (const valueName in keyframes) {
+ let valueKeyframes = keyframes[valueName];
+ if (!Array.isArray(valueKeyframes)) {
+ valueKeyframes = [valueKeyframes];
+ }
+ const valueOptions = {
+ ...motionDom.getValueTransition(elementTransition, valueName),
+ };
+ valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration));
+ valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay));
+ /**
+ * If there's an existing animation playing on this element then stop it
+ * before creating a new one.
+ */
+ const map = motionDom.getAnimationMap(element);
+ const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || "");
+ const currentAnimation = map.get(key);
+ currentAnimation && currentAnimation.stop();
+ animationDefinitions.push({
+ map,
+ key,
+ unresolvedKeyframes: valueKeyframes,
+ options: {
+ ...valueOptions,
+ element,
+ name: valueName,
+ allowFlatten: !elementTransition.type && !elementTransition.ease,
+ },
+ });
+ }
+ }
+ /**
+ * Step 2: Resolve keyframes (read)
+ */
+ for (let i = 0; i < animationDefinitions.length; i++) {
+ const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i];
+ const { element, name, pseudoElement } = animationOptions;
+ if (!pseudoElement && unresolvedKeyframes[0] === null) {
+ unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name);
+ }
+ motionDom.fillWildcards(unresolvedKeyframes);
+ motionDom.applyPxDefaults(unresolvedKeyframes, name);
+ /**
+ * If we only have one keyframe, explicitly read the initial keyframe
+ * from the computed style. This is to ensure consistency with WAAPI behaviour
+ * for restarting animations, for instance .play() after finish, when it
+ * has one vs two keyframes.
+ */
+ if (!pseudoElement && unresolvedKeyframes.length < 2) {
+ unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name));
+ }
+ animationOptions.keyframes = unresolvedKeyframes;
+ }
+ /**
+ * Step 3: Create new animations (write)
+ */
+ const animations = [];
+ for (let i = 0; i < animationDefinitions.length; i++) {
+ const { map, key, options: animationOptions } = animationDefinitions[i];
+ const animation = new motionDom.NativeAnimation(animationOptions);
+ map.set(key, animation);
+ animation.finished.finally(() => map.delete(key));
+ animations.push(animation);
+ }
+ return animations;
+}
+
+const createScopedWaapiAnimate = (scope) => {
+ function scopedAnimate(elementOrSelector, keyframes, options) {
+ return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope));
+ }
+ return scopedAnimate;
+};
+const animateMini = /*@__PURE__*/ createScopedWaapiAnimate();
+
+/**
+ * A time in milliseconds, beyond which we consider the scroll velocity to be 0.
+ */
+const maxElapsed = 50;
+const createAxisInfo = () => ({
+ current: 0,
+ offset: [],
+ progress: 0,
+ scrollLength: 0,
+ targetOffset: 0,
+ targetLength: 0,
+ containerLength: 0,
+ velocity: 0,
+});
+const createScrollInfo = () => ({
+ time: 0,
+ x: createAxisInfo(),
+ y: createAxisInfo(),
+});
+const keys = {
+ x: {
+ length: "Width",
+ position: "Left",
+ },
+ y: {
+ length: "Height",
+ position: "Top",
+ },
+};
+function updateAxisInfo(element, axisName, info, time) {
+ const axis = info[axisName];
+ const { length, position } = keys[axisName];
+ const prev = axis.current;
+ const prevTime = info.time;
+ axis.current = element[`scroll${position}`];
+ axis.scrollLength = element[`scroll${length}`] - element[`client${length}`];
+ axis.offset.length = 0;
+ axis.offset[0] = 0;
+ axis.offset[1] = axis.scrollLength;
+ axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current);
+ const elapsed = time - prevTime;
+ axis.velocity =
+ elapsed > maxElapsed
+ ? 0
+ : motionUtils.velocityPerSecond(axis.current - prev, elapsed);
+}
+function updateScrollInfo(element, info, time) {
+ updateAxisInfo(element, "x", info, time);
+ updateAxisInfo(element, "y", info, time);
+ info.time = time;
+}
+
+function calcInset(element, container) {
+ const inset = { x: 0, y: 0 };
+ let current = element;
+ while (current && current !== container) {
+ if (motionDom.isHTMLElement(current)) {
+ inset.x += current.offsetLeft;
+ inset.y += current.offsetTop;
+ current = current.offsetParent;
+ }
+ else if (current.tagName === "svg") {
+ /**
+ * This isn't an ideal approach to measuring the offset of tags.
+ * It would be preferable, given they behave like HTMLElements in most ways
+ * to use offsetLeft/Top. But these don't exist on . Likewise we
+ * can't use .getBBox() like most SVG elements as these provide the offset
+ * relative to the SVG itself, which for is usually 0x0.
+ */
+ const svgBoundingBox = current.getBoundingClientRect();
+ current = current.parentElement;
+ const parentBoundingBox = current.getBoundingClientRect();
+ inset.x += svgBoundingBox.left - parentBoundingBox.left;
+ inset.y += svgBoundingBox.top - parentBoundingBox.top;
+ }
+ else if (current instanceof SVGGraphicsElement) {
+ const { x, y } = current.getBBox();
+ inset.x += x;
+ inset.y += y;
+ let svg = null;
+ let parent = current.parentNode;
+ while (!svg) {
+ if (parent.tagName === "svg") {
+ svg = parent;
+ }
+ parent = current.parentNode;
+ }
+ current = svg;
+ }
+ else {
+ break;
+ }
+ }
+ return inset;
+}
+
+const namedEdges = {
+ start: 0,
+ center: 0.5,
+ end: 1,
+};
+function resolveEdge(edge, length, inset = 0) {
+ let delta = 0;
+ /**
+ * If we have this edge defined as a preset, replace the definition
+ * with the numerical value.
+ */
+ if (edge in namedEdges) {
+ edge = namedEdges[edge];
+ }
+ /**
+ * Handle unit values
+ */
+ if (typeof edge === "string") {
+ const asNumber = parseFloat(edge);
+ if (edge.endsWith("px")) {
+ delta = asNumber;
+ }
+ else if (edge.endsWith("%")) {
+ edge = asNumber / 100;
+ }
+ else if (edge.endsWith("vw")) {
+ delta = (asNumber / 100) * document.documentElement.clientWidth;
+ }
+ else if (edge.endsWith("vh")) {
+ delta = (asNumber / 100) * document.documentElement.clientHeight;
+ }
+ else {
+ edge = asNumber;
+ }
+ }
+ /**
+ * If the edge is defined as a number, handle as a progress value.
+ */
+ if (typeof edge === "number") {
+ delta = length * edge;
+ }
+ return inset + delta;
+}
+
+const defaultOffset = [0, 0];
+function resolveOffset(offset, containerLength, targetLength, targetInset) {
+ let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;
+ let targetPoint = 0;
+ let containerPoint = 0;
+ if (typeof offset === "number") {
+ /**
+ * If we're provided offset: [0, 0.5, 1] then each number x should become
+ * [x, x], so we default to the behaviour of mapping 0 => 0 of both target
+ * and container etc.
+ */
+ offsetDefinition = [offset, offset];
+ }
+ else if (typeof offset === "string") {
+ offset = offset.trim();
+ if (offset.includes(" ")) {
+ offsetDefinition = offset.split(" ");
+ }
+ else {
+ /**
+ * If we're provided a definition like "100px" then we want to apply
+ * that only to the top of the target point, leaving the container at 0.
+ * Whereas a named offset like "end" should be applied to both.
+ */
+ offsetDefinition = [offset, namedEdges[offset] ? offset : `0`];
+ }
+ }
+ targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);
+ containerPoint = resolveEdge(offsetDefinition[1], containerLength);
+ return targetPoint - containerPoint;
+}
+
+const ScrollOffset = {
+ Enter: [
+ [0, 1],
+ [1, 1],
+ ],
+ Exit: [
+ [0, 0],
+ [1, 0],
+ ],
+ Any: [
+ [1, 0],
+ [0, 1],
+ ],
+ All: [
+ [0, 0],
+ [1, 1],
+ ],
+};
+
+const point = { x: 0, y: 0 };
+function getTargetSize(target) {
+ return "getBBox" in target && target.tagName !== "svg"
+ ? target.getBBox()
+ : { width: target.clientWidth, height: target.clientHeight };
+}
+function resolveOffsets(container, info, options) {
+ const { offset: offsetDefinition = ScrollOffset.All } = options;
+ const { target = container, axis = "y" } = options;
+ const lengthLabel = axis === "y" ? "height" : "width";
+ const inset = target !== container ? calcInset(target, container) : point;
+ /**
+ * Measure the target and container. If they're the same thing then we
+ * use the container's scrollWidth/Height as the target, from there
+ * all other calculations can remain the same.
+ */
+ const targetSize = target === container
+ ? { width: container.scrollWidth, height: container.scrollHeight }
+ : getTargetSize(target);
+ const containerSize = {
+ width: container.clientWidth,
+ height: container.clientHeight,
+ };
+ /**
+ * Reset the length of the resolved offset array rather than creating a new one.
+ * TODO: More reusable data structures for targetSize/containerSize would also be good.
+ */
+ info[axis].offset.length = 0;
+ /**
+ * Populate the offset array by resolving the user's offset definition into
+ * a list of pixel scroll offets.
+ */
+ let hasChanged = !info[axis].interpolate;
+ const numOffsets = offsetDefinition.length;
+ for (let i = 0; i < numOffsets; i++) {
+ const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);
+ if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {
+ hasChanged = true;
+ }
+ info[axis].offset[i] = offset;
+ }
+ /**
+ * If the pixel scroll offsets have changed, create a new interpolator function
+ * to map scroll value into a progress.
+ */
+ if (hasChanged) {
+ info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false });
+ info[axis].interpolatorOffsets = [...info[axis].offset];
+ }
+ info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current));
+}
+
+function measure(container, target = container, info) {
+ /**
+ * Find inset of target within scrollable container
+ */
+ info.x.targetOffset = 0;
+ info.y.targetOffset = 0;
+ if (target !== container) {
+ let node = target;
+ while (node && node !== container) {
+ info.x.targetOffset += node.offsetLeft;
+ info.y.targetOffset += node.offsetTop;
+ node = node.offsetParent;
+ }
+ }
+ info.x.targetLength =
+ target === container ? target.scrollWidth : target.clientWidth;
+ info.y.targetLength =
+ target === container ? target.scrollHeight : target.clientHeight;
+ info.x.containerLength = container.clientWidth;
+ info.y.containerLength = container.clientHeight;
+ /**
+ * In development mode ensure scroll containers aren't position: static as this makes
+ * it difficult to measure their relative positions.
+ */
+ if (process.env.NODE_ENV !== "production") {
+ if (container && target && target !== container) {
+ motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.");
+ }
+ }
+}
+function createOnScrollHandler(element, onScroll, info, options = {}) {
+ return {
+ measure: (time) => {
+ measure(element, options.target, info);
+ updateScrollInfo(element, info, time);
+ if (options.offset || options.target) {
+ resolveOffsets(element, info, options);
+ }
+ },
+ notify: () => onScroll(info),
+ };
+}
+
+const scrollListeners = new WeakMap();
+const resizeListeners = new WeakMap();
+const onScrollHandlers = new WeakMap();
+const scrollSize = new WeakMap();
+const dimensionCheckProcesses = new WeakMap();
+const getEventTarget = (element) => element === document.scrollingElement ? window : element;
+function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) {
+ if (!container)
+ return motionUtils.noop;
+ let containerHandlers = onScrollHandlers.get(container);
+ /**
+ * Get the onScroll handlers for this container.
+ * If one isn't found, create a new one.
+ */
+ if (!containerHandlers) {
+ containerHandlers = new Set();
+ onScrollHandlers.set(container, containerHandlers);
+ }
+ /**
+ * Create a new onScroll handler for the provided callback.
+ */
+ const info = createScrollInfo();
+ const containerHandler = createOnScrollHandler(container, onScroll, info, options);
+ containerHandlers.add(containerHandler);
+ /**
+ * Check if there's a scroll event listener for this container.
+ * If not, create one.
+ */
+ if (!scrollListeners.has(container)) {
+ const measureAll = () => {
+ for (const handler of containerHandlers) {
+ handler.measure(motionDom.frameData.timestamp);
+ }
+ motionDom.frame.preUpdate(notifyAll);
+ };
+ const notifyAll = () => {
+ for (const handler of containerHandlers) {
+ handler.notify();
+ }
+ };
+ const listener = () => motionDom.frame.read(measureAll);
+ scrollListeners.set(container, listener);
+ const target = getEventTarget(container);
+ window.addEventListener("resize", listener);
+ if (container !== document.documentElement) {
+ resizeListeners.set(container, motionDom.resize(container, listener));
+ }
+ target.addEventListener("scroll", listener);
+ listener();
+ }
+ /**
+ * Enable content size tracking if requested and not already enabled.
+ */
+ if (trackContentSize && !dimensionCheckProcesses.has(container)) {
+ const listener = scrollListeners.get(container);
+ // Store initial scroll dimensions (object is reused to avoid allocation)
+ const size = {
+ width: container.scrollWidth,
+ height: container.scrollHeight,
+ };
+ scrollSize.set(container, size);
+ // Add frame-based scroll dimension checking to detect content changes
+ const checkScrollDimensions = () => {
+ const newWidth = container.scrollWidth;
+ const newHeight = container.scrollHeight;
+ if (size.width !== newWidth || size.height !== newHeight) {
+ listener();
+ size.width = newWidth;
+ size.height = newHeight;
+ }
+ };
+ // Schedule with keepAlive=true to run every frame
+ const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true);
+ dimensionCheckProcesses.set(container, dimensionCheckProcess);
+ }
+ const listener = scrollListeners.get(container);
+ motionDom.frame.read(listener, false, true);
+ return () => {
+ motionDom.cancelFrame(listener);
+ /**
+ * Check if we even have any handlers for this container.
+ */
+ const currentHandlers = onScrollHandlers.get(container);
+ if (!currentHandlers)
+ return;
+ currentHandlers.delete(containerHandler);
+ if (currentHandlers.size)
+ return;
+ /**
+ * If no more handlers, remove the scroll listener too.
+ */
+ const scrollListener = scrollListeners.get(container);
+ scrollListeners.delete(container);
+ if (scrollListener) {
+ getEventTarget(container).removeEventListener("scroll", scrollListener);
+ resizeListeners.get(container)?.();
+ window.removeEventListener("resize", scrollListener);
+ }
+ // Clean up scroll dimension checking
+ const dimensionCheckProcess = dimensionCheckProcesses.get(container);
+ if (dimensionCheckProcess) {
+ motionDom.cancelFrame(dimensionCheckProcess);
+ dimensionCheckProcesses.delete(container);
+ }
+ scrollSize.delete(container);
+ };
+}
+
+function canUseNativeTimeline(target) {
+ return (typeof window !== "undefined" && !target && motionDom.supportsScrollTimeline());
+}
+
+const timelineCache = new Map();
+function scrollTimelineFallback(options) {
+ const currentTime = { value: 0 };
+ const cancel = scrollInfo((info) => {
+ currentTime.value = info[options.axis].progress * 100;
+ }, options);
+ return { currentTime, cancel };
+}
+function getTimeline({ source, container, ...options }) {
+ const { axis } = options;
+ if (source)
+ container = source;
+ const containerCache = timelineCache.get(container) ?? new Map();
+ timelineCache.set(container, containerCache);
+ const targetKey = options.target ?? "self";
+ const targetCache = containerCache.get(targetKey) ?? {};
+ const axisKey = axis + (options.offset ?? []).join(",");
+ if (!targetCache[axisKey]) {
+ targetCache[axisKey] =
+ canUseNativeTimeline(options.target)
+ ? new ScrollTimeline({ source: container, axis })
+ : scrollTimelineFallback({ container, ...options });
+ }
+ return targetCache[axisKey];
+}
+
+function attachToAnimation(animation, options) {
+ const timeline = getTimeline(options);
+ return animation.attachTimeline({
+ timeline: options.target ? undefined : timeline,
+ observe: (valueAnimation) => {
+ valueAnimation.pause();
+ return motionDom.observeTimeline((progress) => {
+ valueAnimation.time =
+ valueAnimation.iterationDuration * progress;
+ }, timeline);
+ },
+ });
+}
+
+/**
+ * If the onScroll function has two arguments, it's expecting
+ * more specific information about the scroll from scrollInfo.
+ */
+function isOnScrollWithInfo(onScroll) {
+ return onScroll.length === 2;
+}
+function attachToFunction(onScroll, options) {
+ if (isOnScrollWithInfo(onScroll)) {
+ return scrollInfo((info) => {
+ onScroll(info[options.axis].progress, info);
+ }, options);
+ }
+ else {
+ return motionDom.observeTimeline(onScroll, getTimeline(options));
+ }
+}
+
+function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) {
+ if (!container)
+ return motionUtils.noop;
+ const optionsWithDefaults = { axis, container, ...options };
+ return typeof onScroll === "function"
+ ? attachToFunction(onScroll, optionsWithDefaults)
+ : attachToAnimation(onScroll, optionsWithDefaults);
+}
+
+const thresholds = {
+ some: 0,
+ all: 1,
+};
+function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) {
+ const elements = motionDom.resolveElements(elementOrSelector);
+ const activeIntersections = new WeakMap();
+ const onIntersectionChange = (entries) => {
+ entries.forEach((entry) => {
+ const onEnd = activeIntersections.get(entry.target);
+ /**
+ * If there's no change to the intersection, we don't need to
+ * do anything here.
+ */
+ if (entry.isIntersecting === Boolean(onEnd))
+ return;
+ if (entry.isIntersecting) {
+ const newOnEnd = onStart(entry.target, entry);
+ if (typeof newOnEnd === "function") {
+ activeIntersections.set(entry.target, newOnEnd);
+ }
+ else {
+ observer.unobserve(entry.target);
+ }
+ }
+ else if (typeof onEnd === "function") {
+ onEnd(entry);
+ activeIntersections.delete(entry.target);
+ }
+ });
+ };
+ const observer = new IntersectionObserver(onIntersectionChange, {
+ root,
+ rootMargin,
+ threshold: typeof amount === "number" ? amount : thresholds[amount],
+ });
+ elements.forEach((element) => observer.observe(element));
+ return () => observer.disconnect();
+}
+
+const m = /*@__PURE__*/ createMotionProxy();
+
+function useUnmountEffect(callback) {
+ return React.useEffect(() => () => callback(), []);
+}
+
+/**
+ * @public
+ */
+const domAnimation = {
+ renderer: featureBundle.createDomVisualElement,
+ ...featureBundle.animations,
+ ...featureBundle.gestureAnimations,
+};
+
+/**
+ * @public
+ */
+const domMax = {
+ ...domAnimation,
+ ...featureBundle.drag,
+ ...featureBundle.layout,
+};
+
+/**
+ * @public
+ */
+const domMin = {
+ renderer: featureBundle.createDomVisualElement,
+ ...featureBundle.animations,
+};
+
+function useMotionValueEvent(value, event, callback) {
+ /**
+ * useInsertionEffect will create subscriptions before any other
+ * effects will run. Effects run upwards through the tree so it
+ * can be that binding a useLayoutEffect higher up the tree can
+ * miss changes from lower down the tree.
+ */
+ React.useInsertionEffect(() => value.on(event, callback), [value, event, callback]);
+}
+
+const createScrollMotionValues = () => ({
+ scrollX: motionDom.motionValue(0),
+ scrollY: motionDom.motionValue(0),
+ scrollXProgress: motionDom.motionValue(0),
+ scrollYProgress: motionDom.motionValue(0),
+});
+const isRefPending = (ref) => {
+ if (!ref)
+ return false;
+ return !ref.current;
+};
+function makeAccelerateConfig(axis, options, container) {
+ return {
+ factory: (animation) => scroll(animation, { ...options, axis, container }),
+ times: [0, 1],
+ keyframes: [0, 1],
+ ease: (v) => v,
+ duration: 1,
+ };
+}
+function useScroll({ container, target, ...options } = {}) {
+ const values = featureBundle.useConstant(createScrollMotionValues);
+ if (!target && canUseNativeTimeline()) {
+ const resolvedContainer = container?.current || undefined;
+ values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, resolvedContainer);
+ values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, resolvedContainer);
+ }
+ const scrollAnimation = React.useRef(null);
+ const needsStart = React.useRef(false);
+ const start = React.useCallback(() => {
+ scrollAnimation.current = scroll((_progress, { x, y, }) => {
+ values.scrollX.set(x.current);
+ values.scrollXProgress.set(x.progress);
+ values.scrollY.set(y.current);
+ values.scrollYProgress.set(y.progress);
+ }, {
+ ...options,
+ container: container?.current || undefined,
+ target: target?.current || undefined,
+ });
+ return () => {
+ scrollAnimation.current?.();
+ };
+ }, [container, target, JSON.stringify(options.offset)]);
+ featureBundle.useIsomorphicLayoutEffect(() => {
+ needsStart.current = false;
+ if (isRefPending(container) || isRefPending(target)) {
+ needsStart.current = true;
+ return;
+ }
+ else {
+ return start();
+ }
+ }, [start]);
+ React.useEffect(() => {
+ if (needsStart.current) {
+ motionUtils.invariant(!isRefPending(container), "Container ref is defined but not hydrated", "use-scroll-ref");
+ motionUtils.invariant(!isRefPending(target), "Target ref is defined but not hydrated", "use-scroll-ref");
+ return start();
+ }
+ else {
+ return;
+ }
+ }, [start]);
+ return values;
+}
+
+/**
+ * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })
+ */
+function useElementScroll(ref) {
+ if (process.env.NODE_ENV === "development") {
+ motionUtils.warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref }).");
+ }
+ return useScroll({ container: ref });
+}
+
+/**
+ * @deprecated useViewportScroll is deprecated. Convert to useScroll()
+ */
+function useViewportScroll() {
+ if (process.env.NODE_ENV !== "production") {
+ motionUtils.warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll().");
+ }
+ return useScroll();
+}
+
+/**
+ * Combine multiple motion values into a new one using a string template literal.
+ *
+ * ```jsx
+ * import {
+ * motion,
+ * useSpring,
+ * useMotionValue,
+ * useMotionTemplate
+ * } from "framer-motion"
+ *
+ * function Component() {
+ * const shadowX = useSpring(0)
+ * const shadowY = useMotionValue(0)
+ * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`
+ *
+ * return
+ * }
+ * ```
+ *
+ * @public
+ */
+function useMotionTemplate(fragments, ...values) {
+ /**
+ * Create a function that will build a string from the latest motion values.
+ */
+ const numFragments = fragments.length;
+ function buildValue() {
+ let output = ``;
+ for (let i = 0; i < numFragments; i++) {
+ output += fragments[i];
+ const value = values[i];
+ if (value) {
+ output += motionDom.isMotionValue(value) ? value.get() : value;
+ }
+ }
+ return output;
+ }
+ return useCombineMotionValues(values.filter(motionDom.isMotionValue), buildValue);
+}
+
+function useFollowValue(source, options = {}) {
+ const { isStatic } = React.useContext(featureBundle.MotionConfigContext);
+ const getFromSource = () => (motionDom.isMotionValue(source) ? source.get() : source);
+ // isStatic will never change, allowing early hooks return
+ if (isStatic) {
+ return useTransform(getFromSource);
+ }
+ const value = useMotionValue(getFromSource());
+ React.useInsertionEffect(() => {
+ return motionDom.attachFollow(value, source, options);
+ }, [value, JSON.stringify(options)]);
+ return value;
+}
+
+function useSpring(source, options = {}) {
+ return useFollowValue(source, { type: "spring", ...options });
+}
+
+function useAnimationFrame(callback) {
+ const initialTimestamp = React.useRef(0);
+ const { isStatic } = React.useContext(featureBundle.MotionConfigContext);
+ React.useEffect(() => {
+ if (isStatic)
+ return;
+ const provideTimeSinceStart = ({ timestamp, delta }) => {
+ if (!initialTimestamp.current)
+ initialTimestamp.current = timestamp;
+ callback(timestamp - initialTimestamp.current, delta);
+ };
+ motionDom.frame.update(provideTimeSinceStart, true);
+ return () => motionDom.cancelFrame(provideTimeSinceStart);
+ }, [callback]);
+}
+
+function useTime() {
+ const time = useMotionValue(0);
+ useAnimationFrame((t) => time.set(t));
+ return time;
+}
+
+/**
+ * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.
+ *
+ * ```javascript
+ * const x = useMotionValue(0)
+ * const xVelocity = useVelocity(x)
+ * const xAcceleration = useVelocity(xVelocity)
+ * ```
+ *
+ * @public
+ */
+function useVelocity(value) {
+ const velocity = useMotionValue(value.getVelocity());
+ const updateVelocity = () => {
+ const latest = value.getVelocity();
+ velocity.set(latest);
+ /**
+ * If we still have velocity, schedule an update for the next frame
+ * to keep checking until it is zero.
+ */
+ if (latest)
+ motionDom.frame.update(updateVelocity);
+ };
+ useMotionValueEvent(value, "change", () => {
+ // Schedule an update to this value at the end of the current frame.
+ motionDom.frame.update(updateVelocity, false, true);
+ });
+ return velocity;
+}
+
+class WillChangeMotionValue extends motionDom.MotionValue {
+ constructor() {
+ super(...arguments);
+ this.isEnabled = false;
+ }
+ add(name) {
+ if (motionDom.transformProps.has(name) || motionDom.acceleratedValues.has(name)) {
+ this.isEnabled = true;
+ this.update();
+ }
+ }
+ update() {
+ this.set(this.isEnabled ? "transform" : "auto");
+ }
+}
+
+function useWillChange() {
+ return featureBundle.useConstant(() => new WillChangeMotionValue("auto"));
+}
+
+/**
+ * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.
+ *
+ * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing
+ * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.
+ *
+ * It will actively respond to changes and re-render your components with the latest setting.
+ *
+ * ```jsx
+ * export function Sidebar({ isOpen }) {
+ * const shouldReduceMotion = useReducedMotion()
+ * const closedX = shouldReduceMotion ? 0 : "-100%"
+ *
+ * return (
+ *
+ * )
+ * }
+ * ```
+ *
+ * @return boolean
+ *
+ * @public
+ */
+function useReducedMotion() {
+ /**
+ * Lazy initialisation of prefersReducedMotion
+ */
+ !motionDom.hasReducedMotionListener.current && motionDom.initPrefersReducedMotion();
+ const [shouldReduceMotion] = React.useState(motionDom.prefersReducedMotion.current);
+ if (process.env.NODE_ENV !== "production") {
+ motionUtils.warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
+ }
+ /**
+ * TODO See if people miss automatically updating shouldReduceMotion setting
+ */
+ return shouldReduceMotion;
+}
+
+function useReducedMotionConfig() {
+ const reducedMotionPreference = useReducedMotion();
+ const { reducedMotion } = React.useContext(featureBundle.MotionConfigContext);
+ if (reducedMotion === "never") {
+ return false;
+ }
+ else if (reducedMotion === "always") {
+ return true;
+ }
+ else {
+ return reducedMotionPreference;
+ }
+}
+
+function stopAnimation(visualElement) {
+ visualElement.values.forEach((value) => value.stop());
+}
+function setVariants(visualElement, variantLabels) {
+ const reversedLabels = [...variantLabels].reverse();
+ reversedLabels.forEach((key) => {
+ const variant = visualElement.getVariant(key);
+ variant && motionDom.setTarget(visualElement, variant);
+ if (visualElement.variantChildren) {
+ visualElement.variantChildren.forEach((child) => {
+ setVariants(child, variantLabels);
+ });
+ }
+ });
+}
+function setValues(visualElement, definition) {
+ if (Array.isArray(definition)) {
+ return setVariants(visualElement, definition);
+ }
+ else if (typeof definition === "string") {
+ return setVariants(visualElement, [definition]);
+ }
+ else {
+ motionDom.setTarget(visualElement, definition);
+ }
+}
+/**
+ * @public
+ */
+function animationControls() {
+ /**
+ * Track whether the host component has mounted.
+ */
+ let hasMounted = false;
+ /**
+ * A collection of linked component animation controls.
+ */
+ const subscribers = new Set();
+ const controls = {
+ subscribe(visualElement) {
+ subscribers.add(visualElement);
+ return () => void subscribers.delete(visualElement);
+ },
+ start(definition, transitionOverride) {
+ motionUtils.invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");
+ const animations = [];
+ subscribers.forEach((visualElement) => {
+ animations.push(motionDom.animateVisualElement(visualElement, definition, {
+ transitionOverride,
+ }));
+ });
+ return Promise.all(animations);
+ },
+ set(definition) {
+ motionUtils.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.");
+ return subscribers.forEach((visualElement) => {
+ setValues(visualElement, definition);
+ });
+ },
+ stop() {
+ subscribers.forEach((visualElement) => {
+ stopAnimation(visualElement);
+ });
+ },
+ mount() {
+ hasMounted = true;
+ return () => {
+ hasMounted = false;
+ controls.stop();
+ };
+ },
+ };
+ return controls;
+}
+
+function useAnimate() {
+ const scope = featureBundle.useConstant(() => ({
+ current: null, // Will be hydrated by React
+ animations: [],
+ }));
+ const reduceMotion = useReducedMotionConfig() ?? undefined;
+ const animate = React.useMemo(() => createScopedAnimate({ scope, reduceMotion }), [scope, reduceMotion]);
+ useUnmountEffect(() => {
+ scope.animations.forEach((animation) => animation.stop());
+ scope.animations.length = 0;
+ });
+ return [scope, animate];
+}
+
+function useAnimateMini() {
+ const scope = featureBundle.useConstant(() => ({
+ current: null, // Will be hydrated by React
+ animations: [],
+ }));
+ const animate = featureBundle.useConstant(() => createScopedWaapiAnimate(scope));
+ useUnmountEffect(() => {
+ scope.animations.forEach((animation) => animation.stop());
+ });
+ return [scope, animate];
+}
+
+/**
+ * Creates `LegacyAnimationControls`, which can be used to manually start, stop
+ * and sequence animations on one or more components.
+ *
+ * The returned `LegacyAnimationControls` should be passed to the `animate` property
+ * of the components you want to animate.
+ *
+ * These components can then be animated with the `start` method.
+ *
+ * ```jsx
+ * import * as React from 'react'
+ * import { motion, useAnimation } from 'framer-motion'
+ *
+ * export function MyComponent(props) {
+ * const controls = useAnimation()
+ *
+ * controls.start({
+ * x: 100,
+ * transition: { duration: 0.5 },
+ * })
+ *
+ * return
+ * }
+ * ```
+ *
+ * @returns Animation controller with `start` and `stop` methods
+ *
+ * @public
+ */
+function useAnimationControls() {
+ const controls = featureBundle.useConstant(animationControls);
+ featureBundle.useIsomorphicLayoutEffect(controls.mount, []);
+ return controls;
+}
+const useAnimation = useAnimationControls;
+
+function usePresenceData() {
+ const context = React.useContext(featureBundle.PresenceContext);
+ return context ? context.custom : undefined;
+}
+
+/**
+ * Attaches an event listener directly to the provided DOM element.
+ *
+ * Bypassing React's event system can be desirable, for instance when attaching non-passive
+ * event handlers.
+ *
+ * ```jsx
+ * const ref = useRef(null)
+ *
+ * useDomEvent(ref, 'wheel', onWheel, { passive: false })
+ *
+ * return
+ * ```
+ *
+ * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.
+ * @param eventName - Name of the event you want listen for.
+ * @param handler - Function to fire when receiving the event.
+ * @param options - Options to pass to `Event.addEventListener`.
+ *
+ * @public
+ */
+function useDomEvent(ref, eventName, handler, options) {
+ React.useEffect(() => {
+ const element = ref.current;
+ if (handler && element) {
+ return motionDom.addDomEvent(element, eventName, handler, options);
+ }
+ }, [ref, eventName, handler, options]);
+}
+
+/**
+ * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.
+ *
+ * ```jsx
+ * const dragControls = useDragControls()
+ *
+ * function startDrag(event) {
+ * dragControls.start(event, { snapToCursor: true })
+ * }
+ *
+ * return (
+ * <>
+ *
+ *
+ * >
+ * )
+ * ```
+ *
+ * @public
+ */
+class DragControls {
+ constructor() {
+ this.componentControls = new Set();
+ }
+ /**
+ * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.
+ *
+ * @internal
+ */
+ subscribe(controls) {
+ this.componentControls.add(controls);
+ return () => this.componentControls.delete(controls);
+ }
+ /**
+ * Start a drag gesture on every `motion` component that has this set of drag controls
+ * passed into it via the `dragControls` prop.
+ *
+ * ```jsx
+ * dragControls.start(e, {
+ * snapToCursor: true
+ * })
+ * ```
+ *
+ * @param event - PointerEvent
+ * @param options - Options
+ *
+ * @public
+ */
+ start(event, options) {
+ this.componentControls.forEach((controls) => {
+ controls.start(event.nativeEvent || event, options);
+ });
+ }
+ /**
+ * Cancels a drag gesture.
+ *
+ * ```jsx
+ * dragControls.cancel()
+ * ```
+ *
+ * @public
+ */
+ cancel() {
+ this.componentControls.forEach((controls) => {
+ controls.cancel();
+ });
+ }
+ /**
+ * Stops a drag gesture.
+ *
+ * ```jsx
+ * dragControls.stop()
+ * ```
+ *
+ * @public
+ */
+ stop() {
+ this.componentControls.forEach((controls) => {
+ controls.stop();
+ });
+ }
+}
+const createDragControls = () => new DragControls();
+/**
+ * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop
+ * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we
+ * might want to initiate that dragging from a different component than the draggable one.
+ *
+ * By creating a `dragControls` using the `useDragControls` hook, we can pass this into
+ * the draggable component's `dragControls` prop. It exposes a `start` method
+ * that can start dragging from pointer events on other components.
+ *
+ * ```jsx
+ * const dragControls = useDragControls()
+ *
+ * function startDrag(event) {
+ * dragControls.start(event, { snapToCursor: true })
+ * }
+ *
+ * return (
+ * <>
+ *
+ *
+ * >
+ * )
+ * ```
+ *
+ * @public
+ */
+function useDragControls() {
+ return featureBundle.useConstant(createDragControls);
+}
+
+/**
+ * Checks if a component is a `motion` component.
+ */
+function isMotionComponent(component) {
+ return (component !== null &&
+ typeof component === "object" &&
+ featureBundle.motionComponentSymbol in component);
+}
+
+/**
+ * Unwraps a `motion` component and returns either a string for `motion.div` or
+ * the React component for `motion(Component)`.
+ *
+ * If the component is not a `motion` component it returns undefined.
+ */
+function unwrapMotionComponent(component) {
+ if (isMotionComponent(component)) {
+ return component[featureBundle.motionComponentSymbol];
+ }
+ return undefined;
+}
+
+function useInstantLayoutTransition() {
+ return startTransition;
+}
+function startTransition(callback) {
+ if (!motionDom.rootProjectionNode.current)
+ return;
+ motionDom.rootProjectionNode.current.isUpdating = false;
+ motionDom.rootProjectionNode.current.blockUpdate();
+ callback && callback();
+}
+
+function useResetProjection() {
+ const reset = React.useCallback(() => {
+ const root = motionDom.rootProjectionNode.current;
+ if (!root)
+ return;
+ root.resetTree();
+ }, []);
+ return reset;
+}
+
+/**
+ * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.
+ *
+ * An index value can be passed to the returned `cycle` function to cycle to a specific index.
+ *
+ * ```jsx
+ * import * as React from "react"
+ * import { motion, useCycle } from "framer-motion"
+ *
+ * export const MyComponent = () => {
+ * const [x, cycleX] = useCycle(0, 50, 100)
+ *
+ * return (
+ * cycleX()}
+ * />
+ * )
+ * }
+ * ```
+ *
+ * @param items - items to cycle through
+ * @returns [currentState, cycleState]
+ *
+ * @public
+ */
+function useCycle(...items) {
+ const index = React.useRef(0);
+ const [item, setItem] = React.useState(items[index.current]);
+ const runCycle = React.useCallback((next) => {
+ index.current =
+ typeof next !== "number"
+ ? motionUtils.wrap(0, items.length, index.current + 1)
+ : next;
+ setItem(items[index.current]);
+ },
+ // The array will change on each call, but by putting items.length at
+ // the front of this array, we guarantee the dependency comparison will match up
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [items.length, ...items]);
+ return [item, runCycle];
+}
+
+function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) {
+ const [isInView, setInView] = React.useState(initial);
+ React.useEffect(() => {
+ if (!ref.current || (once && isInView))
+ return;
+ const onEnter = () => {
+ setInView(true);
+ return once ? undefined : () => setInView(false);
+ };
+ const options = {
+ root: (root && root.current) || undefined,
+ margin,
+ amount,
+ };
+ return inView(ref.current, onEnter, options);
+ }, [root, ref, margin, once, amount]);
+ return isInView;
+}
+
+function useInstantTransition() {
+ const [forceUpdate, forcedRenderCount] = useForceUpdate();
+ const startInstantLayoutTransition = useInstantLayoutTransition();
+ const unlockOnFrameRef = React.useRef(-1);
+ React.useEffect(() => {
+ /**
+ * Unblock after two animation frames, otherwise this will unblock too soon.
+ */
+ motionDom.frame.postRender(() => motionDom.frame.postRender(() => {
+ /**
+ * If the callback has been called again after the effect
+ * triggered this 2 frame delay, don't unblock animations. This
+ * prevents the previous effect from unblocking the current
+ * instant transition too soon. This becomes more likely when
+ * used in conjunction with React.startTransition().
+ */
+ if (forcedRenderCount !== unlockOnFrameRef.current)
+ return;
+ motionUtils.MotionGlobalConfig.instantAnimations = false;
+ }));
+ }, [forcedRenderCount]);
+ return (callback) => {
+ startInstantLayoutTransition(() => {
+ motionUtils.MotionGlobalConfig.instantAnimations = true;
+ forceUpdate();
+ callback();
+ unlockOnFrameRef.current = forcedRenderCount + 1;
+ });
+ };
+}
+function disableInstantTransitions() {
+ motionUtils.MotionGlobalConfig.instantAnimations = false;
+}
+
+function usePageInView() {
+ const [isInView, setIsInView] = React.useState(true);
+ React.useEffect(() => {
+ const handleVisibilityChange = () => setIsInView(!document.hidden);
+ if (document.hidden) {
+ handleVisibilityChange();
+ }
+ document.addEventListener("visibilitychange", handleVisibilityChange);
+ return () => {
+ document.removeEventListener("visibilitychange", handleVisibilityChange);
+ };
+ }, []);
+ return isInView;
+}
+
+/**
+ * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.
+ *
+ * When dragging SVG elements inside an SVG with a viewBox that differs from
+ * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels),
+ * pointer coordinates need to be transformed to match the SVG's coordinate system.
+ *
+ * @example
+ * ```jsx
+ * function App() {
+ * const svgRef = useRef(null)
+ *
+ * return (
+ *
+ *
+ *
+ * )
+ * }
+ * ```
+ *
+ * @param svgRef - A React ref to the SVG element
+ * @returns A transformPagePoint function for use with MotionConfig
+ *
+ * @public
+ */
+function transformViewBoxPoint(svgRef) {
+ return (point) => {
+ const svg = svgRef.current;
+ if (!svg) {
+ return point;
+ }
+ // Get the viewBox attribute
+ const viewBox = svg.viewBox?.baseVal;
+ if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {
+ // No viewBox or empty viewBox - no transformation needed
+ return point;
+ }
+ // Get the rendered dimensions of the SVG
+ const bbox = svg.getBoundingClientRect();
+ if (bbox.width === 0 || bbox.height === 0) {
+ return point;
+ }
+ // Calculate scale factors
+ const scaleX = viewBox.width / bbox.width;
+ const scaleY = viewBox.height / bbox.height;
+ // Get the SVG's position on the page
+ const svgX = bbox.left + window.scrollX;
+ const svgY = bbox.top + window.scrollY;
+ // Transform the point:
+ // 1. Calculate position relative to SVG
+ // 2. Scale by viewBox/viewport ratio
+ // 3. Add back the SVG position (but in SVG coordinates)
+ return {
+ x: (point.x - svgX) * scaleX + svgX,
+ y: (point.y - svgY) * scaleY + svgY,
+ };
+ };
+}
+
+const appearAnimationStore = new Map();
+const appearComplete = new Map();
+
+const appearStoreId = (elementId, valueName) => {
+ const key = motionDom.transformProps.has(valueName) ? "transform" : valueName;
+ return `${elementId}: ${key}`;
+};
+
+function handoffOptimizedAppearAnimation(elementId, valueName, frame) {
+ const storeId = appearStoreId(elementId, valueName);
+ const optimisedAnimation = appearAnimationStore.get(storeId);
+ if (!optimisedAnimation) {
+ return null;
+ }
+ const { animation, startTime } = optimisedAnimation;
+ function cancelAnimation() {
+ window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame);
+ }
+ /**
+ * We can cancel the animation once it's finished now that we've synced
+ * with Motion.
+ *
+ * Prefer onfinish over finished as onfinish is backwards compatible with
+ * older browsers.
+ */
+ animation.onfinish = cancelAnimation;
+ if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) {
+ /**
+ * If the startTime is null, this animation is the Paint Ready detection animation
+ * and we can cancel it immediately without handoff.
+ *
+ * Or if we've already handed off the animation then we're now interrupting it.
+ * In which case we need to cancel it.
+ */
+ cancelAnimation();
+ return null;
+ }
+ else {
+ return startTime;
+ }
+}
+
+/**
+ * A single time to use across all animations to manually set startTime
+ * and ensure they're all in sync.
+ */
+let startFrameTime;
+/**
+ * A dummy animation to detect when Chrome is ready to start
+ * painting the page and hold off from triggering the real animation
+ * until then. We only need one animation to detect paint ready.
+ *
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850
+ */
+let readyAnimation;
+/**
+ * Keep track of animations that were suspended vs cancelled so we
+ * can easily resume them when we're done measuring layout.
+ */
+const suspendedAnimations = new Set();
+function resumeSuspendedAnimations() {
+ suspendedAnimations.forEach((data) => {
+ data.animation.play();
+ data.animation.startTime = data.startTime;
+ });
+ suspendedAnimations.clear();
+}
+function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) {
+ // Prevent optimised appear animations if Motion has already started animating.
+ if (window.MotionIsMounted) {
+ return;
+ }
+ const id = element.dataset[motionDom.optimizedAppearDataId];
+ if (!id)
+ return;
+ window.MotionHandoffAnimation = handoffOptimizedAppearAnimation;
+ const storeId = appearStoreId(id, name);
+ if (!readyAnimation) {
+ readyAnimation = motionDom.startWaapiAnimation(element, name, [keyframes[0], keyframes[0]],
+ /**
+ * 10 secs is basically just a super-safe duration to give Chrome
+ * long enough to get the animation ready.
+ */
+ { duration: 10000, ease: "linear" });
+ appearAnimationStore.set(storeId, {
+ animation: readyAnimation,
+ startTime: null,
+ });
+ /**
+ * If there's no readyAnimation then there's been no instantiation
+ * of handoff animations.
+ */
+ window.MotionHandoffAnimation = handoffOptimizedAppearAnimation;
+ window.MotionHasOptimisedAnimation = (elementId, valueName) => {
+ if (!elementId)
+ return false;
+ /**
+ * Keep a map of elementIds that have started animating. We check
+ * via ID instead of Element because of hydration errors and
+ * pre-hydration checks. We also actively record IDs as they start
+ * animating rather than simply checking for data-appear-id as
+ * this attrbute might be present but not lead to an animation, for
+ * instance if the element's appear animation is on a different
+ * breakpoint.
+ */
+ if (!valueName) {
+ return appearComplete.has(elementId);
+ }
+ const animationId = appearStoreId(elementId, valueName);
+ return Boolean(appearAnimationStore.get(animationId));
+ };
+ window.MotionHandoffMarkAsComplete = (elementId) => {
+ if (appearComplete.has(elementId)) {
+ appearComplete.set(elementId, true);
+ }
+ };
+ window.MotionHandoffIsComplete = (elementId) => {
+ return appearComplete.get(elementId) === true;
+ };
+ /**
+ * We only need to cancel transform animations as
+ * they're the ones that will interfere with the
+ * layout animation measurements.
+ */
+ window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => {
+ const animationId = appearStoreId(elementId, valueName);
+ const data = appearAnimationStore.get(animationId);
+ if (!data)
+ return;
+ if (frame && canResume === undefined) {
+ /**
+ * Wait until the end of the subsequent frame to cancel the animation
+ * to ensure we don't remove the animation before the main thread has
+ * had a chance to resolve keyframes and render.
+ */
+ frame.postRender(() => {
+ frame.postRender(() => {
+ data.animation.cancel();
+ });
+ });
+ }
+ else {
+ data.animation.cancel();
+ }
+ if (frame && canResume) {
+ suspendedAnimations.add(data);
+ frame.render(resumeSuspendedAnimations);
+ }
+ else {
+ appearAnimationStore.delete(animationId);
+ /**
+ * If there are no more animations left, we can remove the cancel function.
+ * This will let us know when we can stop checking for conflicting layout animations.
+ */
+ if (!appearAnimationStore.size) {
+ window.MotionCancelOptimisedAnimation = undefined;
+ }
+ }
+ };
+ window.MotionCheckAppearSync = (visualElement, valueName, value) => {
+ const appearId = motionDom.getOptimisedAppearId(visualElement);
+ if (!appearId)
+ return;
+ const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName);
+ const externalAnimationValue = visualElement.props.values?.[valueName];
+ if (!valueIsOptimised || !externalAnimationValue)
+ return;
+ const removeSyncCheck = value.on("change", (latestValue) => {
+ if (externalAnimationValue.get() !== latestValue) {
+ window.MotionCancelOptimisedAnimation?.(appearId, valueName);
+ removeSyncCheck();
+ }
+ });
+ return removeSyncCheck;
+ };
+ }
+ const startAnimation = () => {
+ readyAnimation.cancel();
+ const appearAnimation = motionDom.startWaapiAnimation(element, name, keyframes, options);
+ /**
+ * Record the time of the first started animation. We call performance.now() once
+ * here and once in handoff to ensure we're getting
+ * close to a frame-locked time. This keeps all animations in sync.
+ */
+ if (startFrameTime === undefined) {
+ startFrameTime = performance.now();
+ }
+ appearAnimation.startTime = startFrameTime;
+ appearAnimationStore.set(storeId, {
+ animation: appearAnimation,
+ startTime: startFrameTime,
+ });
+ if (onReady)
+ onReady(appearAnimation);
+ };
+ appearComplete.set(id, false);
+ if (readyAnimation.ready) {
+ readyAnimation.ready.then(startAnimation).catch(motionUtils.noop);
+ }
+ else {
+ startAnimation();
+ }
+}
+
+const createObject = () => ({});
+class StateVisualElement extends motionDom.VisualElement {
+ constructor() {
+ super(...arguments);
+ this.measureInstanceViewportBox = motionDom.createBox;
+ }
+ build() { }
+ resetTransform() { }
+ restoreTransform() { }
+ removeValueFromRenderState() { }
+ renderInstance() { }
+ scrapeMotionValuesFromProps() {
+ return createObject();
+ }
+ getBaseTargetFromProps() {
+ return undefined;
+ }
+ readValueFromInstance(_state, key, options) {
+ return options.initialState[key] || 0;
+ }
+ sortInstanceNodePosition() {
+ return 0;
+ }
+}
+const useVisualState = featureBundle.makeUseVisualState({
+ scrapeMotionValuesFromProps: createObject,
+ createRenderState: createObject,
+});
+/**
+ * This is not an officially supported API and may be removed
+ * on any version.
+ */
+function useAnimatedState(initialState) {
+ const [animationState, setAnimationState] = React.useState(initialState);
+ const visualState = useVisualState({}, false);
+ const element = featureBundle.useConstant(() => {
+ return new StateVisualElement({
+ props: {
+ onUpdate: (v) => {
+ setAnimationState({ ...v });
+ },
+ },
+ visualState,
+ presenceContext: null,
+ }, { initialState });
+ });
+ React.useLayoutEffect(() => {
+ element.mount({});
+ return () => element.unmount();
+ }, [element]);
+ const startAnimation = featureBundle.useConstant(() => (animationDefinition) => {
+ return motionDom.animateVisualElement(element, animationDefinition);
+ });
+ return [animationState, startAnimation];
+}
+
+let id = 0;
+const AnimateSharedLayout = ({ children }) => {
+ React__namespace.useEffect(() => {
+ motionUtils.invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations");
+ }, []);
+ return (jsxRuntime.jsx(LayoutGroup, { id: featureBundle.useConstant(() => `asl-${id++}`), children: children }));
+};
+
+// Keep things reasonable and avoid scale: Infinity. In practise we might need
+// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]
+// to simply hide content at unreasonable scales.
+const maxScale = 100000;
+const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale;
+let hasWarned = false;
+/**
+ * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse
+ * of their respective parent scales.
+ *
+ * This is useful for undoing the distortion of content when scaling a parent component.
+ *
+ * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.
+ * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output
+ * of those instead.
+ *
+ * ```jsx
+ * const MyComponent = () => {
+ * const { scaleX, scaleY } = useInvertedScale()
+ * return
+ * }
+ * ```
+ *
+ * @deprecated
+ */
+function useInvertedScale(scale) {
+ let parentScaleX = useMotionValue(1);
+ let parentScaleY = useMotionValue(1);
+ const { visualElement } = React.useContext(featureBundle.MotionContext);
+ motionUtils.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component.");
+ motionUtils.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.");
+ hasWarned = true;
+ if (scale) {
+ parentScaleX = scale.scaleX || parentScaleX;
+ parentScaleY = scale.scaleY || parentScaleY;
+ }
+ else if (visualElement) {
+ parentScaleX = visualElement.getValue("scaleX", 1);
+ parentScaleY = visualElement.getValue("scaleY", 1);
+ }
+ const scaleX = useTransform(parentScaleX, invertScale);
+ const scaleY = useTransform(parentScaleY, invertScale);
+ return { scaleX, scaleY };
+}
+
+exports.LayoutGroupContext = featureBundle.LayoutGroupContext;
+exports.MotionConfigContext = featureBundle.MotionConfigContext;
+exports.MotionContext = featureBundle.MotionContext;
+exports.PresenceContext = featureBundle.PresenceContext;
+exports.SwitchLayoutGroupContext = featureBundle.SwitchLayoutGroupContext;
+exports.addPointerEvent = featureBundle.addPointerEvent;
+exports.addPointerInfo = featureBundle.addPointerInfo;
+exports.animations = featureBundle.animations;
+exports.distance = featureBundle.distance;
+exports.distance2D = featureBundle.distance2D;
+exports.filterProps = featureBundle.filterProps;
+exports.isBrowser = featureBundle.isBrowser;
+exports.isValidMotionProp = featureBundle.isValidMotionProp;
+exports.makeUseVisualState = featureBundle.makeUseVisualState;
+exports.useIsPresent = featureBundle.useIsPresent;
+exports.useIsomorphicLayoutEffect = featureBundle.useIsomorphicLayoutEffect;
+exports.usePresence = featureBundle.usePresence;
+Object.defineProperty(exports, "VisualElement", {
+ enumerable: true,
+ get: function () { return motionDom.VisualElement; }
+});
+Object.defineProperty(exports, "addScaleCorrector", {
+ enumerable: true,
+ get: function () { return motionDom.addScaleCorrector; }
+});
+Object.defineProperty(exports, "animateVisualElement", {
+ enumerable: true,
+ get: function () { return motionDom.animateVisualElement; }
+});
+Object.defineProperty(exports, "buildTransform", {
+ enumerable: true,
+ get: function () { return motionDom.buildTransform; }
+});
+Object.defineProperty(exports, "calcLength", {
+ enumerable: true,
+ get: function () { return motionDom.calcLength; }
+});
+Object.defineProperty(exports, "createBox", {
+ enumerable: true,
+ get: function () { return motionDom.createBox; }
+});
+Object.defineProperty(exports, "delay", {
+ enumerable: true,
+ get: function () { return motionDom.delay; }
+});
+Object.defineProperty(exports, "optimizedAppearDataAttribute", {
+ enumerable: true,
+ get: function () { return motionDom.optimizedAppearDataAttribute; }
+});
+Object.defineProperty(exports, "resolveMotionValue", {
+ enumerable: true,
+ get: function () { return motionDom.resolveMotionValue; }
+});
+Object.defineProperty(exports, "visualElementStore", {
+ enumerable: true,
+ get: function () { return motionDom.visualElementStore; }
+});
+Object.defineProperty(exports, "MotionGlobalConfig", {
+ enumerable: true,
+ get: function () { return motionUtils.MotionGlobalConfig; }
+});
+exports.AnimatePresence = AnimatePresence;
+exports.AnimateSharedLayout = AnimateSharedLayout;
+exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext;
+exports.DragControls = DragControls;
+exports.LayoutGroup = LayoutGroup;
+exports.LazyMotion = LazyMotion;
+exports.MotionConfig = MotionConfig;
+exports.PopChild = PopChild;
+exports.PresenceChild = PresenceChild;
+exports.Reorder = namespace;
+exports.WillChangeMotionValue = WillChangeMotionValue;
+exports.animate = animate;
+exports.animateMini = animateMini;
+exports.animationControls = animationControls;
+exports.createScopedAnimate = createScopedAnimate;
+exports.disableInstantTransitions = disableInstantTransitions;
+exports.domAnimation = domAnimation;
+exports.domMax = domMax;
+exports.domMin = domMin;
+exports.inView = inView;
+exports.isMotionComponent = isMotionComponent;
+exports.m = m;
+exports.motion = motion;
+exports.scroll = scroll;
+exports.scrollInfo = scrollInfo;
+exports.startOptimizedAppearAnimation = startOptimizedAppearAnimation;
+exports.transformViewBoxPoint = transformViewBoxPoint;
+exports.unwrapMotionComponent = unwrapMotionComponent;
+exports.useAnimate = useAnimate;
+exports.useAnimateMini = useAnimateMini;
+exports.useAnimation = useAnimation;
+exports.useAnimationControls = useAnimationControls;
+exports.useAnimationFrame = useAnimationFrame;
+exports.useComposedRefs = useComposedRefs;
+exports.useCycle = useCycle;
+exports.useDeprecatedAnimatedState = useAnimatedState;
+exports.useDeprecatedInvertedScale = useInvertedScale;
+exports.useDomEvent = useDomEvent;
+exports.useDragControls = useDragControls;
+exports.useElementScroll = useElementScroll;
+exports.useFollowValue = useFollowValue;
+exports.useForceUpdate = useForceUpdate;
+exports.useInView = useInView;
+exports.useInstantLayoutTransition = useInstantLayoutTransition;
+exports.useInstantTransition = useInstantTransition;
+exports.useMotionTemplate = useMotionTemplate;
+exports.useMotionValue = useMotionValue;
+exports.useMotionValueEvent = useMotionValueEvent;
+exports.usePageInView = usePageInView;
+exports.usePresenceData = usePresenceData;
+exports.useReducedMotion = useReducedMotion;
+exports.useReducedMotionConfig = useReducedMotionConfig;
+exports.useResetProjection = useResetProjection;
+exports.useScroll = useScroll;
+exports.useSpring = useSpring;
+exports.useTime = useTime;
+exports.useTransform = useTransform;
+exports.useUnmountEffect = useUnmountEffect;
+exports.useVelocity = useVelocity;
+exports.useViewportScroll = useViewportScroll;
+exports.useWillChange = useWillChange;
+Object.keys(motionDom).forEach(function (k) {
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
+ enumerable: true,
+ get: function () { return motionDom[k]; }
+ });
+});
+Object.keys(motionUtils).forEach(function (k) {
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
+ enumerable: true,
+ get: function () { return motionUtils[k]; }
+ });
+});
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/framer-motion/dist/cjs/index.js.map b/node_modules/framer-motion/dist/cjs/index.js.map
new file mode 100644
index 0000000..8eb51d1
--- /dev/null
+++ b/node_modules/framer-motion/dist/cjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../../src/utils/use-composed-ref.ts","../../src/components/AnimatePresence/PopChild.tsx","../../src/components/AnimatePresence/PresenceChild.tsx","../../src/components/AnimatePresence/utils.ts","../../src/components/AnimatePresence/index.tsx","../../src/context/DeprecatedLayoutGroupContext.ts","../../src/utils/use-is-mounted.ts","../../src/utils/use-force-update.ts","../../src/components/LayoutGroup/index.tsx","../../src/components/LazyMotion/index.tsx","../../src/components/MotionConfig/index.tsx","../../src/context/ReorderContext.ts","../../src/render/components/create-proxy.ts","../../src/render/components/motion/proxy.ts","../../src/components/Reorder/utils/check-reorder.ts","../../src/components/Reorder/Group.tsx","../../src/value/use-motion-value.ts","../../src/value/use-combine-values.ts","../../src/value/use-computed.ts","../../src/value/use-transform.ts","../../src/components/Reorder/utils/auto-scroll.ts","../../src/components/Reorder/Item.tsx","../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/render/components/m/proxy.ts","../../src/utils/use-unmount-effect.ts","../../src/render/dom/features-animation.ts","../../src/render/dom/features-max.ts","../../src/render/dom/features-min.ts","../../src/utils/use-motion-value-event.ts","../../src/value/use-scroll.ts","../../src/value/scroll/use-element-scroll.ts","../../src/value/scroll/use-viewport-scroll.ts","../../src/value/use-motion-template.ts","../../src/value/use-follow-value.ts","../../src/value/use-spring.ts","../../src/utils/use-animation-frame.ts","../../src/value/use-time.ts","../../src/value/use-velocity.ts","../../src/value/use-will-change/WillChangeMotionValue.ts","../../src/value/use-will-change/index.ts","../../src/utils/reduced-motion/use-reduced-motion.ts","../../src/utils/reduced-motion/use-reduced-motion-config.ts","../../src/animation/hooks/animation-controls.ts","../../src/animation/hooks/use-animate.ts","../../src/animation/hooks/use-animate-style.ts","../../src/animation/hooks/use-animation.ts","../../src/components/AnimatePresence/use-presence-data.ts","../../src/events/use-dom-event.ts","../../src/gestures/drag/use-drag-controls.ts","../../src/motion/utils/is-motion-component.ts","../../src/motion/utils/unwrap-motion-component.ts","../../src/projection/use-instant-layout-transition.ts","../../src/projection/use-reset-projection.ts","../../src/utils/use-cycle.ts","../../src/utils/use-in-view.ts","../../src/utils/use-instant-transition.ts","../../src/utils/use-page-in-view.ts","../../src/utils/transform-viewbox-point.ts","../../src/animation/optimized-appear/store.ts","../../src/animation/optimized-appear/store-id.ts","../../src/animation/optimized-appear/handoff.ts","../../src/animation/optimized-appear/start.ts","../../src/animation/hooks/use-animated-state.ts","../../src/components/AnimateSharedLayout.tsx","../../src/value/use-inverted-scale.ts"],"sourcesContent":["/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\nimport * as React from \"react\"\n\ntype PossibleRef = React.Ref | undefined\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T): void | (() => void) {\n if (typeof ref === \"function\") {\n return ref(value)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as React.MutableRefObject).current = value\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node)\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true\n }\n return cleanup\n })\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i]\n if (typeof cleanup === \"function\") {\n cleanup()\n } else {\n setRef(refs[i], null)\n }\n }\n }\n }\n }\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs)\n}\n\nexport { useComposedRefs }\n","\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject\n sizeRef: React.RefObject\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const size = this.props.sizeRef.current!\n size.height = element.offsetHeight || 0\n size.width = element.offsetWidth || 0\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef(null)\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n */\n const childRef =\n (children.props as { ref?: React.Ref })?.ref ??\n (children as unknown as { ref?: React.Ref })?.ref\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n \n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n \n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useId, useMemo } from \"react\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { VariantLabels } from \"../../motion/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { PopChild } from \"./PopChild\"\n\ninterface PresenceChildProps {\n children: React.ReactElement\n isPresent: boolean\n onExitComplete?: () => void\n initial?: false | VariantLabels\n custom?: any\n presenceAffectsLayout: boolean\n mode: \"sync\" | \"popLayout\" | \"wait\"\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n}\n\nexport const PresenceChild = ({\n children,\n initial,\n isPresent,\n onExitComplete,\n custom,\n presenceAffectsLayout,\n mode,\n anchorX,\n anchorY,\n root\n}: PresenceChildProps) => {\n const presenceChildren = useConstant(newChildrenMap)\n const id = useId()\n\n let isReusedContext = true\n let context = useMemo((): PresenceContextProps => {\n isReusedContext = false\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId: string) => {\n presenceChildren.set(childId, true)\n\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete) return // can stop searching when any is incomplete\n }\n\n onExitComplete && onExitComplete()\n },\n register: (childId: string) => {\n presenceChildren.set(childId, false)\n return () => presenceChildren.delete(childId)\n },\n }\n }, [isPresent, presenceChildren, onExitComplete])\n\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context }\n }\n\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false))\n }, [isPresent])\n\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete()\n }, [isPresent])\n\n children = (\n \n {children}\n \n )\n\n return (\n \n {children}\n \n )\n}\n\nfunction newChildrenMap(): Map {\n return new Map()\n}\n","import { isValidElement, Children, ReactElement, ReactNode } from \"react\"\n\nexport type ComponentKey = string | number\n\nexport const getChildKey = (child: ReactElement): ComponentKey =>\n child.key || \"\"\n\nexport function onlyElements(children: ReactNode): ReactElement[] {\n const filtered: ReactElement[] = []\n\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child)) filtered.push(child)\n })\n\n return filtered\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n exitingComponents.current.add(key)\n\n if (exitComplete.has(key)) {\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n \n {child}\n \n )\n })}\n >\n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\n\n/**\n * Note: Still used by components generated by old versions of Framer\n *\n * @deprecated\n */\nexport const DeprecatedLayoutGroupContext = createContext(null)\n","\"use client\"\n\nimport { useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-effect\"\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { MutableRefObject, useContext, useMemo, useRef } from \"react\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../context/LayoutGroupContext\"\nimport { DeprecatedLayoutGroupContext } from \"../../context/DeprecatedLayoutGroupContext\"\nimport { nodeGroup } from \"../../projection\"\nimport { useForceUpdate } from \"../../utils/use-force-update\"\n\ntype InheritOption = boolean | \"id\"\n\nexport interface Props {\n id?: string\n inherit?: InheritOption\n}\n\nconst shouldInheritGroup = (inherit: InheritOption) => inherit === true\nconst shouldInheritId = (inherit: InheritOption) =>\n shouldInheritGroup(inherit === true) || inherit === \"id\"\n\nexport const LayoutGroup: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children, id, inherit = true }) => {\n const layoutGroupContext = useContext(LayoutGroupContext)\n const deprecatedLayoutGroupContext = useContext(\n DeprecatedLayoutGroupContext\n )\n const [forceRender, key] = useForceUpdate()\n const context = useRef(\n null\n ) as MutableRefObject\n\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext\n if (context.current === null) {\n if (shouldInheritId(inherit) && upstreamId) {\n id = id ? upstreamId + \"-\" + id : upstreamId\n }\n\n context.current = {\n id,\n group: shouldInheritGroup(inherit)\n ? layoutGroupContext.group || nodeGroup()\n : nodeGroup(),\n }\n }\n\n const memoizedContext = useMemo(\n () => ({ ...context.current, forceRender }),\n [key]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { loadFeatures } from \"../../motion/features/load-features\"\nimport { FeatureBundle, LazyFeatureBundle } from \"../../motion/features/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { LazyProps } from \"./types\"\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }: LazyProps) {\n const [, setIsLoaded] = useState(!isLazyBundle(features))\n const loadedRenderer = useRef(undefined)\n\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features\n loadedRenderer.current = renderer\n loadFeatures(loadedFeatures)\n }\n\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures)\n loadedRenderer.current = renderer\n setIsLoaded(true)\n })\n }\n }, [])\n\n return (\n \n {children}\n \n )\n}\n\nfunction isLazyBundle(\n features: FeatureBundle | LazyFeatureBundle\n): features is LazyFeatureBundle {\n return typeof features === \"function\"\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo } from \"react\"\nimport { resolveTransition } from \"motion-dom\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport {\n loadExternalIsValidProp,\n IsValidProp,\n} from \"../../render/dom/utils/filter-props\"\nimport { useConstant } from \"../../utils/use-constant\"\n\nexport interface MotionConfigProps extends Partial {\n children?: React.ReactNode\n isValidProp?: IsValidProp\n}\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function MotionConfig({\n children,\n isValidProp,\n ...config\n}: MotionConfigProps) {\n isValidProp && loadExternalIsValidProp(isValidProp)\n\n /**\n * Inherit props from any parent MotionConfig components\n */\n const parentConfig = useContext(MotionConfigContext)\n config = { ...parentConfig, ...config }\n\n config.transition = resolveTransition(\n config.transition,\n parentConfig.transition\n )\n\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(() => config.isStatic)\n\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n const context = useMemo(\n () => config,\n [\n JSON.stringify(config.transition),\n config.transformPagePoint,\n config.reducedMotion,\n config.skipAnimations,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { ReorderContextProps } from \"../components/Reorder/types\"\n\nexport const ReorderContext = createContext | null>(\n null\n)\n","import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps = React.PropsWithoutRef &\n React.RefAttributes\nexport type CustomDomComponent = React.ComponentType<\n ComponentProps\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n","import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n","import { mixNumber } from \"motion-dom\"\nimport { moveItem } from \"motion-utils\"\nimport { ItemData } from \"../types\"\n\nexport function checkReorder(\n order: ItemData[],\n value: T,\n offset: number,\n velocity: number\n): ItemData[] {\n if (!velocity) return order\n\n const index = order.findIndex((item) => item.value === value)\n\n if (index === -1) return order\n\n const nextOffset = velocity > 0 ? 1 : -1\n const nextItem = order[index + nextOffset]\n\n if (!nextItem) return order\n\n const item = order[index]\n const nextLayout = nextItem.layout\n const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5)\n\n if (\n (nextOffset === 1 && item.layout.max + offset > nextItemCenter) ||\n (nextOffset === -1 && item.layout.min + offset < nextItemCenter)\n ) {\n return moveItem(order, index, index + nextOffset)\n }\n\n return order\n}\n","\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, JSX, useEffect, useRef } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, items will be draggable on this axis.\n * To make draggable on both axes, set ``\n *\n * @public\n */\n axis?: \"x\" | \"y\"\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * \n * {items.map((item) => )}\n * \n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props &\n Omit, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis = \"y\",\n onReorder,\n values,\n ...props\n }: ReorderGroupProps,\n externalRef?: React.ForwardedRef\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const order: ItemData[] = []\n const isReordering = useRef(false)\n const groupRef = useRef(null)\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const context: ReorderContextProps = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n // If the entry was already added, update it rather than adding it again\n const idx = order.findIndex((entry) => value === entry.value)\n if (idx !== -1) {\n order[idx].layout = layout[axis]\n } else {\n order.push({ value: value, layout: layout[axis] })\n }\n order.sort(compareMin)\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const newOrder = checkReorder(order, item, offset, velocity)\n\n if (order !== newOrder) {\n isReordering.current = true\n onReorder(\n newOrder\n .map(getValue)\n .filter((value) => values.indexOf(value) !== -1)\n )\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(\n externalRef as React.MutableRefObject\n ).current = element\n }\n }\n\n /**\n * Disable browser scroll anchoring on the group container.\n * When items reorder, scroll anchoring can cause the browser to adjust\n * the scroll position, which interferes with drag position calculations.\n */\n const groupStyle = {\n overflowAnchor: \"none\" as const,\n ...props.style,\n }\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n props: ReorderGroupProps & { ref?: React.ForwardedRef }\n) => ReturnType\n\nfunction getValue(item: ItemData) {\n return item.value\n}\n\nfunction compareMin(a: ItemData, b: ItemData) {\n return a.layout.min - b.layout.min\n}\n","\"use client\"\n\nimport { motionValue, MotionValue } from \"motion-dom\"\nimport { useContext, useEffect, useState } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useConstant } from \"../utils/use-constant\"\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return \n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nexport function useMotionValue(initial: T): MotionValue {\n const value = useConstant(() => motionValue(initial))\n\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext)\n if (isStatic) {\n const [, setLatest] = useState(initial)\n useEffect(() => value.on(\"change\", setLatest), [])\n }\n\n return value\n}\n","\"use client\"\n\nimport { cancelFrame, frame, MotionValue } from \"motion-dom\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useCombineMotionValues(\n values: MotionValue[],\n combineValues: () => R\n) {\n /**\n * Initialise the returned motion value. This remains the same between renders.\n */\n const value = useMotionValue(combineValues())\n\n /**\n * Create a function that will update the template motion value with the latest values.\n * This is pre-bound so whenever a motion value updates it can schedule its\n * execution in Framesync. If it's already been scheduled it won't be fired twice\n * in a single frame.\n */\n const updateValue = () => value.set(combineValues())\n\n /**\n * Synchronously update the motion value with the latest values during the render.\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\n */\n updateValue()\n\n /**\n * Subscribe to all motion values found within the template. Whenever any of them change,\n * schedule an update.\n */\n useIsomorphicLayoutEffect(() => {\n const scheduleUpdate = () => frame.preRender(updateValue, false, true)\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate))\n\n return () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(updateValue)\n }\n })\n\n return value\n}\n","\"use client\"\n\nimport { collectMotionValues, type MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\nexport function useComputed(compute: () => O): MotionValue {\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * will be saved into this array.\n */\n collectMotionValues.current = []\n\n compute()\n\n const value = useCombineMotionValues(collectMotionValues.current, compute)\n\n /**\n * Synchronously close session of collectMotionValues.\n */\n collectMotionValues.current = undefined\n\n return value\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer = (input: I) => O\ntype MultiTransformer = (input: I[]) => O\ntype Transformer =\n | SingleTransformer\n /**\n * Ideally, this would be typed in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer\n\ninterface OutputMap {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform>(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions\n): { [K in keyof T]: MotionValue }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n value: MotionValue,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return \n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input: MotionValue,\n transformer: SingleTransformer\n): MotionValue