@nethesis/phone-island 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/components/CallView/DeviceIcon.js +1 -1
  2. package/dist/components/CallView/DeviceIcon.js.map +1 -1
  3. package/dist/components/CallView/NumberPopover.js +1 -1
  4. package/dist/components/CallView/NumberPopover.js.map +1 -1
  5. package/dist/components/SideView/hooks/useSideViewLogic.js +1 -1
  6. package/dist/components/SideView/hooks/useSideViewLogic.js.map +1 -1
  7. package/dist/components/Socket.js +1 -1
  8. package/dist/components/Socket.js.map +1 -1
  9. package/dist/components/VideoView/index.js +1 -1
  10. package/dist/components/VideoView/index.js.map +1 -1
  11. package/dist/components/WebRTC.js +1 -1
  12. package/dist/components/WebRTC.js.map +1 -1
  13. package/dist/lib/phone/counterpartDevice.js +1 -1
  14. package/dist/lib/phone/counterpartDevice.js.map +1 -1
  15. package/dist/lib/phone/screenShare.js +2 -0
  16. package/dist/lib/phone/screenShare.js.map +1 -0
  17. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js +1 -1
  18. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js.map +1 -1
  19. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
  20. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
  21. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js +1 -1
  22. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js.map +1 -1
  23. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.js.map +1 -1
  24. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.js.map +1 -1
  25. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.mjs.js.map +1 -1
  26. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.js.map +1 -1
  27. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.js.map +1 -1
  28. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.js +1 -1
  29. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.js.map +1 -1
  30. package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.js.map +1 -1
  31. package/dist/node_modules/framer-motion/dist/es/gestures/hover.mjs.js +1 -1
  32. package/dist/node_modules/framer-motion/dist/es/gestures/hover.mjs.js.map +1 -1
  33. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.js +1 -1
  34. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.js.map +1 -1
  35. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js +1 -1
  36. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js.map +1 -1
  37. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.js +1 -1
  38. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.js.map +1 -1
  39. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.js +1 -1
  40. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.js.map +1 -1
  41. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js +1 -1
  42. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js.map +1 -1
  43. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.js.map +1 -1
  44. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.js +1 -1
  45. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.js.map +1 -1
  46. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.js +1 -1
  47. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.js.map +1 -1
  48. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js +1 -1
  49. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js.map +1 -1
  50. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js +1 -1
  51. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js.map +1 -1
  52. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.js +1 -1
  53. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.js.map +1 -1
  54. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.js +1 -1
  55. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.js.map +1 -1
  56. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js +1 -1
  57. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js.map +1 -1
  58. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js +1 -1
  59. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
  60. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js +1 -1
  61. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js.map +1 -1
  62. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.js +1 -1
  63. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.js.map +1 -1
  64. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js +1 -1
  65. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js.map +1 -1
  66. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js +1 -1
  67. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js.map +1 -1
  68. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js +1 -1
  69. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js.map +1 -1
  70. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js +1 -1
  71. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js.map +1 -1
  72. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.js +1 -1
  73. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.js.map +1 -1
  74. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js +1 -1
  75. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js.map +1 -1
  76. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.js +1 -1
  77. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.js.map +1 -1
  78. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js +1 -1
  79. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js.map +1 -1
  80. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js +1 -1
  81. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js.map +1 -1
  82. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js +1 -1
  83. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js.map +1 -1
  84. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js +1 -1
  85. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js.map +1 -1
  86. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js +1 -1
  87. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js.map +1 -1
  88. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js +1 -1
  89. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js.map +1 -1
  90. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.js +1 -1
  91. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.js.map +1 -1
  92. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js +1 -1
  93. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js.map +1 -1
  94. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.js +1 -1
  95. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.js.map +1 -1
  96. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.js +1 -1
  97. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.js.map +1 -1
  98. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.js +1 -1
  99. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.js.map +1 -1
  100. package/dist/node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs.js +2 -0
  101. package/dist/node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs.js.map +1 -0
  102. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-start-time.mjs.js +2 -0
  103. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-start-time.mjs.js.map +1 -0
  104. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.js +1 -1
  105. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.js.map +1 -1
  106. package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.mjs.js +2 -0
  107. package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.mjs.js.map +1 -0
  108. package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/groups.mjs.js +2 -0
  109. package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/groups.mjs.js.map +1 -0
  110. package/dist/node_modules/motion-dom/dist/es/events/add-pointer-event.mjs.js +2 -0
  111. package/dist/node_modules/motion-dom/dist/es/events/add-pointer-event.mjs.js.map +1 -0
  112. package/dist/node_modules/motion-dom/dist/es/events/event-info.mjs.js +2 -0
  113. package/dist/node_modules/motion-dom/dist/es/events/event-info.mjs.js.map +1 -0
  114. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
  115. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
  116. package/dist/node_modules/motion-dom/dist/es/frameloop/frame-data.mjs.js +2 -0
  117. package/dist/node_modules/motion-dom/dist/es/frameloop/frame-data.mjs.js.map +1 -0
  118. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.mjs.js +1 -1
  119. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.mjs.js.map +1 -1
  120. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
  121. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
  122. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.js +1 -1
  123. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.js.map +1 -1
  124. package/dist/node_modules/motion-dom/dist/es/gestures/drag/VisualElementDragControls.mjs.js +2 -0
  125. package/dist/node_modules/motion-dom/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +1 -0
  126. package/dist/node_modules/motion-dom/dist/es/gestures/drag/utils/constraints.mjs.js +2 -0
  127. package/dist/node_modules/motion-dom/dist/es/gestures/drag/utils/constraints.mjs.js.map +1 -0
  128. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js +1 -1
  129. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js.map +1 -1
  130. package/dist/node_modules/motion-dom/dist/es/gestures/pan/PanSession.mjs.js +2 -0
  131. package/dist/node_modules/motion-dom/dist/es/gestures/pan/PanSession.mjs.js.map +1 -0
  132. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
  133. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
  134. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.js +1 -1
  135. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.js.map +1 -1
  136. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.js +1 -1
  137. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.js.map +1 -1
  138. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js +1 -1
  139. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js.map +1 -1
  140. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js.map +1 -1
  141. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.js.map +1 -1
  142. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.js +1 -1
  143. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.js.map +1 -1
  144. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js +1 -1
  145. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
  146. package/dist/node_modules/motion-dom/dist/es/projection/node/root.mjs.js +2 -0
  147. package/dist/node_modules/motion-dom/dist/es/projection/node/root.mjs.js.map +1 -0
  148. package/dist/node_modules/motion-dom/dist/es/projection/styles/default-scale-correctors.mjs.js +2 -0
  149. package/dist/node_modules/motion-dom/dist/es/projection/styles/default-scale-correctors.mjs.js.map +1 -0
  150. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js +1 -1
  151. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js.map +1 -1
  152. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.js +1 -1
  153. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.js.map +1 -1
  154. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.js.map +1 -1
  155. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js +1 -1
  156. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js.map +1 -1
  157. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js +1 -1
  158. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js.map +1 -1
  159. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.js.map +1 -1
  160. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.js +1 -1
  161. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.js.map +1 -1
  162. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.js +1 -1
  163. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.js.map +1 -1
  164. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.js +1 -1
  165. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.js.map +1 -1
  166. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js +1 -1
  167. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js.map +1 -1
  168. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.js +1 -1
  169. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.js.map +1 -1
  170. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js +1 -1
  171. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js.map +1 -1
  172. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js +1 -1
  173. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js.map +1 -1
  174. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.js +1 -1
  175. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.js.map +1 -1
  176. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.js +1 -1
  177. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.js.map +1 -1
  178. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.js +1 -1
  179. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.js.map +1 -1
  180. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.js +1 -1
  181. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.js.map +1 -1
  182. package/dist/node_modules/motion-dom/dist/es/resize/index.mjs.js +1 -1
  183. package/dist/node_modules/motion-dom/dist/es/resize/index.mjs.js.map +1 -1
  184. package/dist/node_modules/motion-dom/dist/es/scope/active.mjs.js +2 -0
  185. package/dist/node_modules/motion-dom/dist/es/scope/active.mjs.js.map +1 -0
  186. package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js +1 -1
  187. package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js.map +1 -1
  188. package/dist/node_modules/motion-dom/dist/es/utils/distance.mjs.js.map +1 -0
  189. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.mjs.js +1 -1
  190. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.mjs.js.map +1 -1
  191. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.mjs.js +1 -1
  192. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.mjs.js.map +1 -1
  193. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.js +1 -1
  194. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.js.map +1 -1
  195. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js +1 -1
  196. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js.map +1 -1
  197. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js +1 -1
  198. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js.map +1 -1
  199. package/dist/node_modules/motion-dom/dist/es/value/utils/as-number.mjs.js +2 -0
  200. package/dist/node_modules/motion-dom/dist/es/value/utils/as-number.mjs.js.map +1 -0
  201. package/dist/node_modules/motion-utils/dist/es/easing/circ.mjs.js.map +1 -1
  202. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.js +1 -1
  203. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.js.map +1 -1
  204. package/dist/node_modules/motion-utils/dist/es/errors.mjs.js +1 -1
  205. package/dist/node_modules/motion-utils/dist/es/errors.mjs.js.map +1 -1
  206. package/dist/node_modules/motion-utils/dist/es/subscription-manager.mjs.js +1 -1
  207. package/dist/node_modules/motion-utils/dist/es/subscription-manager.mjs.js.map +1 -1
  208. package/dist/package.json.js +1 -1
  209. package/package.json +3 -3
  210. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.js +0 -2
  211. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.js.map +0 -1
  212. package/dist/node_modules/framer-motion/dist/es/events/event-info.mjs.js +0 -2
  213. package/dist/node_modules/framer-motion/dist/es/events/event-info.mjs.js.map +0 -1
  214. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js +0 -2
  215. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +0 -1
  216. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js +0 -2
  217. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js.map +0 -1
  218. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +0 -2
  219. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +0 -1
  220. package/dist/node_modules/framer-motion/dist/es/utils/distance.mjs.js.map +0 -1
  221. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.js +0 -2
  222. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.js.map +0 -1
  223. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.js +0 -2
  224. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.js.map +0 -1
  225. /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/distance.mjs.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"NativeAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs"],"sourcesContent":["import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n"],"names":["NativeAnimation","WithPromise","constructor","options","super","this","finishedTime","isStopped","manualStartTime","element","name","keyframes","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","invariant","type","transition","applyGeneratorOptions","animation","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","getFinalKeyframe","speed","updateMotionValue","setStyle","cancel","notifyFinished","play","state","updateFinished","complete","finish","e","stop","commitStyles","isConnected","duration","effect","getComputedTiming","millisecondsToSeconds","Number","iterationDuration","delay","currentTime","newTime","wasFinished","secondsToMilliseconds","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","rangeStart","rangeEnd","observe","updateTiming","easing","supportsScrollTimeline","noop"],"mappings":"2hBA4BM,MAAOA,UACDC,EAAAA,YAyBRC,WAAAA,CAAYC,GAGR,GAFAC,QAlBMC,KAAAC,aAA8B,KAMhCD,KAAAE,WAAY,EASV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AW1D,KAAKiB,UAAkByC,SAAWA,GAE1CK,QAEAJ,EAAQ3D,KAEvB"}
1
+ {"version":3,"file":"NativeAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs"],"sourcesContent":["import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n notifyAnimationStart(this, options, transition);\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n /**\n * Before its finish event, a finished animation (an instant one is\n * as soon as it starts) is still showing its end, so it's stopped\n * like a running one. Otherwise that event would apply its end\n * over whatever animates the value next.\n */\n if (this.state === \"idle\" || this.finishedTime !== null)\n return;\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement) {\n this.animation.onfinish = null;\n this.cancel();\n }\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, onAttach, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n onAttach?.(this.animation);\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n"],"names":["NativeAnimation","WithPromise","constructor","options","super","this","finishedTime","isStopped","manualStartTime","element","name","keyframes","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","invariant","type","transition","applyGeneratorOptions","animation","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","getFinalKeyframe","speed","updateMotionValue","setStyle","cancel","notifyFinished","notifyAnimationStart","play","state","updateFinished","complete","finish","e","stop","commitStyles","isConnected","duration","effect","getComputedTiming","millisecondsToSeconds","Number","iterationDuration","delay","currentTime","newTime","wasFinished","secondsToMilliseconds","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","onAttach","observe","updateTiming","easing","supportsScrollTimeline","noop"],"mappings":"wkBA6BM,MAAOA,UACDC,EAAAA,YAyBRC,WAAAA,CAAYC,GAGR,GAFAC,QAlBMC,KAAAC,aAA8B,KAMhCD,KAAAE,WAAY,EASVF,KAAAG,gBAAiC,MAKlCL,EAAS,OAEd,MAAMM,QACFA,EAAOC,KACPA,EAAIC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Property(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("../render/dom/style-set.mjs.js"),i=require("./JSAnimation.mjs.js"),s=require("./NativeAnimation.mjs.js"),a=require("./utils/replace-transition-type.mjs.js"),o=require("./waapi/utils/unsupported-easing.mjs.js"),r=require("../../../../motion-utils/dist/es/clamp.mjs.js");class n extends s.NativeAnimation{constructor(e){o.replaceStringEasing(e),a.replaceTransitionType(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(s){const{motionValue:a,onUpdate:o,onComplete:n,element:m,...p}=this.options;if(!a)return;if(void 0!==s)return void a.set(s);const u=new i.JSAnimation({...p,autoplay:!1}),l=Math.max(10,e.time.now()-this.startTime),j=r.clamp(0,10,l-10),c=u.sample(l).value,{name:d}=this.options;m&&d&&t.setStyle(m,d,c),a.setWithVelocity(u.sample(Math.max(0,l-j)).value,c,j),u.stop()}}exports.NativeAnimationExtended=n;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("../render/dom/style-set.mjs.js"),s=require("./JSAnimation.mjs.js"),i=require("./NativeAnimation.mjs.js"),a=require("./utils/replace-transition-type.mjs.js"),n=require("./waapi/utils/unsupported-easing.mjs.js"),r=require("../../../../motion-utils/dist/es/clamp.mjs.js");class o extends i.NativeAnimation{constructor(e){n.replaceStringEasing(e),a.replaceTransitionType(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}elapsed(){return"running"===this.state?(e.time.now()-this.startTime)*this.speed:1e3*this.time}sample(e){if(!this.sampler){const{motionValue:e,onUpdate:t,onComplete:i,onPlay:a,onStop:n,element:r,...o}=this.options;this.sampler=new s.JSAnimation({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){const{state:e}=this;if("running"===e||"paused"===e)return this.sample(this.elapsed())}updateMotionValue(e){const{motionValue:s,element:i,name:a}=this.options;if(!s)return;if(void 0!==e)return void s.set(e);const{speed:n}=this,o=this.elapsed(),p="running"===this.state&&n?r.clamp(0,10,o):0,l=this.sample(o);i&&a&&t.setStyle(i,a,l),s.setWithVelocity(this.sample(o-p*Math.sign(n)),l,p/Math.abs(n||1))}}exports.NativeAnimationExtended=o,exports.sampleDelta=10;
2
2
  //# sourceMappingURL=NativeAnimationExtended.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeAnimationExtended.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs"],"sourcesContent":["import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n const current = sampleAnimation.sample(sampleTime).value;\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n const { name } = this.options;\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n"],"names":["NativeAnimationExtended","NativeAnimation","constructor","options","replaceStringEasing","replaceTransitionType","super","undefined","startTime","autoplay","this","updateMotionValue","value","motionValue","onUpdate","onComplete","element","set","sampleAnimation","JSAnimation","sampleTime","Math","max","time","now","delta","clamp","current","sample","name","setStyle","setWithVelocity","stop"],"mappings":"2YAmBM,MAAOA,UAEHC,EAAAA,gBAGNC,WAAAA,CAAYC,GAURC,EAAmBA,oBAACD,GASpBE,EAAqBA,sBAACF,GAEtBG,MAAMH,QAOoBI,IAAtBJ,EAAQK,YAAgD,IAArBL,EAAQM,WAC3CC,KAAKF,UAAYL,EAAQK,WAG7BE,KAAKP,QAAUA,CACnB,CAUAQ,iBAAAA,CAAkBC,GACd,MAAMC,YAAEA,EAAWC,SAAEA,EAAQC,WAAEA,EAAUC,QAAEA,KAAYb,GACnDO,KAAKP,QAET,IAAKU,EAAa,OAElB,QAAcN,IAAVK,EAEA,YADAC,EAAYI,IAAIL,GAIpB,MAAMM,EAAkB,IAAIC,cAAY,IACjChB,EACHM,UAAU,IAQRW,EAAaC,KAAKC,IAvEZ,GAuE6BC,EAAIA,KAACC,MAAQd,KAAKF,WACrDiB,EAAQC,EAAAA,MAAM,EAxER,GAwEwBN,EAxExB,IAyENO,EAAUT,EAAgBU,OAAOR,GAAYR,OAO7CiB,KAAEA,GAASnB,KAAKP,QAClBa,GAAWa,GAAMC,EAAAA,SAASd,EAASa,EAAMF,GAE7Cd,EAAYkB,gBACRb,EAAgBU,OAAOP,KAAKC,IAAI,EAAGF,EAAaK,IAAQb,MACxDe,EACAF,GAGJP,EAAgBc,MACpB"}
1
+ {"version":3,"file":"NativeAnimationExtended.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs"],"sourcesContent":["import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * The animation's time now, in ms. Wall-clock rather than WAAPI's\n * currentTime while running, as under CPU load currentTime may not\n * reflect the actual elapsed time, causing incorrect sampling and\n * visual jumps.\n */\n elapsed() {\n return this.state === \"running\"\n ? (time.now() - this.startTime) * this.speed\n : this.time * 1000;\n }\n /**\n * The value at a time, from a renderless JS animation.\n */\n sample(sampleTime) {\n if (!this.sampler) {\n const { motionValue, onUpdate, onComplete, onPlay, onStop, element, ...options } = this.options;\n /**\n * Stop it straight away so its driver doesn't run every frame.\n * It can still be sampled.\n */\n this.sampler = new JSAnimation({ ...options, autoplay: false });\n this.sampler.stop();\n }\n return this.sampler.sample(Math.max(0, sampleTime)).value;\n }\n /**\n * The value now, as WAAPI doesn't set the motion value while it runs.\n */\n liveValue() {\n const { state } = this;\n if (state === \"running\" || state === \"paused\") {\n return this.sample(this.elapsed());\n }\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * sample a renderless JS animation twice to calculate its current\n * value, \"previous\" value, and therefore allow Motion to calculate\n * velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, element, name } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const { speed } = this;\n const sampleTime = this.elapsed();\n const delta = this.state === \"running\" && speed\n ? clamp(0, sampleDelta, sampleTime)\n : 0;\n const current = this.sample(sampleTime);\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(this.sample(sampleTime - delta * Math.sign(speed)), current, delta / Math.abs(speed || 1));\n }\n}\n\nexport { NativeAnimationExtended, sampleDelta };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n"],"names":["NativeAnimationExtended","NativeAnimation","constructor","options","replaceStringEasing","replaceTransitionType","super","undefined","startTime","autoplay","this","elapsed","state","time","now","speed","sample","sampleTime","sampler","motionValue","onUpdate","onComplete","onPlay","onStop","element","JSAnimation","stop","Math","max","value","liveValue","updateMotionValue","name","set","delta","clamp","current","setStyle","setWithVelocity","sign","abs"],"mappings":"2YAmBM,MAAOA,UAEHC,EAAAA,gBAGNC,WAAAA,CAAYC,GAURC,EAAmBA,oBAACD,GASpBE,EAAqBA,sBAACF,GAEtBG,MAAMH,QAOoBI,IAAtBJ,EAAQK,YAAgD,IAArBL,EAAQM,WAC3CC,KAAKF,UAAYL,EAAQK,WAG7BE,KAAKP,QAAUA,CACnB,CAUQQ,OAAAA,GACJ,MAAsB,YAAfD,KAAKE,OACLC,EAAAA,KAAKC,MAAQJ,KAAKF,WAAaE,KAAKK,MACzB,IAAZL,KAAKG,IACf,CAKQG,MAAAA,CAAOC,GACX,IAAKP,KAAKQ,QAAS,CACf,MAAMC,YACFA,EAAWC,SACXA,EAAQC,WACRA,EAAUC,OACVA,EAAMC,OACNA,EAAMC,QACNA,KACGrB,GACHO,KAAKP,QAMTO,KAAKQ,QAAU,IAAIO,cAAY,IAAKtB,EAASM,UAAU,IACvDC,KAAKQ,QAAQQ,MACjB,CAEA,OAAOhB,KAAKQ,QAAQF,OAAOW,KAAKC,IAAI,EAAGX,IAAaY,KACxD,CAKAC,SAAAA,GACI,MAAMlB,MAAEA,GAAUF,KAElB,GAAc,YAAVE,GAAiC,WAAVA,EACvB,OAAOF,KAAKM,OAAON,KAAKC,UAEhC,CAUAoB,iBAAAA,CAAkBF,GACd,MAAMV,YAAEA,EAAWK,QAAEA,EAAOQ,KAAEA,GAAStB,KAAKP,QAE5C,IAAKgB,EAAa,OAElB,QAAcZ,IAAVsB,EAEA,YADAV,EAAYc,IAAIJ,GAIpB,MAAMd,MAAEA,GAAUL,KACZO,EAAaP,KAAKC,UAClBuB,EACa,YAAfxB,KAAKE,OAAuBG,EACtBoB,EAAKA,MAAC,EAnHG,GAmHalB,GACtB,EACJmB,EAAU1B,KAAKM,OAAOC,GAOxBO,GAAWQ,GAAMK,EAAAA,SAASb,EAASQ,EAAMI,GAE7CjB,EAAYmB,gBACR5B,KAAKM,OAAOC,EAAaiB,EAAQP,KAAKY,KAAKxB,IAC3CqB,EACAF,EAAQP,KAAKa,IAAIzB,GAAS,GAElC,wDAnIuB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../frameloop/sync-time.mjs.js"),r=require("../../frameloop/frame.mjs.js");exports.frameloopDriver=t=>{const a=({timestamp:e})=>t(e);return{start:(e=!0)=>r.frame.update(a,e),stop:()=>r.cancelFrame(a),now:()=>r.frameData.isProcessing?r.frameData.timestamp:e.time.now()}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../frameloop/sync-time.mjs.js"),r=require("../../frameloop/frame-data.mjs.js"),a=require("../../frameloop/frame.mjs.js");exports.frameloopDriver=t=>{const s=({timestamp:e})=>t(e);return{start:(e=!0)=>a.frame.update(s,e),stop:()=>a.cancelFrame(s),now:()=>r.frameData.isProcessing?r.frameData.timestamp:e.time.now()}};
2
2
  //# sourceMappingURL=frame.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"frame.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/drivers/frame.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n"],"names":["update","passTimestamp","timestamp","start","keepAlive","frame","stop","cancelFrame","now","frameData","isProcessing","time"],"mappings":"wLAKwCA,IACpC,MAAMC,EAAgBA,EAAGC,eAA2BF,EAAOE,GAE3D,MAAO,CACHC,MAAOA,CAACC,GAAY,IAASC,EAAKA,MAACL,OAAOC,EAAeG,GACzDE,KAAMA,IAAMC,EAAWA,YAACN,GAKxBO,IAAKA,IAAOC,EAAAA,UAAUC,aAAeD,EAASA,UAACP,UAAYS,EAAIA,KAACH"}
1
+ {"version":3,"file":"frame.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/drivers/frame.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData } from '../../frameloop/frame-data.mjs';\nimport { cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n"],"names":["update","passTimestamp","timestamp","start","keepAlive","frame","stop","cancelFrame","now","frameData","isProcessing","time"],"mappings":"uOAKwCA,IACpC,MAAMC,EAAgBA,EAAGC,eAA2BF,EAAOE,GAE3D,MAAO,CACHC,MAAOA,CAACC,GAAY,IAASC,EAAKA,MAACL,OAAOC,EAAeG,GACzDE,KAAMA,IAAMC,EAAWA,YAACN,GAKxBO,IAAKA,IAAOC,EAAAA,UAAUC,aAAeD,EAASA,UAACP,UAAYS,EAAIA,KAACH"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./spring.mjs.js"),t=require("./utils/velocity.mjs.js");exports.inertia=function({keyframes:s,velocity:o=0,power:a=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:l,min:u,max:v,restDelta:d=.5,restSpeed:c}){const p=s[0],m={done:!1,value:p},f=e=>void 0===u?v:void 0===v||Math.abs(u-e)<Math.abs(v-e)?u:v;let y=a*o;const b=p+y,g=void 0===l?b:l(b);g!==b&&(y=g-p);const x=e=>-y*Math.exp(-e/n),j=e=>g+x(e),M=e=>{const t=x(e),s=j(e);m.done=Math.abs(t)<=d,m.value=m.done?g:s};let h,D;const S=s=>{var o;(o=m.value,void 0!==u&&o<u||void 0!==v&&o>v)&&(h=s,D=e.spring({keyframes:[m.value,f(m.value)],velocity:t.getGeneratorVelocity(j,s,m.value),damping:i,stiffness:r,restDelta:d,restSpeed:c}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return D||void 0!==h||(t=!0,M(e),S(e)),void 0!==h&&e>=h?D.next(e-h):(!t&&M(e),m)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./spring.mjs.js");exports.inertia=function({keyframes:t,velocity:n=0,power:s=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:r=500,modifyTarget:i,min:l,max:u,restDelta:d=.5,restSpeed:v}){const c=t[0],p={done:!1,value:c},f=e=>void 0===l?u:void 0===u||Math.abs(l-e)<Math.abs(u-e)?l:u;let m=s*n;const b=c+m,x=void 0===i?b:i(b);x!==b&&(m=x-c);const y=e=>-m*Math.exp(-e/a),g=e=>{const t=y(e);p.done=Math.abs(t)<=d,p.value=p.done?x:x+t};let M,h;const D=t=>{var n;((n=p.value)<l||n>u)&&(M=t,h=e.spring({keyframes:[p.value,f(p.value)],velocity:-y(t)/a*1e3,damping:o,stiffness:r,restDelta:d,restSpeed:v}))};return D(0),{calculatedDuration:null,next:e=>{let t=!1;return h||void 0!==M||(t=!0,g(e),D(e)),void 0!==M&&e>=M?h.next(e-M):(!t&&g(e),p)}}};
2
2
  //# sourceMappingURL=inertia.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inertia.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/inertia.mjs"],"sourcesContent":["import { spring } from './spring.mjs';\nimport { getGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: getGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n"],"names":["inertia","keyframes","velocity","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","min","max","restDelta","restSpeed","origin","state","done","value","nearestBoundary","v","undefined","Math","abs","amplitude","ideal","target","calcDelta","t","exp","calcLatest","applyFriction","delta","latest","timeReachedBoundary","spring","checkCatchBoundary","getGeneratorVelocity","damping","stiffness","calculatedDuration","next","hasUpdatedFrame"],"mappings":"0JAQgBA,UAAQC,UACpBA,EACAC,SAAAA,EAAW,EAAGC,MACdA,EAAQ,GAAGC,aACXA,EAAe,IAAGC,cAClBA,EAAgB,GAAEC,gBAClBA,EAAkB,IAAGC,aACrBA,EAAYC,IACZA,EAAGC,IACHA,EAAGC,UACHA,EAAY,GAAGC,UACfA,IAEA,MAAMC,EAASX,EAAU,GAEnBY,EAAgC,CAClCC,MAAM,EACNC,MAAOH,GAMLI,EAAmBC,QACTC,IAARV,EAA0BC,OAClBS,IAART,GAEGU,KAAKC,IAAIZ,EAAMS,GAAKE,KAAKC,IAAIX,EAAMQ,GAFZT,EAEuBC,EAGzD,IAAIY,EAAYlB,EAAQD,EACxB,MAAMoB,EAAQV,EAASS,EACjBE,OAA0BL,IAAjBX,EAA6Be,EAAQf,EAAae,GAM7DC,IAAWD,IAAOD,EAAYE,EAASX,GAE3C,MAAMY,EAAaC,IAAeJ,EAAYF,KAAKO,KAAKD,EAAIrB,GAEtDuB,EAAcF,GAAcF,EAASC,EAAUC,GAE/CG,EAAiBH,IACnB,MAAMI,EAAQL,EAAUC,GAClBK,EAASH,EAAWF,GAC1BZ,EAAMC,KAAOK,KAAKC,IAAIS,IAAUnB,EAChCG,EAAME,MAAQF,EAAMC,KAAOS,EAASO,GASxC,IAAIC,EACAC,EAEJ,MAAMC,EAAsBR,IAxCLR,SAyCAJ,EAAME,WAxChBG,IAARV,GAAqBS,EAAIT,QAAiBU,IAART,GAAqBQ,EAAIR,KA0C5DsB,EAAsBN,EAEtBO,EAASA,EAAAA,OAAa,CAClB/B,UAAW,CAACY,EAAME,MAAOC,EAAgBH,EAAME,QAC/Cb,SAAUgC,EAAAA,qBAAqBP,EAAYF,EAAGZ,EAAME,OACpDoB,QAAS9B,EACT+B,UAAW9B,EACXI,YACAC,gBAMR,OAFAsB,EAAmB,GAEZ,CACHI,mBAAoB,KACpBC,KAAOb,IAOH,IAAIc,GAAkB,EAWtB,OAVKP,QAAkCd,IAAxBa,IACXQ,GAAkB,EAClBX,EAAcH,GACdQ,EAAmBR,SAOKP,IAAxBa,GAAqCN,GAAKM,EACnCC,EAAQM,KAAKb,EAAIM,KAEvBQ,GAAmBX,EAAcH,GAC3BZ,IAIvB"}
1
+ {"version":3,"file":"inertia.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/inertia.mjs"],"sourcesContent":["import { spring } from './spring.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => v < min || v > max;\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : target + delta;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n /**\n * The friction curve is target + calcDelta(t), so its exact\n * derivative is -calcDelta(t) / timeConstant in units/ms,\n * converted here to the units/second expected by spring.\n */\n velocity: (-calcDelta(t) / timeConstant) * 1000,\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n"],"names":["inertia","keyframes","velocity","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","min","max","restDelta","restSpeed","origin","state","done","value","nearestBoundary","v","undefined","Math","abs","amplitude","ideal","target","calcDelta","t","exp","applyFriction","delta","timeReachedBoundary","spring","checkCatchBoundary","damping","stiffness","calculatedDuration","next","hasUpdatedFrame"],"mappings":"qHAOgBA,UAAQC,UACpBA,EAASC,SACTA,EAAW,EAAGC,MACdA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";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/interpolate.mjs.js"),s=require("../keyframes/offsets/default.mjs.js"),t=require("../keyframes/offsets/time.mjs.js"),i=require("../../../../../motion-utils/dist/es/easing/utils/is-easing-array.mjs.js"),n=require("../../../../../motion-utils/dist/es/easing/utils/map.mjs.js"),r=require("../../../../../motion-utils/dist/es/easing/ease.mjs.js");function a(e,s){return e.map(()=>s||r.easeInOut).splice(0,e.length-1)}exports.defaultEasing=a,exports.keyframes=function({duration:r=300,keyframes:u,times:o,ease:l="easeInOut"}){const f=i.isEasingArray(l)?l.map(n.easingDefinitionToFunction):n.easingDefinitionToFunction(l),m={done:!1,value:u[0]},j=t.convertOffsetToTimes(o&&o.length===u.length?o:s.defaultOffset(u),r),d=e.interpolate(j,u,{ease:Array.isArray(f)?f:a(u,f)});return{calculatedDuration:r,next:e=>(m.value=d(e),m.done=e>=r,m)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/interpolate.mjs.js"),s=require("../../utils/mix/index.mjs.js"),i=require("../keyframes/offsets/default.mjs.js"),t=require("../keyframes/offsets/time.mjs.js"),n=require("../../../../../motion-utils/dist/es/easing/utils/is-easing-array.mjs.js"),r=require("../../../../../motion-utils/dist/es/easing/utils/map.mjs.js"),a=require("../../../../../motion-utils/dist/es/easing/ease.mjs.js"),o=require("../../../../../motion-utils/dist/es/global-config.mjs.js"),u=require("../../../../../motion-utils/dist/es/clamp.mjs.js");function l(e,s){return e.map(()=>s||a.easeInOut).splice(0,e.length-1)}exports.defaultEasing=l,exports.keyframes=function({duration:m=300,keyframes:f,times:j,ease:c="easeInOut"}){const d=n.isEasingArray(c)?c.map(r.easingDefinitionToFunction):r.easingDefinitionToFunction(c)||a.easeInOut,g={done:!1,value:f[0]};if(2===f.length&&!Array.isArray(d)&&(!j||2!==j.length||0===j[0]&&1===j[1])){const[e,i]=f,t=e===i?void 0:(o.MotionGlobalConfig.mix||s.mix)(e,i);return{calculatedDuration:m,next:e=>(g.value=t?t(d(m>0?u.clamp(0,1,e/m):1)):i,g.done=e>=m,g)}}const p=t.convertOffsetToTimes(j&&j.length===f.length?j:i.defaultOffset(f),m),y=e.interpolate(p,f,{ease:Array.isArray(d)?d:l(f,d)});return{calculatedDuration:m,next:e=>(g.value=y(e),g.done=e>=m,g)}};
2
2
  //# sourceMappingURL=keyframes.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyframes.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs"],"sourcesContent":["import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n"],"names":["defaultEasing","values","easing","map","easeInOut","splice","length","keyframes","duration","keyframeValues","times","ease","easingFunctions","isEasingArray","easingDefinitionToFunction","state","done","value","absoluteTimes","convertOffsetToTimes","defaultOffset","mapTimeToKeyframe","interpolate","Array","isArray","calculatedDuration","next","t"],"mappings":"qbAgBM,SAAUA,EACZC,EACAC,GAEA,OAAOD,EAAOE,IAAI,IAAMD,GAAUE,EAASA,WAAEC,OAAO,EAAGJ,EAAOK,OAAS,EAC3E,2CAEgBC,UAAyCC,SACrDA,EAAW,IACXD,UAAWE,EAAcC,MACzBA,EAAKC,KACLA,EAAO,cAMP,MAAMC,EAAkBC,gBAAcF,GAChCA,EAAKR,IAAIW,8BACTA,6BAA2BH,GAM3BI,EAA2B,CAC7BC,MAAM,EACNC,MAAOR,EAAe,IAMpBS,EAAgBC,EAAoBA,qBAGtCT,GAASA,EAAMJ,SAAWG,EAAeH,OACnCI,EACAU,gBAAcX,GACpBD,GAGEa,EAAoBC,EAAAA,YAAeJ,EAAeT,EAAgB,CACpEE,KAAMY,MAAMC,QAAQZ,GACdA,EACAZ,EAAcS,EAAgBG,KAGxC,MAAO,CACHa,mBAAoBjB,EACpBkB,KAAOC,IACHZ,EAAME,MAAQI,EAAkBM,GAChCZ,EAAMC,KAAOW,GAAKnB,EACXO,GAGnB"}
1
+ {"version":3,"file":"keyframes.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs"],"sourcesContent":["import { easeInOut, isEasingArray, easingDefinitionToFunction, MotionGlobalConfig, clamp } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { mix } from '../../utils/mix/index.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease) || easeInOut;\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Fast setup path for two keyframes one easing.\n */\n if (keyframeValues.length === 2 &&\n !Array.isArray(easingFunctions) &&\n (!times ||\n times.length !== 2 ||\n (times[0] === 0 && times[1] === 1))) {\n const [origin, target] = keyframeValues;\n const mixer = origin === target\n ? undefined\n : (MotionGlobalConfig.mix || mix)(origin, target);\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mixer\n ? mixer(easingFunctions(duration > 0 ? clamp(0, 1, t / duration) : 1))\n : target;\n state.done = t >= duration;\n return state;\n },\n };\n }\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n"],"names":["defaultEasing","values","easing","map","easeInOut","splice","length","keyframes","duration","keyframeValues","times","ease","easingFunctions","isEasingArray","easingDefinitionToFunction","state","done","value","Array","isArray","origin","target","mixer","undefined","MotionGlobalConfig","mix","calculatedDuration","next","t","clamp","absoluteTimes","convertOffsetToTimes","defaultOffset","mapTimeToKeyframe","interpolate"],"mappings":"mmBAmBM,SAAUA,EACZC,EACAC,GAEA,OAAOD,EAAOE,IAAI,IAAMD,GAAUE,EAASA,WAAEC,OAAO,EAAGJ,EAAOK,OAAS,EAC3E,2CAEgBC,UAAyCC,SACrDA,EAAW,IACXD,UAAWE,EAAcC,MACzBA,EACAC,KAAAA,EAAO,cAMP,MAAMC,EAAkBC,EAAAA,cAAcF,GAChCA,EAAKR,IAAIW,EAAAA,4BACTA,EAAAA,2BAA2BH,IAASP,EAAAA,UAMpCW,EAA2B,CAC7BC,MAAM,EACNC,MAAOR,EAAe,IAM1B,GAC8B,IAA1BA,EAAeH,SACdY,MAAMC,QAAQP,MACbF,GACmB,IAAjBA,EAAMJ,QACQ,IAAbI,EAAM,IAAyB,IAAbA,EAAM,IAC/B,CACE,MAAOU,EAAQC,GAAUZ,EACnBa,EACFF,IAAWC,OACLE,GACCC,qBAAmBC,KAAOA,EAAGA,KAAEL,EAAQC,GAElD,MAAO,CACHK,mBAAoBlB,EACpBmB,KAAOC,IACHb,EAAME,MAAQK,EACRA,EACIV,EACIJ,EAAW,EAAIqB,EAAAA,MAAM,EAAG,EAAGD,EAAIpB,GAAY,IAGnDa,EACNN,EAAMC,KAAOY,GAAKpB,EACXO,GAGnB,CAKA,MAAMe,EAAgBC,EAAoBA,qBAGtCrB,GAASA,EAAMJ,SAAWG,EAAeH,OACnCI,EACAsB,gBAAcvB,GACpBD,GAGEyB,EAAoBC,EAAAA,YAAeJ,EAAerB,EAAgB,CACpEE,KAAMO,MAAMC,QAAQP,GACdA,EACAZ,EAAcS,EAAgBG,KAGxC,MAAO,CACHc,mBAAoBlB,EACpBmB,KAAOC,IACHb,EAAME,MAAQgB,EAAkBL,GAChCb,EAAMC,KAAOY,GAAKpB,EACXO,GAGnB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../waapi/utils/linear.mjs.js"),s=require("./utils/calc-duration.mjs.js"),e=require("./utils/create-generator-easing.mjs.js"),n=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js"),o=require("../../../../../motion-utils/dist/es/clamp.mjs.js"),a=require("../../../../../motion-utils/dist/es/errors.mjs.js");const i=100,r=10,c=1,l=0,u=800,d=.3,M=.3,h={granular:.01,default:2},m={granular:.005,default:.5},p=.01,f=10,v=.05,g=1;function y(t,s){return t*Math.sqrt(1-s*s)}const x=.001;const j=["duration","bounce"],b=["stiffness","damping","mass"];function q(t,s){return s.some(s=>void 0!==t[s])}function T(t){let s={velocity:l,stiffness:i,damping:r,mass:c,isResolvedFromDuration:!1,...t};if(!q(t,b)&&q(t,j))if(s.velocity=0,t.visualDuration){const e=t.visualDuration,n=2*Math.PI/(1.2*e),a=n*n,i=2*o.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(a);s={...s,mass:c,stiffness:a,damping:i}}else{const e=function({duration:t=u,bounce:s=d,velocity:e=l,mass:M=c}){let h,m;a.warning(t<=n.secondsToMilliseconds(f),"Spring duration must be 10 seconds or less","spring-duration-limit");let j=1-s;j=o.clamp(v,g,j),t=o.clamp(p,f,n.millisecondsToSeconds(t)),j<1?(h=s=>{const n=s*j,o=n*t,a=n-e,i=y(s,j),r=Math.exp(-o);return x-a/i*r},m=s=>{const n=s*j*t,o=n*e+e,a=Math.pow(j,2)*Math.pow(s,2)*t,i=Math.exp(-n),r=y(Math.pow(s,2),j);return(-h(s)+x>0?-1:1)*((o-a)*i)/r}):(h=s=>Math.exp(-s*t)*((s-e)*t+1)-.001,m=s=>Math.exp(-s*t)*(t*t*(e-s)));const b=function(t,s,e){let n=e;for(let e=1;e<12;e++)n-=t(n)/s(n);return n}(h,m,5/t);if(t=n.secondsToMilliseconds(t),isNaN(b))return{stiffness:i,damping:r,duration:t};{const s=Math.pow(b,2)*M;return{stiffness:s,damping:2*j*Math.sqrt(M*s),duration:t}}}({...t,velocity:0});s={...s,...e,mass:c},s.isResolvedFromDuration=!0}return s}function D(e=M,o=d){const a="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:o}:e;let{restSpeed:i,restDelta:r}=a;const c=a.keyframes[0],l=a.keyframes[a.keyframes.length-1],u={done:!1,value:c},{stiffness:p,damping:f,mass:v,duration:g,velocity:x,isResolvedFromDuration:j}=T({...a,velocity:-n.millisecondsToSeconds(a.velocity||0)}),b=x||0,q=f/(2*Math.sqrt(p*v)),D=l-c,w=n.millisecondsToSeconds(Math.sqrt(p/v)),S=Math.abs(D)<5;let k,F,G,R,E,N;if(i||(i=S?h.granular:h.default),r||(r=S?m.granular:m.default),q<1)G=y(w,q),R=(b+q*w*D)/G,k=t=>{const s=Math.exp(-q*w*t);return l-s*(R*Math.sin(G*t)+D*Math.cos(G*t))},E=q*w*R+D*G,N=q*w*D-R*G,F=t=>Math.exp(-q*w*t)*(E*Math.sin(G*t)+N*Math.cos(G*t));else if(1===q){k=t=>l-Math.exp(-w*t)*(D+(b+w*D)*t);const t=b+w*D;F=s=>Math.exp(-w*s)*(w*t*s-b)}else{const t=w*Math.sqrt(q*q-1);k=s=>{const e=Math.exp(-q*w*s),n=Math.min(t*s,300);return l-e*((b+q*w*D)*Math.sinh(n)+t*D*Math.cosh(n))/t};const s=(b+q*w*D)/t,e=q*w*s-D*t,n=q*w*D-s*t;F=s=>{const o=Math.exp(-q*w*s),a=Math.min(t*s,300);return o*(e*Math.sinh(a)+n*Math.cosh(a))}}const O={calculatedDuration:j&&g||null,velocity:t=>n.secondsToMilliseconds(F(t)),next:t=>{if(!j&&q<1){const s=Math.exp(-q*w*t),e=Math.sin(G*t),o=Math.cos(G*t),a=l-s*(R*e+D*o),c=n.secondsToMilliseconds(s*(E*e+N*o));return u.done=Math.abs(c)<=i&&Math.abs(l-a)<=r,u.value=u.done?l:a,u}const s=k(t);if(j)u.done=t>=g;else{const e=n.secondsToMilliseconds(F(t));u.done=Math.abs(e)<=i&&Math.abs(l-s)<=r}return u.value=u.done?l:s,u},toString:()=>{const e=Math.min(s.calcGeneratorDuration(O),s.maxGeneratorDuration),n=t.generateLinearEasing(t=>O.next(e*t).value,e,30);return e+"ms "+n},toTransition:()=>{}};return O}D.applyToOptions=t=>{const s=e.createGeneratorEasing(t,100,D);return t.ease=s.ease,t.duration=n.secondsToMilliseconds(s.duration),t.type="keyframes",t},exports.spring=D;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../waapi/utils/linear.mjs.js"),t=require("./utils/calc-duration.mjs.js"),s=require("./utils/create-generator-easing.mjs.js"),n=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js"),a=require("../../../../../motion-utils/dist/es/errors.mjs.js"),i=require("../../../../../motion-utils/dist/es/clamp.mjs.js");const o=100,r=10,l=1,c=800,d=.3,u=.3,f={granular:.01,default:2},m={granular:.005,default:.5},p=.01,g=10,M=.05,h=e=>e<0?1/Math.max(1+e,M):Math.max(1-e,M);function v(e,t){if(!(e>1))return 1;const s=Math.sqrt(e*e-1),n=e-s,a=e+s,i=2*s*Math.exp(-t)*(1+t);return D(e=>a*Math.exp(-n*e)-n*Math.exp(-a*e)-i,e=>Math.exp(-a*e)-Math.exp(-n*e),t)/t}function x(e,t){return e*Math.sqrt(1-t*t)}const y=12;function D(e,t,s){let n=s;for(let s=1;s<y;s++)n-=e(n)/t(n);return n}const j=.001;const S=(e,t)=>(t?e>=0:e>0)&&e<1/0;function b(e,t){if(S(e,t))return e;"production"!==process.env.NODE_ENV&&a.warning(void 0===e,"Spring stiffness and mass must be positive, damping 0 or greater","spring-invalid-physics")}function q(e){const t=b(e.stiffness),s=b(e.damping,!0),u=b(e.mass),f={...e,stiffness:t??o,damping:s??r,mass:u??l,isResolvedFromDuration:!1,isTimeDefined:void 0===(t??s??u)&&(void 0!==e.duration||void 0!==e.bounce)};if(f.isTimeDefined){if(e.visualDuration){const t=h(e.bounce||0),s=2*Math.PI/(1.2*e.visualDuration)*v(t,2*Math.PI/1.2);f.stiffness=s*s,f.damping=2*t*Math.sqrt(f.stiffness)}else Object.assign(f,function({duration:e=c,bounce:t=d}){let s,o;a.warning(e<=n.secondsToMilliseconds(g),"Spring duration must be 10 seconds or less","spring-duration-limit");const r=h(t);e=i.clamp(p,g,n.millisecondsToSeconds(e)),r<1?(s=t=>{const s=t*r,n=s*e,a=x(t,r),i=Math.exp(-n);return j-s/a*i},o=t=>{const n=t*r*e,a=r*r*t*t*e,i=Math.exp(-n),o=x(t*t,r);return(-s(t)+j>0?-1:1)*-a*i/o}):(s=t=>Math.exp(-t*e)*(t*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*-t));const l=D(s,o,5/e),u=l*v(r,l*e),f=u*u;return{stiffness:f,damping:2*r*Math.sqrt(f),duration:n.secondsToMilliseconds(e)}}(f)),f.isResolvedFromDuration=!0;S(f.stiffness)&&S(f.damping,!0)||(f.stiffness=o,f.damping=r)}return f}function T(s=u,a=d){const i="object"!=typeof s?{visualDuration:s,keyframes:[0,1],bounce:a}:s,o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],l={done:!1,value:o},{stiffness:c,damping:p,mass:g,duration:M,isResolvedFromDuration:h,isTimeDefined:v}=q({...i}),y=e=>v?0:-n.millisecondsToSeconds(e),D=p/(2*Math.sqrt(c*g)),j=n.millisecondsToSeconds(Math.sqrt(c/g)),S=D*j,b={target:r,delta:r-o,velocity:y(i.velocity||0)||0,restSpeed:0,restDelta:0},T=()=>{const e=Math.abs(b.delta)<5;b.restSpeed=i.restSpeed||(e?f.granular:f.default),b.restDelta=i.restDelta||(e?m.granular:m.default)};let C,F,k;if(T(),D<1){const e=x(j,D),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};k=()=>{t.A=(b.velocity+S*b.delta)/e,t.sinC=S*t.A+b.delta*e,t.cosC=S*b.delta-t.A*e};const s=s=>{s!==t.t&&(t.t=s,t.env=Math.exp(-S*s),t.sin=Math.sin(e*s),t.cos=Math.cos(e*s))};C=e=>(s(e),b.target-t.env*(t.A*t.sin+b.delta*t.cos)),F=e=>(s(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(1===D){C=e=>b.target-Math.exp(-j*e)*(b.delta+(b.velocity+j*b.delta)*e);const e={C:0};k=()=>{e.C=b.velocity+j*b.delta},F=t=>Math.exp(-j*t)*(j*e.C*t-b.velocity)}else{const e=j*Math.sqrt(D*D-1),t=S-e,s=S+e,n=v?1/0:300/e,a=(e,t)=>Math.exp(t>n?-e*n-S*(t-n):-e*t),i={S:0,F:0};k=()=>{const t=(b.velocity+S*b.delta)/e;i.S=(b.delta+t)/2,i.F=(b.delta-t)/2},C=e=>b.target-i.S*a(t,e)-i.F*a(s,e),F=e=>t*i.S*a(t,e)+s*i.F*a(s,e)}k();const A=h&&M||null,O={calculatedDuration:A,retarget:(e,t)=>{b.target=e[e.length-1],b.delta=b.target-e[0],b.velocity=y(t),i.restSpeed&&i.restDelta||T(),O.calculatedDuration=A,l.done=!1,k()},velocity:e=>n.secondsToMilliseconds(F(e)),next:e=>{const t=C(e);if(h)l.done=e>=M;else{const s=n.secondsToMilliseconds(F(e));l.done=Math.abs(s)<=b.restSpeed&&Math.abs(b.target-t)<=b.restDelta}return l.value=l.done?b.target:t,l},toString:()=>{const s=Math.min(t.calcGeneratorDuration(O),t.maxGeneratorDuration),n=e.generateLinearEasing(e=>O.next(s*e).value,s,30);return s+"ms "+n},toTransition:()=>{}};return O}const C=Object.assign(T,{applyToOptions:e=>{const t=s.createGeneratorEasing(e,100,T);return e.ease=t.ease,e.duration=n.secondsToMilliseconds(t.duration),e.type="keyframes",e}});exports.spring=C;
2
2
  //# sourceMappingURL=spring.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spring.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/spring.mjs"],"sourcesContent":["import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils';\nimport { generateLinearEasing } from '../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';\nimport { createGeneratorEasing } from './utils/create-generator-easing.mjs';\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n // Time-defined springs should ignore inherited velocity.\n // Velocity from interrupted animations can cause findSpring()\n // to compute wildly different spring parameters, leading to\n // massive oscillation on small-range animations.\n springOptions.velocity = 0;\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring({ ...options, velocity: 0 });\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n let resolveVelocity;\n // Underdamped coefficients, hoisted for use in the inlined next() hot path\n let angularFreq;\n let A;\n let sinCoeff;\n let cosCoeff;\n if (dampingRatio < 1) {\n angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n A =\n (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq;\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (A * Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n // Analytical derivative of underdamped spring (px/ms)\n sinCoeff =\n dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq;\n cosCoeff =\n dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return envelope *\n (sinCoeff * Math.sin(angularFreq * t) +\n cosCoeff * Math.cos(angularFreq * t));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const C = initialVelocity + undampedAngularFreq * initialDelta;\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * C * t - initialVelocity);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n // Analytical derivative of overdamped spring (px/ms)\n const P = (initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n dampedAngularFreq;\n const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq;\n const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq;\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return envelope *\n (sinhCoeff * Math.sinh(freqForT) +\n coshCoeff * Math.cosh(freqForT));\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n /**\n * For underdamped physics springs we need both position and\n * velocity each tick. Compute shared trig values once to avoid\n * duplicate Math.exp/sin/cos calls on the hot path.\n */\n if (!isResolvedFromDuration && dampingRatio < 1) {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const sin = Math.sin(angularFreq * t);\n const cos = Math.cos(angularFreq * t);\n const current = target -\n envelope *\n (A * sin + initialDelta * cos);\n const currentVelocity = secondsToMilliseconds(envelope *\n (sinCoeff * sin + cosCoeff * cos));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n state.value = state.done ? target : current;\n return state;\n }\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= restSpeed &&\n Math.abs(target - current) <= restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=spring.mjs.map\n"],"names":["springDefaults","granular","default","calcAngularFreq","undampedFreq","dampingRatio","Math","sqrt","safeMin","durationKeys","physicsKeys","isSpringType","options","keys","some","key","undefined","getSpringOptions","springOptions","velocity","stiffness","damping","mass","isResolvedFromDuration","visualDuration","root","PI","clamp","bounce","derived","duration","envelope","derivative","warning","secondsToMilliseconds","millisecondsToSeconds","exponentialDecay","delta","a","b","c","exp","d","e","pow","f","g","initialGuess","result","i","approximateRoot","isNaN","findSpring","spring","optionsOrVisualDuration","keyframes","restSpeed","restDelta","origin","target","length","state","done","value","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","abs","resolveSpring","resolveVelocity","angularFreq","A","sinCoeff","cosCoeff","t","sin","cos","C","dampedAngularFreq","freqForT","min","sinh","cosh","P","sinhCoeff","coshCoeff","generator","calculatedDuration","next","current","currentVelocity","toString","calcGeneratorDuration","maxGeneratorDuration","easing","generateLinearEasing","progress","toTransition","applyToOptions","generatorOptions","createGeneratorEasing","ease","type"],"mappings":"qZAoBA,MAAMA,EAES,IAFTA,EAGO,GAHPA,EAII,EAJJA,EAKQ,EALRA,EAQQ,IARRA,EASM,GATNA,EAUc,GAVdA,EAaS,CACPC,SAAU,IACVC,QAAS,GAfXF,EAiBS,CACPC,SAAU,KACVC,QAAS,IAnBXF,EAuBW,IAvBXA,EAwBW,GAxBXA,EAyBU,IAzBVA,EA0BU,EAGhB,SAASG,EAAgBC,EAAsBC,GAC3C,OAAOD,EAAeE,KAAKC,KAAK,EAAIF,EAAeA,EACvD,CAkBA,MAAMG,EAAU,KA8FhB,MAAMC,EAAe,CAAC,WAAY,UAC5BC,EAAc,CAAC,YAAa,UAAW,QAE7C,SAASC,EAAaC,EAAwBC,GAC1C,OAAOA,EAAKC,KAAMC,QAAkCC,IAAzBJ,EAAgBG,GAC/C,CAEA,SAASE,EAAiBL,GACtB,IAAIM,EAAgB,CAChBC,SAAUnB,EACVoB,UAAWpB,EACXqB,QAASrB,EACTsB,KAAMtB,EACNuB,wBAAwB,KACrBX,GAGP,IACKD,EAAaC,EAASF,IACvBC,EAAaC,EAASH,GAQtB,GAFAS,EAAcC,SAAW,EAErBP,EAAQY,eAAgB,CACxB,MAAMA,EAAiBZ,EAAQY,eACzBC,EAAQ,EAAInB,KAAKoB,IAAwB,IAAjBF,GACxBJ,EAAYK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,qBACVC,GACGV,EAAUE,KAAKD,EAAqBS,GAAUlC,MAClDyB,EACA,IAGJ,OAAOA,EAAqB,MAAQO,GAExCG,aAAcA,QAGlB,OAAOX,CACX,CAEAlC,EAAO8C,eAAkBvF,IACrB,MAAMwF,EAAmBC,EAAqBA,sBAACzF,EAAgB,IAAKyC,GAKpE,OAHAzC,EAAQ0F,KAAOF,EAAiBE,KAChC1F,EAAQkB,SAAWI,EAAAA,sBAAsBkE,EAAiBtE,UAC1DlB,EAAQ2F,KAAO,YACR3F"}
1
+ {"version":3,"file":"spring.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/spring.mjs"],"sourcesContent":["import { secondsToMilliseconds, millisecondsToSeconds, warning, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';\nimport { createGeneratorEasing } from './utils/create-generator-easing.mjs';\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n};\n/**\n * Maps bounce to a damping ratio as SwiftUI does: 0 is critically damped, and\n * it approaches undamped towards 1 and infinitely overdamped towards -1. Both\n * ends are limited so the spring still moves and settles.\n */\nconst bounceToDampingRatio = (bounce) => bounce < 0\n ? 1 / Math.max(1 + bounce, springDefaults.minDamping)\n : Math.max(1 - bounce, springDefaults.minDamping);\n/**\n * Scales an overdamped spring's undamped frequency so that, at its defining\n * time, it has as far left to go as the critically damped spring that's\n * criticalFreqTime radians in by then. A negative bounce then changes the\n * shape of the curve, not when it arrives. 1 at a damping ratio of 1, so\n * there's no jump at a bounce of 0.\n *\n * Solved by Newton on the remaining distance (times fast - slow), which is\n * convex from criticalFreqTime onwards. criticalFreqTime is always below the\n * answer, so it converges from below without overshooting.\n */\nfunction overdampedFreqScale(dampingRatio, criticalFreqTime) {\n if (!(dampingRatio > 1))\n return 1;\n const root = Math.sqrt(dampingRatio * dampingRatio - 1);\n const slow = dampingRatio - root;\n const fast = dampingRatio + root;\n const target = 2 * root * Math.exp(-criticalFreqTime) * (1 + criticalFreqTime);\n return (approximateRoot((freqTime) => fast * Math.exp(-slow * freqTime) -\n slow * Math.exp(-fast * freqTime) -\n target, (freqTime) => Math.exp(-fast * freqTime) - Math.exp(-slow * freqTime), criticalFreqTime) / criticalFreqTime);\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001;\n/**\n * Assumes zero initial velocity and the default mass: time-defined springs\n * ignore inherited velocity and only resolve without valid physics. Returns\n * NaN physics when the root search doesn't converge.\n */\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n const dampingRatio = bounceToDampingRatio(bounce);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (exponentialDecay / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const e = dampingRatio *\n dampingRatio *\n undampedFreq *\n undampedFreq *\n duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(undampedFreq * undampedFreq, dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * -e * f) / g;\n };\n }\n else {\n /**\n * Critically-damped spring. Overdamped springs reuse this root,\n * scaled below.\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = undampedFreq * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = -undampedFreq * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const criticalFreq = approximateRoot(envelope, derivative, initialGuess);\n const undampedFreq = criticalFreq *\n overdampedFreqScale(dampingRatio, criticalFreq * duration);\n const stiffness = undampedFreq * undampedFreq;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(stiffness),\n duration: secondsToMilliseconds(duration),\n };\n}\n/**\n * Spring physics must be finite. stiffness and mass are also divisors so must\n * be positive, whereas a damping of 0 is a valid, perpetually oscillating\n * spring. Relational rather than Number.isFinite so numeric strings still\n * coerce.\n */\nconst isValidPhysics = (value, canBeZero) => (canBeZero ? value >= 0 : value > 0) && value < Infinity;\n/**\n * Returns value if it's usable spring physics, otherwise undefined so callers\n * fall back to the default. An explicit `undefined`, e.g. from a forwarded\n * optional prop, must fall back too. Invalid physics would otherwise resolve\n * to NaN spring values that never report done.\n */\nfunction resolvePhysics(value, canBeZero) {\n if (isValidPhysics(value, canBeZero))\n return value;\n if (process.env.NODE_ENV !== \"production\") {\n warning(value === undefined, \"Spring stiffness and mass must be positive, damping 0 or greater\", \"spring-invalid-physics\");\n }\n return undefined;\n}\nfunction getSpringOptions(options) {\n /**\n * Resolve physics before choosing between physics- and duration-based\n * resolution, so an invalid stiffness doesn't also silently discard a\n * valid duration/bounce.\n */\n const validStiffness = resolvePhysics(options.stiffness);\n const validDamping = resolvePhysics(options.damping, true);\n const validMass = resolvePhysics(options.mass);\n const springOptions = {\n ...options,\n stiffness: validStiffness ?? springDefaults.stiffness,\n damping: validDamping ?? springDefaults.damping,\n mass: validMass ?? springDefaults.mass,\n isResolvedFromDuration: false,\n // stiffness/damping/mass overrides duration/bounce\n isTimeDefined: (validStiffness ?? validDamping ?? validMass) === undefined &&\n (options.duration !== undefined || options.bounce !== undefined),\n };\n if (springOptions.isTimeDefined) {\n if (options.visualDuration) {\n const dampingRatio = bounceToDampingRatio(options.bounce || 0);\n const root = ((2 * Math.PI) / (options.visualDuration * 1.2)) *\n overdampedFreqScale(dampingRatio, (2 * Math.PI) / 1.2);\n springOptions.stiffness = root * root;\n springOptions.damping =\n 2 * dampingRatio * Math.sqrt(springOptions.stiffness);\n }\n else {\n Object.assign(springOptions, findSpring(springOptions));\n springOptions.isResolvedFromDuration = true;\n }\n /**\n * Time options can degenerate: a NaN bounce gives a NaN damping, an\n * infinite visualDuration a 0 stiffness, and findSpring NaN for both\n * when it doesn't converge. Replace the two together, so the\n * relationship duration resolution establishes between them is never\n * left half-overwritten.\n */\n if (!isValidPhysics(springOptions.stiffness) ||\n !isValidPhysics(springOptions.damping, true)) {\n springOptions.stiffness = springDefaults.stiffness;\n springOptions.damping = springDefaults.damping;\n }\n }\n return springOptions;\n}\nfunction springGenerator(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, isResolvedFromDuration, isTimeDefined, } = getSpringOptions({ ...options });\n /**\n * Time-defined springs ignore inherited velocity. Velocity from\n * interrupted animations causes massive oscillation on small-range\n * animations.\n */\n const inheritVelocity = (velocity) => isTimeDefined ? 0 : -millisecondsToSeconds(velocity);\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n const decay = dampingRatio * undampedAngularFreq;\n /**\n * Everything that changes when the spring is retargeted: written by\n * retarget() and update(), read by the resolvers. Grouped on one object,\n * like the coefficients (c) below. Writing doubles to object fields\n * measured marginally faster than to captured let variables in optimised\n * code; neither allocates, so this is a grouping choice, not a GC one.\n */\n const s = {\n target,\n delta: target - origin,\n velocity: inheritVelocity(options.velocity || 0) || 0,\n restSpeed: 0,\n restDelta: 0,\n };\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected empirically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const setRestThresholds = () => {\n const isGranularScale = Math.abs(s.delta) < 5;\n s.restSpeed =\n options.restSpeed ||\n (isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n s.restDelta =\n options.restDelta ||\n (isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n };\n setRestThresholds();\n let resolveSpring;\n let resolveVelocity;\n /**\n * Derives the coefficients that depend on origin, target and initial\n * velocity. Called once now and again whenever the spring is retargeted.\n */\n let update;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n /**\n * A is the position coefficient, sinC/cosC the coefficients of the\n * analytical derivative (px/ms). The exp/sin/cos terms depend only\n * on t, so they're memoized by t independently of the target: a\n * spring retargeted every frame samples the same t each frame and\n * skips the transcendentals entirely.\n */\n const c = { A: 0, sinC: 0, cosC: 0, t: -1, env: 0, sin: 0, cos: 0 };\n update = () => {\n c.A = (s.velocity + decay * s.delta) / angularFreq;\n c.sinC = decay * c.A + s.delta * angularFreq;\n c.cosC = decay * s.delta - c.A * angularFreq;\n };\n const sample = (t) => {\n if (t !== c.t) {\n c.t = t;\n c.env = Math.exp(-decay * t);\n c.sin = Math.sin(angularFreq * t);\n c.cos = Math.cos(angularFreq * t);\n }\n };\n // Underdamped spring\n resolveSpring = (t) => {\n sample(t);\n return s.target - c.env * (c.A * c.sin + s.delta * c.cos);\n };\n resolveVelocity = (t) => {\n sample(t);\n return c.env * (c.sinC * c.sin + c.cosC * c.cos);\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => s.target -\n Math.exp(-undampedAngularFreq * t) *\n (s.delta + (s.velocity + undampedAngularFreq * s.delta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const c = { C: 0 };\n update = () => {\n c.C = s.velocity + undampedAngularFreq * s.delta;\n };\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * c.C * t - s.velocity);\n }\n else {\n /**\n * Overdamped spring: the sum of a slow and a fast decaying\n * exponential, so no term can overflow however heavily it's damped.\n */\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n const slow = decay - dampedAngularFreq;\n const fast = decay + dampedAngularFreq;\n /**\n * Physics-defined springs keep a non-physical limit: once\n * dampedAngularFreq * t passes 300, both terms decay at the damping\n * rate. Heavily overdamped drag springs (dragElastic: 0,\n * dragTransition) rely on this to settle almost at once rather than\n * creep at stiffness / damping. Negative bounce needs the exact\n * curve, so time-defined springs are exempt.\n */\n const limit = isTimeDefined ? Infinity : 300 / dampedAngularFreq;\n const decayAt = (rate, t) => Math.exp(t > limit ? -rate * limit - decay * (t - limit) : -rate * t);\n const c = { S: 0, F: 0 };\n update = () => {\n const P = (s.velocity + decay * s.delta) / dampedAngularFreq;\n c.S = (s.delta + P) / 2;\n c.F = (s.delta - P) / 2;\n };\n resolveSpring = (t) => s.target - c.S * decayAt(slow, t) - c.F * decayAt(fast, t);\n // Analytical derivative of overdamped spring (px/ms)\n resolveVelocity = (t) => slow * c.S * decayAt(slow, t) + fast * c.F * decayAt(fast, t);\n }\n update();\n const calculatedDuration = isResolvedFromDuration ? duration || null : null;\n const generator = {\n calculatedDuration,\n /**\n * Aim the spring at a new target from its current position and\n * velocity, reusing the resolved physics and closures.\n */\n retarget: (keyframes, newVelocity) => {\n s.target = keyframes[keyframes.length - 1];\n s.delta = s.target - keyframes[0];\n s.velocity = inheritVelocity(newVelocity);\n // Default thresholds depend on the scale of the new delta\n if (!(options.restSpeed && options.restDelta))\n setRestThresholds();\n // Invalidate any duration lazily cached by JSAnimation\n generator.calculatedDuration = calculatedDuration;\n state.done = false;\n update();\n },\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= s.restSpeed &&\n Math.abs(s.target - current) <= s.restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? s.target : current;\n return state;\n },\n toString: () => {\n const easingDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(easingDuration * progress).value, easingDuration, 30);\n return easingDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nconst spring = /* @__PURE__ */ Object.assign(springGenerator, {\n applyToOptions: (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, springGenerator);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n },\n});\n\nexport { spring };\n//# sourceMappingURL=spring.mjs.map\n"],"names":["springDefaults","granular","default","bounceToDampingRatio","bounce","Math","max","overdampedFreqScale","dampingRatio","criticalFreqTime","root","sqrt","slow","fast","target","exp","approximateRoot","freqTime","calcAngularFreq","undampedFreq","rootIterations","envelope","derivative","initialGuess","result","i","safeMin","isValidPhysics","value","canBeZero","Infinity","resolvePhysics","process","env","NODE_ENV","warning","undefined","getSpringOptions","options","validStiffness","stiffness","validDamping","damping","validMass","mass","springOptions","isResolvedFromDuration","isTimeDefined","duration","visualDuration","PI","Object","assign","secondsToMilliseconds","clamp","millisecondsToSeconds","exponentialDecay","delta","b","c","e","f","g","criticalFreq","findSpring","springGenerator","optionsOrVisualDuration","keyframes","origin","length","state","done","inheritVelocity","velocity","undampedAngularFreq","decay","s","restSpeed","restDelta","setRestThresholds","isGranularScale","abs","resolveSpring","resolveVelocity","update","angularFreq","A","sinC","cosC","t","sin","cos","sample","C","dampedAngularFreq","limit","decayAt","rate","S","F","P","calculatedDuration","generator","retarget","newVelocity","next","current","currentVelocity","toString","easingDuration","min","calcGeneratorDuration","maxGeneratorDuration","easing","generateLinearEasing","progress","toTransition","spring","applyToOptions","generatorOptions","createGeneratorEasing","ease","type"],"mappings":"qZAoBA,MAAMA,EAES,IAFTA,EAGO,GAHPA,EAII,EAJJA,EAOQ,IAPRA,EAQM,GARNA,EASc,GATdA,EAYS,CACPC,SAAU,IACVC,QAAS,GAdXF,EAgBS,CACPC,SAAU,KACVC,QAAS,IAlBXF,EAsBW,IAtBXA,EAuBW,GAvBXA,EAwBU,IAQVG,EAAwBC,GAC1BA,EAAS,EACH,EAAIC,KAAKC,IAAI,EAAIF,EAAQJ,GACzBK,KAAKC,IAAI,EAAIF,EAAQJ,GAa/B,SAASO,EAAoBC,EAAsBC,GAC/C,KAAMD,EAAe,GAAI,OAAO,EAEhC,MAAME,EAAOL,KAAKM,KAAKH,EAAeA,EAAe,GAC/CI,EAAOJ,EAAeE,EACtBG,EAAOL,EAAeE,EACtBI,EACF,EAAIJ,EAAOL,KAAKU,KAAKN,IAAqB,EAAIA,GAElD,OACIO,EACKC,GACGJ,EAAOR,KAAKU,KAAKH,EAAOK,GACxBL,EAAOP,KAAKU,KAAKF,EAAOI,GACxBH,EACHG,GACGZ,KAAKU,KAAKF,EAAOI,GAAYZ,KAAKU,KAAKH,EAAOK,GAClDR,GACAA,CAEZ,CA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,IACb,MAAMiF,EAAmBC,EAAqBA,sBAC1ClF,EACA,IACA2B,GAMJ,OAHA3B,EAAQmF,KAAOF,EAAiBE,KAChCnF,EAAQU,SAAWK,EAAAA,sBAAsBkE,EAAiBvE,UAC1DV,EAAQoF,KAAO,YACRpF"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=2e4;exports.calcGeneratorDuration=function(t){let r=0,o=t.next(r);for(;!o.done&&r<e;)r+=50,o=t.next(r);return r>=e?1/0:r},exports.maxGeneratorDuration=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.calcGeneratorDuration=function(e,t=50,r=2e4,o){let n=0,u=e.next(n);for(o?.push(u.value);!u.done&&n<r;)n+=t,u=e.next(n),o?.push(u.value);return n>=r?1/0:n},exports.maxGeneratorDuration=2e4;
2
2
  //# sourceMappingURL=calc-duration.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calc-duration.mjs.js","sources":["../../../../../../../../node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs"],"sourcesContent":["/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n"],"names":["maxGeneratorDuration","generator","duration","state","next","done","Infinity"],"mappings":"oEAMO,MAAMA,EAAuB,kCAC9B,SACFC,GAEA,IAAIC,EAAW,EAEXC,EAAQF,EAAUG,KAAKF,GAC3B,MAAQC,EAAME,MAAQH,EAAWF,GAC7BE,GAHa,GAIbC,EAAQF,EAAUG,KAAKF,GAG3B,OAAOA,GAAYF,EAAuBM,IAAWJ,CACzD"}
1
+ {"version":3,"file":"calc-duration.mjs.js","sources":["../../../../../../../../node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs"],"sourcesContent":["/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator, timeStep = 50, maxDuration = maxGeneratorDuration, keyframes) {\n let duration = 0;\n let state = generator.next(duration);\n keyframes?.push(state.value);\n while (!state.done && duration < maxDuration) {\n duration += timeStep;\n state = generator.next(duration);\n keyframes?.push(state.value);\n }\n return duration >= maxDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n"],"names":["generator","timeStep","maxDuration","keyframes","duration","state","next","push","value","done","Infinity"],"mappings":"kGAQM,SACFA,EACAC,EAAW,GACXC,EALgC,IAMhCC,GAEA,IAAIC,EAAW,EACXC,EAAQL,EAAUM,KAAKF,GAG3B,IAFAD,GAAWI,KAAKF,EAAMG,QAEdH,EAAMI,MAAQL,EAAWF,GAC7BE,GAAYH,EACZI,EAAQL,EAAUM,KAAKF,GACvBD,GAAWI,KAAKF,EAAMG,OAG1B,OAAOJ,GAAYF,EAAcQ,IAAWN,CAChD,+BAnBoC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./calc-duration.mjs.js"),r=require("../../../../../../motion-utils/dist/es/time-conversion.mjs.js");exports.createGeneratorEasing=function(t,s=100,n){const o=n({...t,keyframes:[0,s]}),a=Math.min(e.calcGeneratorDuration(o),e.maxGeneratorDuration);return{type:"keyframes",ease:e=>o.next(a*e).value/s,duration:r.millisecondsToSeconds(a)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./calc-duration.mjs.js"),r=require("../../../../../../motion-utils/dist/es/time-conversion.mjs.js");exports.createGeneratorEasing=function(t,o=100,s){const{keyframes:n,velocity:a}=t,i=n&&n[n.length-1]-n[0],c=s({...t,velocity:a&&i?a*o/i:a,keyframes:[0,o]}),u=Math.min(e.calcGeneratorDuration(c),e.maxGeneratorDuration);return{type:"keyframes",ease:e=>c.next(u*e).value/o,duration:r.millisecondsToSeconds(u)}};
2
2
  //# sourceMappingURL=create-generator-easing.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-generator-easing.mjs.js","sources":["../../../../../../../../node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs"],"sourcesContent":["import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n"],"names":["options","scale","createGenerator","generator","keyframes","duration","Math","min","calcGeneratorDuration","maxGeneratorDuration","type","ease","progress","next","value","millisecondsToSeconds"],"mappings":"qNAOM,SACFA,EACAC,EAAQ,IACRC,GAEA,MAAMC,EAAYD,EAAgB,IAAKF,EAASI,UAAW,CAAC,EAAGH,KACzDI,EAAWC,KAAKC,IAClBC,EAAqBA,sBAACL,GACtBM,EAAAA,sBAGJ,MAAO,CACHC,KAAM,YACNC,KAAOC,GACIT,EAAUU,KAAKR,EAAWO,GAAUE,MAAQb,EAEvDI,SAAUU,EAAqBA,sBAACV,GAExC"}
1
+ {"version":3,"file":"create-generator-easing.mjs.js","sources":["../../../../../../../../node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs"],"sourcesContent":["import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n /**\n * The easing is generated over 0 - scale, but velocity is in the\n * value's own units, so scale it to match. Otherwise an interrupted\n * spring hands off the wrong speed, or direction. Keyframes with\n * units (colours, filters, mixed units) give NaN, which is falsy,\n * so their velocity passes through unscaled.\n */\n const { keyframes: k, velocity: v } = options;\n const delta = k && k[k.length - 1] - k[0];\n const generator = createGenerator({\n ...options,\n velocity: v && delta ? (v * scale) / delta : v,\n keyframes: [0, scale],\n });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n"],"names":["options","scale","createGenerator","keyframes","k","velocity","v","delta","length","generator","duration","Math","min","calcGeneratorDuration","maxGeneratorDuration","type","ease","progress","next","value","millisecondsToSeconds"],"mappings":"qNAOM,SACFA,EACAC,EAAQ,IACRC,GASA,MAAQC,UAAWC,EAAGC,SAAUC,GAAMN,EAChCO,EAAQH,GAAKA,EAAEA,EAAEI,OAAS,GAAKJ,EAAE,GAEjCK,EAAYP,EAAgB,IAC3BF,EACHK,SAAUC,GAAKC,EAASD,EAAIL,EAASM,EAAQD,EAC7CH,UAAW,CAAC,EAAGF,KAEbS,EAAWC,KAAKC,IAClBC,EAAqBA,sBAACJ,GACtBK,EAAAA,sBAGJ,MAAO,CACHC,KAAM,YACNC,KAAOC,GACIR,EAAUS,KAAKR,EAAWO,GAAUE,MAAQlB,EAEvDS,SAAUU,EAAqBA,sBAACV,GAExC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../motion-utils/dist/es/velocity-per-second.mjs.js");exports.getGeneratorVelocity=function(t,o,r){const s=Math.max(o-5,0);return e.velocityPerSecond(r-t(s),o-s)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../motion-utils/dist/es/velocity-per-second.mjs.js");function t(t,o,r){const c=Math.max(o-5,0);return e.velocityPerSecond(r-t(c),o-c)}exports.calcGeneratorVelocity=function(e,o,r=0){return o<=0?r:e.velocity?e.velocity(o):t(t=>e.next(t).value,o,e.next(o).value)},exports.getGeneratorVelocity=t;
2
2
  //# sourceMappingURL=velocity.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"velocity.mjs.js","sources":["../../../../../../../../node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs"],"sourcesContent":["import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction getGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { getGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n"],"names":["getGeneratorVelocity","resolveValue","t","current","prevT","Math","max","velocityPerSecond"],"mappings":"oLAIgBA,SACZC,EACAC,EACAC,GAEA,MAAMC,EAAQC,KAAKC,IAAIJ,EAPI,EAOwB,GACnD,OAAOK,EAAAA,kBAAkBJ,EAAUF,EAAaG,GAAQF,EAAIE,EAChE"}
1
+ {"version":3,"file":"velocity.mjs.js","sources":["../../../../../../../../node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs"],"sourcesContent":["import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction getGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n/**\n * A generator's velocity at time t in units/second: analytical where the\n * generator provides it (springs), otherwise by finite difference. Before\n * the animation has started this is its initial velocity.\n */\nfunction calcGeneratorVelocity(generator, t, initialVelocity = 0) {\n if (t <= 0)\n return initialVelocity;\n return generator.velocity\n ? generator.velocity(t)\n : getGeneratorVelocity((s) => generator.next(s).value, t, generator.next(t).value);\n}\n\nexport { calcGeneratorVelocity, getGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n"],"names":["getGeneratorVelocity","resolveValue","t","current","prevT","Math","max","velocityPerSecond","generator","initialVelocity","velocity","s","next","value"],"mappings":"uJAKgBA,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAMC,EAAQC,KAAKC,IAAIJ,EAPI,EAOwB,GACnD,OAAOK,EAAAA,kBAAkBJ,EAAUF,EAAaG,GAAQF,EAAIE,EAChE,+BAOM,SACFI,EACAN,EACAO,EAAkB,GAElB,OAAIP,GAAK,EAAUO,EAEZD,EAAUE,SACXF,EAAUE,SAASR,GACnBF,EACKW,GAAMH,EAAUI,KAAKD,GAAGE,MACzBX,EACAM,EAAUI,KAAKV,GAAGW,MAEhC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../AsyncMotionValueAnimation.mjs.js"),i=require("../JSAnimation.mjs.js"),t=require("../utils/get-value-transition.mjs.js"),n=require("../utils/make-animation-instant.mjs.js"),o=require("../utils/default-transitions.mjs.js"),s=require("../keyframes/get-final.mjs.js"),a=require("../utils/is-transition-defined.mjs.js"),r=require("../../frameloop/frame.mjs.js"),l=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js"),m=require("../../../../../motion-utils/dist/es/global-config.mjs.js");exports.animateMotionValue=(u,d,y,p={},j,f)=>c=>{const A=t.getValueTransition(p,u)||{},g=A.delay||p.delay||0;let{elapsed:k=0}=p;k-=l.secondsToMilliseconds(g);const q={keyframes:Array.isArray(y)?y:[null,y],ease:"easeOut",velocity:d.getVelocity(),...A,delay:-k,onUpdate:e=>{d.set(e),A.onUpdate&&A.onUpdate(e)},onComplete:()=>{c(),A.onComplete&&A.onComplete()},name:u,motionValue:d,element:f?void 0:j};a.isTransitionDefined(A)||Object.assign(q,o.getDefaultTransition(u,q)),q.duration&&(q.duration=l.secondsToMilliseconds(q.duration)),q.repeatDelay&&(q.repeatDelay=l.secondsToMilliseconds(q.repeatDelay)),void 0!==q.from&&(q.keyframes[0]=q.from);let v=!1;if((!1===q.type||0===q.duration&&!q.repeatDelay)&&(n.makeAnimationInstant(q),0===q.delay&&(v=!0)),(m.MotionGlobalConfig.instantAnimations||m.MotionGlobalConfig.skipAnimations||j?.shouldSkipAnimations||A.skipAnimations)&&(v=!0,n.makeAnimationInstant(q),q.delay=0),q.allowFlatten=!A.type&&!A.ease,v&&!f&&void 0!==d.get()){const e=s.getFinalKeyframe(q.keyframes,A);if(void 0!==e)return void r.frame.update(()=>{q.onUpdate(e),q.onComplete()})}return A.isSync?new i.JSAnimation(q):new e.AsyncMotionValueAnimation(q)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../AsyncMotionValueAnimation.mjs.js"),i=require("../JSAnimation.mjs.js"),t=require("../utils/get-value-transition.mjs.js"),n=require("../utils/make-animation-instant.mjs.js"),o=require("../utils/default-transitions.mjs.js"),s=require("../keyframes/get-final.mjs.js"),a=require("../utils/is-transition-defined.mjs.js"),r=require("../../frameloop/frame.mjs.js"),l=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js"),m=require("../../../../../motion-utils/dist/es/global-config.mjs.js");exports.animateMotionValue=(d,u,p,y={},j,f)=>c=>{const A=t.getValueTransition(y,d)||{},g=A.delay||y.delay||0;let{elapsed:k=0}=y;k-=l.secondsToMilliseconds(g);const q={keyframes:Array.isArray(p)?p:[null,p],ease:"easeOut",velocity:u.getVelocity(),...A,delay:-k,onUpdate:e=>{u.set(e),A.onUpdate&&A.onUpdate(e)},onComplete:()=>{c(),A.onComplete&&A.onComplete()},name:d,motionValue:u,element:f?void 0:j,hasOnUpdate:!!A.onUpdate};a.isTransitionDefined(A)||Object.assign(q,o.getDefaultTransition(d,q)),q.duration&&(q.duration=l.secondsToMilliseconds(q.duration)),q.repeatDelay&&(q.repeatDelay=l.secondsToMilliseconds(q.repeatDelay)),void 0!==q.from&&(q.keyframes[0]=q.from);let v=!1;if((!1===q.type||0===q.duration&&!q.repeatDelay)&&(n.makeAnimationInstant(q),0===q.delay&&(v=!0)),(m.MotionGlobalConfig.instantAnimations||m.MotionGlobalConfig.skipAnimations||j?.shouldSkipAnimations||A.skipAnimations)&&(v=!0,n.makeAnimationInstant(q),q.delay=0),q.allowFlatten=!A.type&&!A.ease,v&&!f&&void 0!==u.get()){const e=s.getFinalKeyframe(q.keyframes,A);if(void 0!==e)return void r.frame.update(()=>{q.onUpdate(e),q.onComplete()})}return A.isSync?new i.JSAnimation(q):new e.AsyncMotionValueAnimation(q)};
2
2
  //# sourceMappingURL=motion-value.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"motion-value.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs"],"sourcesContent":["import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../keyframes/get-final.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n"],"names":["animateMotionValue","name","value","target","transition","element","isHandoff","onComplete","valueTransition","getValueTransition","delay","elapsed","secondsToMilliseconds","options","keyframes","Array","isArray","ease","velocity","getVelocity","onUpdate","v","set","motionValue","undefined","isTransitionDefined","Object","assign","getDefaultTransition","duration","repeatDelay","from","shouldSkip","type","makeAnimationInstant","MotionGlobalConfig","instantAnimations","skipAnimations","shouldSkipAnimations","allowFlatten","get","finalKeyframe","getFinalKeyframe","frame","update","isSync","JSAnimation","AsyncMotionValueAnimation"],"mappings":"omBAmBIA,CACIC,EACAC,EACAC,EACAC,EAAqD,GACrDC,EACAC,IAEHC,IACG,MAAMC,EAAkBC,EAAkBA,mBAACL,EAAYH,IAAS,CAAA,EAO1DS,EAAQF,EAAgBE,OAASN,EAAWM,OAAS,EAM3D,IAAIC,QAAEA,EAAU,GAAMP,EACtBO,GAAoBC,wBAAsBF,GAE1C,MAAMG,EAAiC,CACnCC,UAAWC,MAAMC,QAAQb,GAAUA,EAAS,CAAC,KAAMA,GACnDc,KAAM,UACNC,SAAUhB,EAAMiB,iBACbX,EACHE,OAAQC,EACRS,SAAWC,IACPnB,EAAMoB,IAAID,GACVb,EAAgBY,UAAYZ,EAAgBY,SAASC,IAEzDd,WAAYA,KACRA,IACAC,EAAgBD,YAAcC,EAAgBD,cAElDN,OACAsB,YAAarB,EACbG,QAASC,OAAYkB,EAAYnB,GAOhCoB,EAAAA,oBAAoBjB,IACrBkB,OAAOC,OAAOd,EAASe,EAAoBA,qBAAC3B,EAAMY,IAQtDA,EAAQgB,WAARhB,EAAQgB,SAAajB,EAAAA,sBAAsBC,EAAQgB,WACnDhB,EAAQiB,cAARjB,EAAQiB,YAAgBlB,EAAAA,sBAAsBC,EAAQiB,mBAKjCN,IAAjBX,EAAQkB,OACRlB,EAAQC,UAAU,GAAKD,EAAQkB,MAGnC,IAAIC,GAAa,EAmCjB,KAhC8B,IAAzBnB,EAAgBoB,MACK,IAArBpB,EAAQgB,WAAmBhB,EAAQiB,eAEpCI,EAAoBA,qBAACrB,GAEC,IAAlBA,EAAQH,QACRsB,GAAa,KAKjBG,EAAkBA,mBAACC,mBACnBD,qBAAmBE,gBACnBhC,GAASiC,sBACT9B,EAAgB6B,kBAEhBL,GAAa,EACbE,EAAoBA,qBAACrB,GACrBA,EAAQH,MAAQ,GAOpBG,EAAQ0B,cAAgB/B,EAAgByB,OAASzB,EAAgBS,KAO7De,IAAe1B,QAA6BkB,IAAhBtB,EAAMsC,MAAqB,CACvD,MAAMC,EAAgBC,EAAgBA,iBAClC7B,EAAQC,UACRN,GAGJ,QAAsBgB,IAAlBiB,EAMA,YALAE,EAAKA,MAACC,OAAO,KACT/B,EAAQO,SAAUqB,GAClB5B,EAAQN,cAKpB,CAEA,OAAOC,EAAgBqC,OACjB,IAAIC,EAAWA,YAACjC,GAChB,IAAIkC,EAAAA,0BAA0BlC"}
1
+ {"version":3,"file":"motion-value.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs"],"sourcesContent":["import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../keyframes/get-final.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n hasOnUpdate: !!valueTransition.onUpdate,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n"],"names":["animateMotionValue","name","value","target","transition","element","isHandoff","onComplete","valueTransition","getValueTransition","delay","elapsed","secondsToMilliseconds","options","keyframes","Array","isArray","ease","velocity","getVelocity","onUpdate","v","set","motionValue","undefined","hasOnUpdate","isTransitionDefined","Object","assign","getDefaultTransition","duration","repeatDelay","from","shouldSkip","type","makeAnimationInstant","MotionGlobalConfig","instantAnimations","skipAnimations","shouldSkipAnimations","allowFlatten","get","finalKeyframe","getFinalKeyframe","frame","update","isSync","JSAnimation","AsyncMotionValueAnimation"],"mappings":"omBAmBIA,CACIC,EACAC,EACAC,EACAC,EAAqD,GACrDC,EACAC,IAEHC,IACG,MAAMC,EAAkBC,EAAkBA,mBAACL,EAAYH,IAAS,CAAA,EAO1DS,EAAQF,EAAgBE,OAASN,EAAWM,OAAS,EAM3D,IAAIC,QAAEA,EAAU,GAAMP,EACtBO,GAAoBC,wBAAsBF,GAE1C,MAAMG,EAAiC,CACnCC,UAAWC,MAAMC,QAAQb,GAAUA,EAAS,CAAC,KAAMA,GACnDc,KAAM,UACNC,SAAUhB,EAAMiB,iBACbX,EACHE,OAAQC,EACRS,SAAWC,IACPnB,EAAMoB,IAAID,GACVb,EAAgBY,UAAYZ,EAAgBY,SAASC,IAEzDd,WAAYA,KACRA,IACAC,EAAgBD,YAAcC,EAAgBD,cAElDN,OACAsB,YAAarB,EACbG,QAASC,OAAYkB,EAAYnB,EACjCoB,cAAejB,EAAgBY,UAO9BM,EAAAA,oBAAoBlB,IACrBmB,OAAOC,OAAOf,EAASgB,EAAoBA,qBAAC5B,EAAMY,IAQtDA,EAAQiB,WAARjB,EAAQiB,SAAalB,EAAAA,sBAAsBC,EAAQiB,WACnDjB,EAAQkB,cAARlB,EAAQkB,YAAgBnB,EAAAA,sBAAsBC,EAAQkB,mBAKjCP,IAAjBX,EAAQmB,OACRnB,EAAQC,UAAU,GAAKD,EAAQmB,MAGnC,IAAIC,GAAa,EAmCjB,KAhC8B,IAAzBpB,EAAgBqB,MACK,IAArBrB,EAAQiB,WAAmBjB,EAAQkB,eAEpCI,EAAoBA,qBAACtB,GAEC,IAAlBA,EAAQH,QACRuB,GAAa,KAKjBG,EAAkBA,mBAACC,mBACnBD,qBAAmBE,gBACnBjC,GAASkC,sBACT/B,EAAgB8B,kBAEhBL,GAAa,EACbE,EAAoBA,qBAACtB,GACrBA,EAAQH,MAAQ,GAOpBG,EAAQ2B,cAAgBhC,EAAgB0B,OAAS1B,EAAgBS,KAO7DgB,IAAe3B,QAA6BkB,IAAhBtB,EAAMuC,MAAqB,CACvD,MAAMC,EAAgBC,EAAgBA,iBAClC9B,EAAQC,UACRN,GAGJ,QAAsBgB,IAAlBkB,EAMA,YALAE,EAAKA,MAACC,OAAO,KACThC,EAAQO,SAAUsB,GAClB7B,EAAQN,cAKpB,CAEA,OAAOC,EAAgBsC,OACjB,IAAIC,EAAWA,YAAClC,GAChB,IAAImC,EAAAA,0BAA0BnC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../utils/get-value-transition.mjs.js"),t=require("../utils/resolve-transition.mjs.js"),i=require("../../render/utils/keys-position.mjs.js"),n=require("../../render/utils/setters.mjs.js"),s=require("../../value/will-change/add-will-change.mjs.js"),a=require("../optimized-appear/get-appear-id.mjs.js"),o=require("./motion-value.mjs.js"),r=require("../../frameloop/frame.mjs.js");function l({protectedKeys:e,needsAnimating:t},i){const n=e.hasOwnProperty(i)&&!0!==t[i];return t[i]=!1,n}exports.animateTarget=function(u,m,{delay:d=0,transitionOverride:c,type:p}={}){let{transition:f,transitionEnd:j,...g}=m;const y=u.getDefaultTransition();f=f?t.resolveTransition(f,y):y;const v=f?.reduceMotion,h=f?.skipAnimations;c&&(f=c);const A=[],q=p&&u.animationState&&u.animationState.getState()[p],w=f?.path;w&&w.animateVisualElement(u,g,f,d,A);for(const t in g){const n=u.getValue(t,u.latestValues[t]??null),m=g[t];if(void 0===m||q&&l(q,t))continue;const c={delay:d,...e.getValueTransition(f||{},t)};h&&(c.skipAnimations=!0);const p=n.get();if(void 0!==p&&!n.isAnimating()&&!Array.isArray(m)&&m===p&&!c.velocity){r.frame.update(()=>n.set(m));continue}let j=!1;if(window.MotionHandoffAnimation){const e=a.getOptimisedAppearId(u);if(e){const i=window.MotionHandoffAnimation(e,t,r.frame);null!==i&&(c.startTime=i,j=!0)}}s.addValueToWillChange(u,t);const y=v??u.shouldReduceMotion;n.start(o.animateMotionValue(t,n,m,y&&i.positionalKeys.has(t)?{type:!1}:c,u,j));const w=n.animation;w&&A.push(w)}if(j){const e=()=>r.frame.update(()=>{j&&n.setTarget(u,j)});A.length?Promise.all(A).then(e):e()}return A};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../utils/get-value-transition.mjs.js"),t=require("../utils/resolve-transition.mjs.js"),i=require("../../render/utils/keys-position.mjs.js"),n=require("../../render/utils/setters.mjs.js"),a=require("../../value/will-change/add-will-change.mjs.js"),s=require("../optimized-appear/get-appear-id.mjs.js"),o=require("./motion-value.mjs.js"),r=require("../../frameloop/frame.mjs.js");const l="undefined"!=typeof window;function u({protectedKeys:e,needsAnimating:t},i){const n=i in e&&!t[i];return t[i]=!1,n}exports.animateTarget=function(d,m,{delay:c=0,transitionOverride:p,type:f}={}){let{transition:g,transitionEnd:j,...y}=m;const v=d.getDefaultTransition();g=g?t.resolveTransition(g,v):v;const V=g?.reduceMotion,h=g?.skipAnimations;p&&(g=p);const A=[],q=f&&d.animationState?.getState()[f],w=g?.path;w&&(w.animateValues?w.animateValues(e=>d.getValue(e,d.latestValues[e]??0),y,g,c,A):w.animateVisualElement?.(d,y,g,c,A));for(const t in y){const n=d.getValue(t,d.latestValues[t]??null),m=y[t];if(void 0===m||q&&u(q,t))continue;const p={delay:c,...e.getValueTransition(g||{},t)};h&&(p.skipAnimations=!0);const f=n.get();if(void 0!==f&&!n.isAnimating()&&!Array.isArray(m)&&m===f&&!p.velocity){r.frame.update(()=>n.set(m));continue}let j=!1;if(l&&window.MotionHandoffAnimation){const e=s.getOptimisedAppearId(d);if(e){const i=window.MotionHandoffAnimation(e,t,r.frame);null!==i&&(p.startTime=i,j=!0)}}a.addValueToWillChange(d,t);const v=V??d.shouldReduceMotion;n.start(o.animateMotionValue(t,n,m,v&&i.positionalKeys.has(t)?{type:!1}:p,d,j));const w=n.animation;w&&A.push(w)}if(j){const e=()=>r.frame.update(()=>{j&&n.setTarget(d,j)});A.length?Promise.all(A).then(e):e()}return A};
2
2
  //# sourceMappingURL=visual-element-target.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual-element-target.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs"],"sourcesContent":["import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n const skipAnimations = transition?.skipAnimations;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n const path = transition?.path;\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateVisualElement(visualElement, target, transition, delay, animations);\n }\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n if (skipAnimations)\n valueTransition.skipAnimations = true;\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n frame.update(() => value.set(valueTarget));\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n"],"names":["shouldBlockAnimation","protectedKeys","needsAnimating","key","shouldBlock","hasOwnProperty","animateTarget","visualElement","targetAndTransition","delay","transitionOverride","type","transition","transitionEnd","target","defaultTransition","getDefaultTransition","resolveTransition","reduceMotion","skipAnimations","animations","animationTypeState","animationState","getState","path","animateVisualElement","value","getValue","latestValues","valueTarget","undefined","valueTransition","getValueTransition","currentValue","get","isAnimating","Array","isArray","velocity","frame","update","set","isHandoff","window","MotionHandoffAnimation","appearId","getOptimisedAppearId","startTime","addValueToWillChange","shouldReduceMotion","start","animateMotionValue","positionalKeys","has","animation","push","applyTransitionEnd","setTarget","length","Promise","all","then"],"mappings":"6cAqBA,SAASA,GACLC,cAAEA,EAAaC,eAAEA,GACjBC,GAEA,MAAMC,EACFH,EAAcI,eAAeF,KAAgC,IAAxBD,EAAeC,GAGxD,OADAD,EAAeC,IAAO,EACfC,CACX,uBAEgBE,SACZC,EACAC,GACAC,MAAEA,EAAQ,EAACC,mBAAEA,EAAkBC,KAAEA,GAAwC,IAEzE,IAAIC,WACAA,EAAUC,cACVA,KACGC,GACHN,EAEJ,MAAMO,EAAoBR,EAAcS,uBACxCJ,EAAaA,EACPK,EAAiBA,kBAACL,EAAYG,GAC9BA,EAEN,MAAMG,EAAgBN,GAA2CM,aAC3DC,EAAiBP,GAAYO,eAE/BT,IAAoBE,EAAaF,GAErC,MAAMU,EAAkD,GAElDC,EACFV,GACAJ,EAAce,gBACdf,EAAce,eAAeC,WAAWZ,GAEtCa,EAAQZ,GAAkDY,KAC5DA,GAEAA,EAAKC,qBACDlB,EACAO,EACAF,EACAH,EACAW,GAIR,IAAK,MAAMjB,KAAOW,EAAQ,CACtB,MAAMY,EAAQnB,EAAcoB,SACxBxB,EACAI,EAAcqB,aAAazB,IAAQ,MAEjC0B,EAAcf,EAAOX,GAE3B,QACoB2B,IAAhBD,GACCR,GACGrB,EAAqBqB,EAAoBlB,GAE7C,SAGJ,MAAM4B,EAAkB,CACpBtB,WACGuB,qBAAmBpB,GAAc,CAAE,EAAET,IAGxCgB,IAAgBY,EAAgBZ,gBAAiB,GAOrD,MAAMc,EAAeP,EAAMQ,MAC3B,QACqBJ,IAAjBG,IACCP,EAAMS,gBACNC,MAAMC,QAAQR,IACfA,IAAgBI,IACfF,EAAgBO,SACnB,CACEC,EAAKA,MAACC,OAAO,IAAMd,EAAMe,IAAIZ,IAC7B,QACJ,CAMA,IAAIa,GAAY,EAChB,GAAIC,OAAOC,uBAAwB,CAC/B,MAAMC,EAAWC,uBAAqBvC,GAEtC,GAAIsC,EAAU,CACV,MAAME,EAAYJ,OAAOC,uBACrBC,EACA1C,EACAoC,EAAAA,OAGc,OAAdQ,IACAhB,EAAgBgB,UAAYA,EAC5BL,GAAY,EAEpB,CACJ,CAEAM,uBAAqBzC,EAAeJ,GAEpC,MAAM8C,EACF/B,GAAgBX,EAAc0C,mBAElCvB,EAAMwB,MACFC,qBACIhD,EACAuB,EACAG,EACAoB,GAAsBG,EAAcA,eAACC,IAAIlD,GACnC,CAAEQ,MAAM,GACRoB,EACNxB,EACAmC,IAIR,MAAMY,EAAY5B,EAAM4B,UAEpBA,GACAlC,EAAWmC,KAAKD,EAExB,CAEA,GAAIzC,EAAe,CACf,MAAM2C,EAAqBA,IACvBjB,QAAMC,OAAO,KACT3B,GAAiB4C,EAASA,UAAClD,EAAeM,KAG9CO,EAAWsC,OACXC,QAAQC,IAAIxC,GAAYyC,KAAKL,GAE7BA,GAER,CAEA,OAAOpC,CACX"}
1
+ {"version":3,"file":"visual-element-target.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs"],"sourcesContent":["import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = key in protectedKeys && !needsAnimating[key];\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n const skipAnimations = transition?.skipAnimations;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type && visualElement.animationState?.getState()[type];\n const path = transition?.path;\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateValues\n ? path.animateValues((key) => visualElement.getValue(key, visualElement.latestValues[key] ?? 0), target, transition, delay, animations)\n : path.animateVisualElement?.(visualElement, target, transition, delay, animations);\n }\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n if (skipAnimations)\n valueTransition.skipAnimations = true;\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n frame.update(() => value.set(valueTarget));\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (isBrowser && window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n"],"names":["isBrowser","window","shouldBlockAnimation","protectedKeys","needsAnimating","key","shouldBlock","animateTarget","visualElement","targetAndTransition","delay","transitionOverride","type","transition","transitionEnd","target","defaultTransition","getDefaultTransition","resolveTransition","reduceMotion","skipAnimations","animations","animationTypeState","animationState","getState","path","animateValues","getValue","latestValues","animateVisualElement","value","valueTarget","undefined","valueTransition","getValueTransition","currentValue","get","isAnimating","Array","isArray","velocity","frame","update","set","isHandoff","MotionHandoffAnimation","appearId","getOptimisedAppearId","startTime","addValueToWillChange","shouldReduceMotion","start","animateMotionValue","positionalKeys","has","animation","push","applyTransitionEnd","setTarget","length","Promise","all","then"],"mappings":"6cAeA,MAAMA,EAA8B,oBAAXC,OAQzB,SAASC,GACLC,cAAEA,EAAaC,eAAEA,GACjBC,GAEA,MAAMC,EAAcD,KAAOF,IAAkBC,EAAeC,GAG5D,OADAD,EAAeC,IAAO,EACfC,CACX,uBAEgBC,SACZC,EACAC,GACAC,MAAEA,EA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zC,EAAeH,GAEpC,MAAM6C,EACF/B,GAAgBX,EAAc0C,mBAElCpB,EAAMqB,MACFC,qBACI/C,EACAyB,EACAC,EACAmB,GAAsBG,EAAcA,eAACC,IAAIjD,GACnC,CAAEO,MAAM,GACRqB,EACNzB,EACAoC,IAIR,MAAMW,EAAYzB,EAAMyB,UAIpBA,GACAlC,EAAWmC,KAAKD,EAExB,CAEA,GAAIzC,EAAe,CACf,MAAM2C,EAAqBA,IACvBhB,QAAMC,OAAO,KACT5B,GAAiB4C,EAASA,UAAClD,EAAeM,KAG9CO,EAAWsC,OACXC,QAAQC,IAAIxC,GAAYyC,KAAKL,GAE7BA,GAER,CAEA,OAAOpC,CACX"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/resolve-dynamic-variants.mjs.js"),r=require("../utils/calc-child-stagger.mjs.js"),t=require("./visual-element-target.mjs.js");function i(n,a,s={}){const o=e.resolveVariant(n,a,"exit"===s.type?n.presenceContext?.custom:void 0);let{transition:l=n.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(l=s.transitionOverride);const c=o?()=>Promise.all(t.animateTarget(n,o,s)):()=>Promise.resolve(),d=n.variantChildren&&n.variantChildren.size?(e=0)=>{const{delayChildren:t=0,staggerChildren:o,staggerDirection:c}=l;return function(e,t,n=0,a=0,s=0,o=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(i(d,t,{...l,delay:n+("function"==typeof a?0:a)+r.calcChildStagger(e.variantChildren,d,a,s,o)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}(n,a,e,t,o,c,s)}:()=>Promise.resolve(),{when:u}=l;if(u){const[e,r]="beforeChildren"===u?[c,d]:[d,c];return e().then(()=>r())}return Promise.all([c(),d(s.delay)])}exports.animateVariant=i;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/resolve-dynamic-variants.mjs.js"),t=require("../utils/calc-child-stagger.mjs.js"),r=require("./visual-element-target.mjs.js");exports.animateVariant=function i(n,a,s={}){const l=e.resolveVariant(n,a,e.getTypeCustom(n,s.type)),o=s.transitionOverride||(l?.transition??(n.getDefaultTransition()||{})),u=()=>Promise.all(l?r.animateTarget(n,l,s):[]),c=(e=0)=>{const{variantChildren:r}=n,{delayChildren:l=0,staggerChildren:u,staggerDirection:c}=o,d=[];return r?.forEach(n=>{n.notify("AnimationStart",a),d.push(i(n,a,{...s,delay:e+("function"==typeof l?0:l)+t.calcChildStagger(r,n,l,u,c)}).then(()=>n.notify("AnimationComplete",a)))}),Promise.all(d)},{when:d}=o;return d?"beforeChildren"===d?u().then(()=>c()):c().then(u):Promise.all([u(),c(s.delay)])};
2
2
  //# sourceMappingURL=visual-element-variant.mjs.js.map