@nethesis/phone-island 1.0.15 → 1.0.16

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 (397) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/App.js.map +1 -1
  3. package/dist/_virtual/index8.js +1 -1
  4. package/dist/_virtual/index9.js +1 -1
  5. package/dist/components/AlertView/index.js +1 -1
  6. package/dist/components/AlertView/index.js.map +1 -1
  7. package/dist/components/AudioPlayerView/Avatar.js +1 -1
  8. package/dist/components/AudioPlayerView/Avatar.js.map +1 -1
  9. package/dist/components/AudioPlayerView/PlayerFooterActions.js +1 -1
  10. package/dist/components/AudioPlayerView/PlayerFooterActions.js.map +1 -1
  11. package/dist/components/AudioPlayerView/Progress.js +1 -1
  12. package/dist/components/AudioPlayerView/Progress.js.map +1 -1
  13. package/dist/components/AudioPlayerView/index.js +1 -1
  14. package/dist/components/AudioPlayerView/index.js.map +1 -1
  15. package/dist/components/AvatarGroup.js +1 -1
  16. package/dist/components/AvatarGroup.js.map +1 -1
  17. package/dist/components/CallView/Actions.js +1 -1
  18. package/dist/components/CallView/Actions.js.map +1 -1
  19. package/dist/components/CallView/BackCall.js +1 -1
  20. package/dist/components/CallView/BackCall.js.map +1 -1
  21. package/dist/components/CallView/index.js +1 -1
  22. package/dist/components/CallView/index.js.map +1 -1
  23. package/dist/components/ConferenceView/ConferenceUsersList.js +1 -1
  24. package/dist/components/ConferenceView/ConferenceUsersList.js.map +1 -1
  25. package/dist/components/ConferenceView/index.js +1 -1
  26. package/dist/components/ConferenceView/index.js.map +1 -1
  27. package/dist/components/ContactView/ContactListView.js +1 -1
  28. package/dist/components/ContactView/ContactListView.js.map +1 -1
  29. package/dist/components/ContactView/ListAvatar.js +1 -1
  30. package/dist/components/ContactView/ListAvatar.js.map +1 -1
  31. package/dist/components/ContactView/SelectContactNumberView.js +1 -1
  32. package/dist/components/ContactView/SelectContactNumberView.js.map +1 -1
  33. package/dist/components/ContactView/TransferActions.js +1 -1
  34. package/dist/components/ContactView/TransferActions.js.map +1 -1
  35. package/dist/components/Dropdown.js +1 -1
  36. package/dist/components/Dropdown.js.map +1 -1
  37. package/dist/components/GenericAvatar.js +1 -1
  38. package/dist/components/GenericAvatar.js.map +1 -1
  39. package/dist/components/Hangup.js +1 -1
  40. package/dist/components/Hangup.js.map +1 -1
  41. package/dist/components/IslandMotion.js +1 -1
  42. package/dist/components/IslandMotion.js.map +1 -1
  43. package/dist/components/KeypadView/Actions.js +1 -1
  44. package/dist/components/KeypadView/Actions.js.map +1 -1
  45. package/dist/components/KeypadView/index.js +1 -1
  46. package/dist/components/KeypadView/index.js.map +1 -1
  47. package/dist/components/OperatorBusyView/index.js +1 -1
  48. package/dist/components/OperatorBusyView/index.js.map +1 -1
  49. package/dist/components/PhysicalRecorderView/index.js +1 -1
  50. package/dist/components/PhysicalRecorderView/index.js.map +1 -1
  51. package/dist/components/RecorderView/Actions.js +1 -1
  52. package/dist/components/RecorderView/Actions.js.map +1 -1
  53. package/dist/components/RecorderView/index.js +1 -1
  54. package/dist/components/RecorderView/index.js.map +1 -1
  55. package/dist/components/SettingsView/AudioView.js +1 -1
  56. package/dist/components/SettingsView/AudioView.js.map +1 -1
  57. package/dist/components/SettingsView/MicrophoneView.js +1 -1
  58. package/dist/components/SettingsView/MicrophoneView.js.map +1 -1
  59. package/dist/components/SettingsView/SettingsHeader.js +1 -1
  60. package/dist/components/SettingsView/SettingsHeader.js.map +1 -1
  61. package/dist/components/SettingsView/ThemeView.js +1 -1
  62. package/dist/components/SettingsView/ThemeView.js.map +1 -1
  63. package/dist/components/SettingsView/VideoInputView.js +1 -1
  64. package/dist/components/SettingsView/VideoInputView.js.map +1 -1
  65. package/dist/components/SettingsView/index.js +1 -1
  66. package/dist/components/SettingsView/index.js.map +1 -1
  67. package/dist/components/SideView/SideView.js.map +1 -1
  68. package/dist/components/SideView/components/SideViewButton.js +1 -1
  69. package/dist/components/SideView/components/SideViewButton.js.map +1 -1
  70. package/dist/components/Socket.js +1 -1
  71. package/dist/components/Socket.js.map +1 -1
  72. package/dist/components/StreamingAnswerView/index.js +1 -1
  73. package/dist/components/StreamingAnswerView/index.js.map +1 -1
  74. package/dist/components/SwitchDeviceView/index.js +1 -1
  75. package/dist/components/SwitchDeviceView/index.js.map +1 -1
  76. package/dist/components/SwitchInputView/DropdownContent.js +1 -1
  77. package/dist/components/SwitchInputView/DropdownContent.js.map +1 -1
  78. package/dist/components/SwitchInputView/Index.js +1 -1
  79. package/dist/components/TranscriptionView/TranscriptionView.js +1 -1
  80. package/dist/components/TranscriptionView/TranscriptionView.js.map +1 -1
  81. package/dist/components/TransferButton.js +1 -1
  82. package/dist/components/TransferButton.js.map +1 -1
  83. package/dist/components/VideoStreamingEmptyState/index.js +1 -1
  84. package/dist/components/VideoStreamingEmptyState/index.js.map +1 -1
  85. package/dist/components/VideoStreamingSkeleton/index.js +1 -1
  86. package/dist/components/VideoStreamingSkeleton/index.js.map +1 -1
  87. package/dist/components/VideoView/index.js +1 -1
  88. package/dist/components/VideoView/index.js.map +1 -1
  89. package/dist/components/WebRTC.js +1 -1
  90. package/dist/components/WebRTC.js.map +1 -1
  91. package/dist/events/CallEvents.js +1 -1
  92. package/dist/events/CallEvents.js.map +1 -1
  93. package/dist/events/RecorderEvents.js +1 -1
  94. package/dist/events/RecorderEvents.js.map +1 -1
  95. package/dist/index.css +1 -1
  96. package/dist/lib/devices/devices.js +1 -1
  97. package/dist/lib/devices/devices.js.map +1 -1
  98. package/dist/lib/phone/call.js +1 -1
  99. package/dist/lib/phone/call.js.map +1 -1
  100. package/dist/lib/phone/video.js +2 -0
  101. package/dist/lib/phone/video.js.map +1 -0
  102. package/dist/lib/webrtc/messages.js +1 -1
  103. package/dist/lib/webrtc/messages.js.map +1 -1
  104. package/dist/models/motions.js.map +1 -1
  105. package/dist/models/webrtc.js.map +1 -1
  106. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.mjs.js +3 -3
  107. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.mjs.js.map +1 -1
  108. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js +1 -1
  109. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js.map +1 -1
  110. package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +2 -0
  111. package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +1 -0
  112. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +1 -1
  113. package/dist/node_modules/@headlessui/react/dist/components/label/label.js.map +1 -1
  114. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +1 -1
  115. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js.map +1 -1
  116. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +1 -1
  117. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js.map +1 -1
  118. package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js +1 -1
  119. package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js.map +1 -1
  120. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js +1 -1
  121. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js.map +1 -1
  122. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js +1 -1
  123. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js.map +1 -1
  124. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js +1 -1
  125. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js.map +1 -1
  126. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js +1 -1
  127. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js.map +1 -1
  128. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js +1 -1
  129. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js.map +1 -1
  130. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +1 -1
  131. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js.map +1 -1
  132. package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js +1 -1
  133. package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js.map +1 -1
  134. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +1 -1
  135. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js.map +1 -1
  136. package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js +1 -1
  137. package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js.map +1 -1
  138. package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js +1 -1
  139. package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js.map +1 -1
  140. package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js +1 -1
  141. package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js.map +1 -1
  142. package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js +1 -1
  143. package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js.map +1 -1
  144. package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js +1 -1
  145. package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js.map +1 -1
  146. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +1 -1
  147. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js.map +1 -1
  148. package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js +1 -1
  149. package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js.map +1 -1
  150. package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js +1 -1
  151. package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js.map +1 -1
  152. package/dist/node_modules/@headlessui/react/dist/internal/floating.js +1 -1
  153. package/dist/node_modules/@headlessui/react/dist/internal/floating.js.map +1 -1
  154. package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js +1 -1
  155. package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js.map +1 -1
  156. package/dist/node_modules/@headlessui/react/dist/machine.js +1 -1
  157. package/dist/node_modules/@headlessui/react/dist/machine.js.map +1 -1
  158. package/dist/node_modules/@headlessui/react/dist/react-glue.js +1 -1
  159. package/dist/node_modules/@headlessui/react/dist/react-glue.js.map +1 -1
  160. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +1 -1
  161. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js.map +1 -1
  162. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +1 -1
  163. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js.map +1 -1
  164. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +1 -1
  165. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js.map +1 -1
  166. package/dist/node_modules/@headlessui/react/dist/utils/match.js +1 -1
  167. package/dist/node_modules/@headlessui/react/dist/utils/match.js.map +1 -1
  168. package/dist/node_modules/@headlessui/react/dist/utils/render.js +1 -1
  169. package/dist/node_modules/@headlessui/react/dist/utils/render.js.map +1 -1
  170. package/dist/node_modules/@headlessui/react/dist/utils/store.js +1 -1
  171. package/dist/node_modules/@headlessui/react/dist/utils/store.js.map +1 -1
  172. package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js +1 -1
  173. package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js.map +1 -1
  174. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js +1 -1
  175. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js.map +1 -1
  176. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js +1 -1
  177. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js.map +1 -1
  178. package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js +1 -1
  179. package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js.map +1 -1
  180. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js +1 -1
  181. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js.map +1 -1
  182. package/dist/node_modules/engine.io-client/build/esm/socket.js +1 -1
  183. package/dist/node_modules/engine.io-client/build/esm/socket.js.map +1 -1
  184. package/dist/node_modules/engine.io-client/build/esm/transport.js +1 -1
  185. package/dist/node_modules/engine.io-client/build/esm/transport.js.map +1 -1
  186. package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +1 -1
  187. package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.js.map +1 -1
  188. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js +1 -1
  189. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js.map +1 -1
  190. package/dist/node_modules/engine.io-client/build/esm/util.js +1 -1
  191. package/dist/node_modules/engine.io-client/build/esm/util.js.map +1 -1
  192. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +1 -1
  193. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +1 -1
  194. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js +1 -1
  195. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js.map +1 -1
  196. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
  197. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
  198. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js +1 -1
  199. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js.map +1 -1
  200. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js +1 -1
  201. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js.map +1 -1
  202. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js +1 -1
  203. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +1 -1
  204. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js +1 -1
  205. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js.map +1 -1
  206. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +1 -1
  207. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +1 -1
  208. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js +1 -1
  209. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js.map +1 -1
  210. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js +1 -1
  211. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js.map +1 -1
  212. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js +1 -1
  213. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js.map +1 -1
  214. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js +1 -1
  215. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js.map +1 -1
  216. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js +1 -1
  217. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js.map +1 -1
  218. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js +1 -1
  219. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js.map +1 -1
  220. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js +1 -1
  221. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js.map +1 -1
  222. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js +1 -1
  223. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js.map +1 -1
  224. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.js +1 -1
  225. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.js.map +1 -1
  226. package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
  227. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js +1 -1
  228. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js +1 -1
  229. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
  230. package/dist/node_modules/js-base64/base64.mjs.js +1 -1
  231. package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
  232. package/dist/node_modules/moment/moment.js +2 -2
  233. package/dist/node_modules/moment/moment.js.map +1 -1
  234. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js +1 -1
  235. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js.map +1 -1
  236. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js +1 -1
  237. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
  238. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js +1 -1
  239. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js.map +1 -1
  240. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js +1 -1
  241. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js.map +1 -1
  242. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js +1 -1
  243. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js.map +1 -1
  244. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js +1 -1
  245. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js.map +1 -1
  246. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js +1 -1
  247. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js.map +1 -1
  248. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js +1 -1
  249. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js.map +1 -1
  250. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js +1 -1
  251. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js.map +1 -1
  252. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js +1 -1
  253. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js.map +1 -1
  254. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js +1 -1
  255. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js.map +1 -1
  256. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js +1 -1
  257. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js.map +1 -1
  258. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js +1 -1
  259. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js.map +1 -1
  260. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js +1 -1
  261. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js.map +1 -1
  262. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js +1 -1
  263. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js.map +1 -1
  264. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js +1 -1
  265. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js.map +1 -1
  266. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.js +1 -1
  267. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.js.map +1 -1
  268. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js +1 -1
  269. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js.map +1 -1
  270. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.js +1 -1
  271. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.js.map +1 -1
  272. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js +1 -1
  273. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js.map +1 -1
  274. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js +1 -1
  275. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js.map +1 -1
  276. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js +1 -1
  277. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js.map +1 -1
  278. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js +1 -1
  279. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js.map +1 -1
  280. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.js +1 -1
  281. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.js.map +1 -1
  282. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
  283. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
  284. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
  285. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
  286. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js +1 -1
  287. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js.map +1 -1
  288. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
  289. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
  290. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.js +1 -1
  291. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.js.map +1 -1
  292. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js +1 -1
  293. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js.map +1 -1
  294. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.js +1 -1
  295. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.js.map +1 -1
  296. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.js +1 -1
  297. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.js.map +1 -1
  298. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js +1 -1
  299. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
  300. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.js +1 -1
  301. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.js.map +1 -1
  302. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js +1 -1
  303. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js.map +1 -1
  304. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js +1 -1
  305. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js.map +1 -1
  306. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.js +1 -1
  307. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.js.map +1 -1
  308. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.js +1 -1
  309. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.js.map +1 -1
  310. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.js +1 -1
  311. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.js.map +1 -1
  312. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js +1 -1
  313. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js.map +1 -1
  314. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.js +1 -1
  315. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.js.map +1 -1
  316. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js +1 -1
  317. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js.map +1 -1
  318. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.js +1 -1
  319. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.js.map +1 -1
  320. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.mjs.js +1 -1
  321. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.mjs.js.map +1 -1
  322. package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js +1 -1
  323. package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js.map +1 -1
  324. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js +1 -1
  325. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js.map +1 -1
  326. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js +1 -1
  327. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js.map +1 -1
  328. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js +1 -1
  329. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js.map +1 -1
  330. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js +1 -1
  331. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js.map +1 -1
  332. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js +1 -1
  333. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js.map +1 -1
  334. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js +1 -1
  335. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js.map +1 -1
  336. package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js +1 -1
  337. package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js.map +1 -1
  338. package/dist/node_modules/react-redux/es/components/Provider.js +1 -1
  339. package/dist/node_modules/react-redux/es/components/Provider.js.map +1 -1
  340. package/dist/node_modules/react-redux/es/hooks/useDispatch.js +1 -1
  341. package/dist/node_modules/react-redux/es/hooks/useDispatch.js.map +1 -1
  342. package/dist/node_modules/react-redux/es/hooks/useReduxContext.js +1 -1
  343. package/dist/node_modules/react-redux/es/hooks/useReduxContext.js.map +1 -1
  344. package/dist/node_modules/react-redux/es/hooks/useSelector.js +1 -1
  345. package/dist/node_modules/react-redux/es/hooks/useSelector.js.map +1 -1
  346. package/dist/node_modules/react-redux/es/hooks/useStore.js +1 -1
  347. package/dist/node_modules/react-redux/es/hooks/useStore.js.map +1 -1
  348. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js +1 -1
  349. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js.map +1 -1
  350. package/dist/node_modules/redux/es/redux.js +1 -1
  351. package/dist/node_modules/redux/es/redux.js.map +1 -1
  352. package/dist/node_modules/socket.io-client/build/esm/index.js.map +1 -1
  353. package/dist/node_modules/socket.io-client/build/esm/socket.js +1 -1
  354. package/dist/node_modules/socket.io-client/build/esm/socket.js.map +1 -1
  355. package/dist/node_modules/socket.io-client/build/esm/url.js +1 -1
  356. package/dist/node_modules/socket.io-client/build/esm/url.js.map +1 -1
  357. package/dist/node_modules/webm-duration-fix/lib/ebml/index.js +1 -1
  358. package/dist/node_modules/webm-duration-fix/lib/ebml/index.js.map +1 -1
  359. package/dist/node_modules/webm-duration-fix/lib/index.js +1 -1
  360. package/dist/node_modules/webm-duration-fix/lib/index.js.map +1 -1
  361. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js +1 -1
  362. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js.map +1 -1
  363. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js +1 -1
  364. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js.map +1 -1
  365. package/dist/package.json.js +1 -1
  366. package/dist/services/astproxy.js.map +1 -1
  367. package/package.json +13 -28
  368. package/dist/_virtual/index10.js +0 -2
  369. package/dist/_virtual/index10.js.map +0 -1
  370. package/dist/_virtual/index11.js +0 -2
  371. package/dist/_virtual/index11.js.map +0 -1
  372. package/dist/_virtual/react-is.development4.js +0 -2
  373. package/dist/_virtual/react-is.development4.js.map +0 -1
  374. package/dist/_virtual/react-is.production.min4.js +0 -2
  375. package/dist/_virtual/react-is.production.min4.js.map +0 -1
  376. package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js +0 -2
  377. package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js.map +0 -1
  378. package/dist/node_modules/object-assign/index.js +0 -8
  379. package/dist/node_modules/object-assign/index.js.map +0 -1
  380. package/dist/node_modules/prop-types/checkPropTypes.js +0 -2
  381. package/dist/node_modules/prop-types/checkPropTypes.js.map +0 -1
  382. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -2
  383. package/dist/node_modules/prop-types/factoryWithThrowingShims.js.map +0 -1
  384. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -2
  385. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +0 -1
  386. package/dist/node_modules/prop-types/index.js +0 -2
  387. package/dist/node_modules/prop-types/index.js.map +0 -1
  388. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -2
  389. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +0 -1
  390. package/dist/node_modules/prop-types/lib/has.js +0 -2
  391. package/dist/node_modules/prop-types/lib/has.js.map +0 -1
  392. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -10
  393. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js.map +0 -1
  394. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -10
  395. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js.map +0 -1
  396. package/dist/node_modules/prop-types/node_modules/react-is/index.js +0 -2
  397. package/dist/node_modules/prop-types/node_modules/react-is/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, anchorX = \"left\", anchorY = \"top\", root }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n exitingComponents.current.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return;\n }\n if (exitComplete.has(key)) {\n exitingComponents.current.add(key);\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender?.();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && safeToRemove?.();\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n//# sourceMappingURL=index.mjs.map\n"],"names":["_ref","children","custom","initial","onExitComplete","presenceAffectsLayout","mode","propagate","anchorX","anchorY","root","presentChildren","useMemo","onlyElements","presentKeys","isParentPresent","map","getChildKey","isInitialRender","useRef","pendingPresentChildren","current","i","renderedChildren","length","exitComplete","delete","key","exitingComponents","set","join","diffedChildren","nextChildren","child","exitingChildren","push","setRenderedChildren","process","env","NODE_ENV","console","warn","isPresent","includes","jsx","PresenceChild","undefined","has","add","forEach","isExitComplete","safeToRemove"],"mappings":"odA6COA,IAAA,IAAAC,SAAAA,EAAAC,OAAAA,EAAAC,QAAAA,GAAA,EAAAC,eAAAA,EAAAC,sBAAAA,GAAA,EAAAC,KAAAA,EAAA,OAAAC,UAAAA,GAAA,EAAAC,QAAAA,EAAA,OAAAC,QAAAA,EAAA,MAAAC,KAAAA,GAAAV,8BAkBHW,EAAAC,EAAAA,QAAA,IAAAC,EAAAA,aAAAZ,IAAAA,IAMAa,EAAAP,IAAAQ,KAAAJ,EAAAK,IAAAC,EAAAA,aAMAC,EAAAC,UAAA,GAOAC,EAAAD,SAAAR,6HAoBIO,EAAAG,SAAA,EACAD,EAAAC,QAAAV,EAKA,IAAAW,IAAAA,IAAAA,EAAAC,EAAAC,OAAAF,IAAA,4CAQQG,EAAAC,OAAAC,GACAC,EAAAP,QAAAK,OAAAC,mBAJIF,EAAAI,IAAAF,GAAA,KAOhBJ,CAAAA,EAAAT,EAAAU,OAAAV,EAAAgB,KAAA,kBAIA,GAAAnB,IAAAoB,EAAA,CACI,IAAAC,MAAArB,GAMA,IAAAW,IAAAA,IAAAA,EAAAC,EAAAC,OAAAF,IAAA,CACI,MAAAW,EAAAV,EAAAD,GACAK,EAAAV,cAAAgB,mCAIIC,EAAAC,KAAAF,IAmBR,kCAPAG,EAAAvB,EAAAA,aAAAmB,SAOA,oBAGJK,QAAAC,IAAAC,UAEI,SAAAjC,GACAiB,EAAAC,OAAA,GAEAgB,QAAAC,KAAA,sQAeQ,MAAAd,EAAAV,cAAAgB,GAEAS,IAAAnC,IAAAQ,YAIUD,EAAA6B,SAAAhB,IA6BV,OAAAiB,EAAAA,QAAAA,IAAAC,EAAAA,cAAA,CAAAH,UAAAA,EAAAvC,UAAAe,EAAAG,UAAAlB,SAMgB2C,yGA5BZ,IAAArB,EAAAsB,IAAApB,UACIC,EAAAP,QAAA2B,IAAArB,GACAF,EAAAI,IAAAF,GAAA,YAMJF,EAAAwB,QAAAC,IACIA,sBAKAd,EAAAhB,EAAAC,SAEAd,GAAA4C"}
1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, anchorX = \"left\", anchorY = \"top\", root }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n exitingComponents.current.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return;\n }\n if (exitComplete.has(key)) {\n exitingComponents.current.add(key);\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender?.();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && safeToRemove?.();\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n//# sourceMappingURL=index.mjs.map\n"],"names":["AnimatePresence","children","custom","initial","onExitComplete","presenceAffectsLayout","mode","propagate","anchorX","anchorY","root","presentChildren","useMemo","onlyElements","presentKeys","isParentPresent","map","getChildKey","isInitialRender","useRef","pendingPresentChildren","current","i","renderedChildren","length","exitComplete","delete","key","exitingComponents","set","join","diffedChildren","nextChildren","child","exitingChildren","push","setRenderedChildren","process","env","NODE_ENV","console","warn","isPresent","includes","jsx","PresenceChild","undefined","has","add","forEach","isExitComplete","safeToRemove"],"mappings":"odA6COA,EAAAC,W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resence=function(){let r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.useContext(t.PresenceContext);if(null===n)return[!0,null];const{isPresent:s,onExitComplete:u,register:o}=n,c=e.useId();e.useEffect(()=>{if(r)return o(c)},[r]);const i=e.useCallback(()=>r&&u&&u(c),[c,u,r]);return!s&&u?[!1,i]:[!0]};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../context/PresenceContext.mjs.js");exports.usePresence=function(r=!0){const s=e.useContext(t.PresenceContext);if(null===s)return[!0,null];const{isPresent:n,onExitComplete:u,register:o}=s,c=e.useId();e.useEffect(()=>{if(r)return o(c)},[r]);const i=e.useCallback(()=>r&&u&&u(c),[c,u,r]);return!n&&u?[!1,i]:[!0]};
2
2
  //# sourceMappingURL=use-presence.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-presence.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs"],"sourcesContent":["\"use client\";\nimport { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n//# sourceMappingURL=use-presence.mjs.map\n"],"names":["subscribe","arguments","length","undefined","context","useContext","PresenceContext","id","useId","register","isPresent","onExitComplete","safeToRemove"],"mappings":"iKAuCM,WAAA,IAAAA,IAAAC,UAAAC,eAAAC,IAAAF,UAAA,KAAAA,UAAA,GAGF,MAAAG,EAAAC,aAAAC,EAAAA,iBAEsB,GAAA,OAAAF,EAAA,MAAA,EAAA,EAAA,uDAOtBG,EAAAC,EAAAA,8BAGQ,OAAAC,EAAAF,IAER,CAAAP,kDAOA,OAAAU,GAAAC,EAAA,EAAA,EAAAC,GAAA,EAAA,EACJ"}
1
+ {"version":3,"file":"use-presence.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs"],"sourcesContent":["\"use client\";\nimport { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n//# sourceMappingURL=use-presence.mjs.map\n"],"names":["subscribe","context","useContext","PresenceContext","id","useId","register","isPresent","onExitComplete","safeToRemove"],"mappings":"iKAuCM,SAAAA,GAAA,GAGF,MAAAC,EAAAC,aAAAC,EAAAA,iBAEsB,GAAA,OAAAF,EAAA,MAAA,EAAA,EAAA,uDAOtBG,EAAAC,EAAAA,8BAGQ,OAAAC,EAAAF,IAER,CAAAJ,kDAOA,OAAAO,GAAAC,EAAA,EAAA,EAAAC,GAAA,EAAA,EACJ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../events/add-pointer-event.mjs.js"),s=require("../../events/event-info.mjs.js"),e=require("../../utils/get-context-window.mjs.js"),i=require("../../utils/is-ref-object.mjs.js"),n=require("../pan/PanSession.mjs.js"),o=require("./utils/constraints.mjs.js"),r=require("../../../../../motion-dom/dist/es/projection/geometry/models.mjs.js"),a=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),l=require("../../../../../motion-dom/dist/es/projection/utils/each-axis.mjs.js"),c=require("../../../../../motion-utils/dist/es/errors.mjs.js"),u=require("../../../../../motion-dom/dist/es/projection/utils/measure.mjs.js"),h=require("../../../../../motion-dom/dist/es/projection/geometry/conversion.mjs.js"),m=require("../../../../../motion-dom/dist/es/value/will-change/add-will-change.mjs.js"),g=require("../../../../../motion-dom/dist/es/animation/interfaces/motion-value.mjs.js"),d=require("../../../../../motion-dom/dist/es/events/add-dom-event.mjs.js"),p=require("../../../../../motion-dom/dist/es/gestures/drag/state/set-active.mjs.js"),v=require("../../../../../motion-dom/dist/es/value/types/numbers/units.mjs.js"),j=require("../../../../../motion-dom/dist/es/projection/geometry/delta-calc.mjs.js"),f=require("../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),x=require("../../../../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.js"),E=require("../../../../../motion-dom/dist/es/resize/index.mjs.js");const P=new WeakMap;function D(t){let s=!0;return()=>{s?s=!1:t()}}function A(t,s,e){return!(!0!==s&&s!==t||null!==e&&e!==t)}exports.VisualElementDragControls=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=r.createBox(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t){let{snapToCursor:i=!1,distanceThreshold:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:c}=this.getProps();this.panSession=new n.PanSession(t,{onSessionStart:t=>{i&&this.snapToCursor(s.extractEventInfo(t).point),this.stopAnimation()},onStart:(t,s)=>{const{drag:e,dragPropagation:i,onDragStart:n}=this.getProps();if(e&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=p.setDragLock(e),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=s,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),l.eachAxis(t=>{let s=this.getAxisMotionValue(t).get()||0;if(v.percent.test(s)){const{projection:e}=this.visualElement;if(e&&e.layout){const i=e.layout.layoutBox[t];if(i){s=j.calcLength(i)*(parseFloat(s)/100)}}}this.originPoint[t]=s}),n&&a.frame.update(()=>n(t,s),!1,!0),m.addValueToWillChange(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,s)=>{this.latestPointerEvent=t,this.latestPanInfo=s;const{dragPropagation:e,dragDirectionLock:i,onDirectionLock:n,onDrag:o}=this.getProps();if(!e&&!this.openDragLock)return;const{offset:r}=s;if(i&&null===this.currentDirection)return this.currentDirection=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,e=null;Math.abs(t.y)>s?e="y":Math.abs(t.x)>s&&(e="x");return e}(r),void(null!==this.currentDirection&&n&&n(this.currentDirection));this.updateAxis("x",s.point,r),this.updateAxis("y",s.point,r),this.visualElement.render(),o&&a.frame.update(()=>o(t,s),!1,!0)},onSessionEnd:(t,s)=>{this.latestPointerEvent=t,this.latestPanInfo=s,this.stop(t,s),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:o,contextWindow:e.getContextWindow(this.visualElement),element:this.visualElement.current})}stop(t,s){const e=t||this.latestPointerEvent,i=s||this.latestPanInfo,n=this.isDragging;if(this.cancel(),!n||!i||!e)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&a.frame.postRender(()=>r(e,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:e}=this.getProps();!e&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,e){const{drag:i}=this.getProps();if(!e||!A(t,i,this.currentDirection))return;const n=this.getAxisMotionValue(t);let r=this.originPoint[t]+e[t];this.constraints&&this.constraints[t]&&(r=o.applyConstraints(r,this.constraints[t],this.elastic[t])),n.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),e=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&i.isRefObject(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!e)&&o.calcRelativeConstraints(e.layoutBox,t),this.elastic=o.resolveDragElastic(s),n!==this.constraints&&!i.isRefObject(t)&&e&&this.constraints&&!this.hasMutatedConstraints&&l.eachAxis(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=o.rebaseAxisConstraints(e.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!i.isRefObject(t))return!1;const e=t.current;c.invariant(null!==e,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;n.root&&(n.root.scroll=void 0,n.root.updateScroll());const r=u.measurePageBox(e,n.root,this.visualElement.getTransformPagePoint());let a=o.calcViewportConstraints(n.layout.layoutBox,r);if(s){const t=s(h.convertBoxToBoundingBox(a));this.hasMutatedConstraints=!!t,t&&(a=h.convertBoundingBoxToBox(t))}return a}startAnimation(t){const{drag:s,dragMomentum:e,dragElastic:i,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},c=l.eachAxis(r=>{if(!A(r,s,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:e?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(c).then(r)}startAxisValueAnimation(t,s){const e=this.getAxisMotionValue(t);return m.addValueToWillChange(this.visualElement,t),e.start(g.animateMotionValue(t,e,0,s,this.visualElement,!1))}stopAnimation(){l.eachAxis(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,e=this.visualElement.getProps()[s];return e||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){l.eachAxis(s=>{const{drag:e}=this.getProps();if(!A(s,e,this.currentDirection))return;const{projection:i}=this.visualElement,n=this.getAxisMotionValue(s);if(i&&i.layout){const{min:e,max:o}=i.layout.layoutBox[s],r=n.get()||0;n.set(t[s]-f.mixNumber(e,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:e}=this.visualElement;if(!i.isRefObject(s)||!e||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};l.eachAxis(t=>{const s=this.getAxisMotionValue(t);if(s&&!1!==this.constraints){const e=s.get();n[t]=o.calcOrigin({min:e,max:e},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",e.root&&e.root.updateScroll(),e.updateLayout(),this.constraints=!1,this.resolveConstraints(),l.eachAxis(s=>{if(!A(s,t,null))return;const e=this.getAxisMotionValue(s),{min:i,max:o}=this.constraints[s];e.set(f.mixNumber(i,o,n[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;P.set(this.visualElement,this);const s=this.visualElement.current,e=t.addPointerEvent(s,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps(),n=t.target,o=n!==s&&x.isElementTextInput(n);e&&i&&!o&&this.start(t)});let n;const o=()=>{const{dragConstraints:t}=this.getProps();i.isRefObject(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,s,e){const i=E.resize(t,D(e)),n=E.resize(s,D(e));return()=>{i(),n()}}(s,t.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,c=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),a.frame.read(o);const u=d.addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),h=r.addEventListener("didUpdate",t=>{let{delta:s,hasLayoutChanged:e}=t;this.isDragging&&e&&(l.eachAxis(t=>{const e=this.getAxisMotionValue(t);e&&(this.originPoint[t]+=s[t].translate,e.set(e.get()+s[t].translate))}),this.visualElement.render())});return()=>{u(),e(),c(),h&&h(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:e=!1,dragPropagation:i=!1,dragConstraints:n=!1,dragElastic:r=o.defaultElastic,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:e,dragPropagation:i,dragConstraints:n,dragElastic:r,dragMomentum:a}}},exports.elementDragControls=P;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../events/add-pointer-event.mjs.js"),s=require("../../events/event-info.mjs.js"),e=require("../../utils/get-context-window.mjs.js"),i=require("../../utils/is-ref-object.mjs.js"),n=require("../pan/PanSession.mjs.js"),o=require("./utils/constraints.mjs.js"),r=require("../../../../../motion-dom/dist/es/projection/geometry/models.mjs.js"),a=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),l=require("../../../../../motion-dom/dist/es/projection/utils/each-axis.mjs.js"),c=require("../../../../../motion-utils/dist/es/errors.mjs.js"),u=require("../../../../../motion-dom/dist/es/projection/utils/measure.mjs.js"),h=require("../../../../../motion-dom/dist/es/projection/geometry/conversion.mjs.js"),m=require("../../../../../motion-dom/dist/es/value/will-change/add-will-change.mjs.js"),g=require("../../../../../motion-dom/dist/es/animation/interfaces/motion-value.mjs.js"),d=require("../../../../../motion-dom/dist/es/events/add-dom-event.mjs.js"),p=require("../../../../../motion-dom/dist/es/gestures/drag/state/set-active.mjs.js"),v=require("../../../../../motion-dom/dist/es/value/types/numbers/units.mjs.js"),j=require("../../../../../motion-dom/dist/es/projection/geometry/delta-calc.mjs.js"),f=require("../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),x=require("../../../../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.js"),E=require("../../../../../motion-dom/dist/es/resize/index.mjs.js");const P=new WeakMap;function D(t){let s=!0;return()=>{s?s=!1:t()}}function A(t,s,e){return!(!0!==s&&s!==t||null!==e&&e!==t)}exports.VisualElementDragControls=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=r.createBox(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:o}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:c}=this.getProps();this.panSession=new n.PanSession(t,{onSessionStart:t=>{i&&this.snapToCursor(s.extractEventInfo(t).point),this.stopAnimation()},onStart:(t,s)=>{const{drag:e,dragPropagation:i,onDragStart:n}=this.getProps();if(e&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=p.setDragLock(e),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=s,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),l.eachAxis(t=>{let s=this.getAxisMotionValue(t).get()||0;if(v.percent.test(s)){const{projection:e}=this.visualElement;if(e&&e.layout){const i=e.layout.layoutBox[t];if(i){s=j.calcLength(i)*(parseFloat(s)/100)}}}this.originPoint[t]=s}),n&&a.frame.update(()=>n(t,s),!1,!0),m.addValueToWillChange(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,s)=>{this.latestPointerEvent=t,this.latestPanInfo=s;const{dragPropagation:e,dragDirectionLock:i,onDirectionLock:n,onDrag:o}=this.getProps();if(!e&&!this.openDragLock)return;const{offset:r}=s;if(i&&null===this.currentDirection)return this.currentDirection=function(t,s=10){let e=null;Math.abs(t.y)>s?e="y":Math.abs(t.x)>s&&(e="x");return e}(r),void(null!==this.currentDirection&&n&&n(this.currentDirection));this.updateAxis("x",s.point,r),this.updateAxis("y",s.point,r),this.visualElement.render(),o&&a.frame.update(()=>o(t,s),!1,!0)},onSessionEnd:(t,s)=>{this.latestPointerEvent=t,this.latestPanInfo=s,this.stop(t,s),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:o,contextWindow:e.getContextWindow(this.visualElement),element:this.visualElement.current})}stop(t,s){const e=t||this.latestPointerEvent,i=s||this.latestPanInfo,n=this.isDragging;if(this.cancel(),!n||!i||!e)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&a.frame.postRender(()=>r(e,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:e}=this.getProps();!e&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,e){const{drag:i}=this.getProps();if(!e||!A(t,i,this.currentDirection))return;const n=this.getAxisMotionValue(t);let r=this.originPoint[t]+e[t];this.constraints&&this.constraints[t]&&(r=o.applyConstraints(r,this.constraints[t],this.elastic[t])),n.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),e=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&i.isRefObject(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!e)&&o.calcRelativeConstraints(e.layoutBox,t),this.elastic=o.resolveDragElastic(s),n!==this.constraints&&!i.isRefObject(t)&&e&&this.constraints&&!this.hasMutatedConstraints&&l.eachAxis(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=o.rebaseAxisConstraints(e.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!i.isRefObject(t))return!1;const e=t.current;c.invariant(null!==e,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;n.root&&(n.root.scroll=void 0,n.root.updateScroll());const r=u.measurePageBox(e,n.root,this.visualElement.getTransformPagePoint());let a=o.calcViewportConstraints(n.layout.layoutBox,r);if(s){const t=s(h.convertBoxToBoundingBox(a));this.hasMutatedConstraints=!!t,t&&(a=h.convertBoundingBoxToBox(t))}return a}startAnimation(t){const{drag:s,dragMomentum:e,dragElastic:i,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},c=l.eachAxis(r=>{if(!A(r,s,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:e?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(c).then(r)}startAxisValueAnimation(t,s){const e=this.getAxisMotionValue(t);return m.addValueToWillChange(this.visualElement,t),e.start(g.animateMotionValue(t,e,0,s,this.visualElement,!1))}stopAnimation(){l.eachAxis(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,e=this.visualElement.getProps()[s];return e||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){l.eachAxis(s=>{const{drag:e}=this.getProps();if(!A(s,e,this.currentDirection))return;const{projection:i}=this.visualElement,n=this.getAxisMotionValue(s);if(i&&i.layout){const{min:e,max:o}=i.layout.layoutBox[s],r=n.get()||0;n.set(t[s]-f.mixNumber(e,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:e}=this.visualElement;if(!i.isRefObject(s)||!e||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};l.eachAxis(t=>{const s=this.getAxisMotionValue(t);if(s&&!1!==this.constraints){const e=s.get();n[t]=o.calcOrigin({min:e,max:e},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",e.root&&e.root.updateScroll(),e.updateLayout(),this.constraints=!1,this.resolveConstraints(),l.eachAxis(s=>{if(!A(s,t,null))return;const e=this.getAxisMotionValue(s),{min:i,max:o}=this.constraints[s];e.set(f.mixNumber(i,o,n[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;P.set(this.visualElement,this);const s=this.visualElement.current,e=t.addPointerEvent(s,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps(),n=t.target,o=n!==s&&x.isElementTextInput(n);e&&i&&!o&&this.start(t)});let n;const o=()=>{const{dragConstraints:t}=this.getProps();i.isRefObject(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,s,e){const i=E.resize(t,D(e)),n=E.resize(s,D(e));return()=>{i(),n()}}(s,t.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,c=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),a.frame.read(o);const u=d.addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),h=r.addEventListener("didUpdate",({delta:t,hasLayoutChanged:s})=>{this.isDragging&&s&&(l.eachAxis(s=>{const e=this.getAxisMotionValue(s);e&&(this.originPoint[s]+=t[s].translate,e.set(e.get()+t[s].translate))}),this.visualElement.render())});return()=>{u(),e(),c(),h&&h(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:e=!1,dragPropagation:i=!1,dragConstraints:n=!1,dragElastic:r=o.defaultElastic,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:e,dragPropagation:i,dragConstraints:n,dragElastic:r,dragMomentum:a}}},exports.elementDragControls=P;
2
2
  //# sourceMappingURL=VisualElementDragControls.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VisualElementDragControls.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs"],"sourcesContent":["import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, addDomEvent, setDragLock, percent, calcLength, resize, isElementTextInput } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\n\nconst elementDragControls = new WeakMap();\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n this.stopAnimation();\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true);\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true);\n }\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps();\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 });\n }\n };\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.endPanSession();\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined;\n projection.root.updateScroll();\n }\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin === true ||\n dragSnapToOrigin === axis)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false;\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render();\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n const target = event.target;\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild = target !== element && isElementTextInput(target);\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event);\n }\n });\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers;\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());\n }\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n stopResizeObservers && stopResizeObservers();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction skipFirstCall(callback) {\n let isFirst = true;\n return () => {\n if (isFirst) {\n isFirst = false;\n return;\n }\n callback();\n };\n}\nfunction startResizeObservers(element, constraintsElement, onResize) {\n const stopElement = resize(element, skipFirstCall(onResize));\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize));\n return () => {\n stopElement();\n stopContainer();\n };\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n//# sourceMappingURL=VisualElementDragControls.mjs.map\n"],"names":["elementDragControls","WeakMap","skipFirstCall","callback","isFirst","shouldDrag","direction","drag","currentDirection","constructor","visualElement","this","openDragLock","isDragging","originPoint","x","y","constraints","hasMutatedConstraints","elastic","createBox","latestPointerEvent","latestPanInfo","start","originEvent","snapToCursor","distanceThreshold","arguments","length","undefined","presenceContext","isPresent","dragSnapToOrigin","getProps","panSession","PanSession","onSessionStart","event","extractEventInfo","point","stopAnimation","onStart","info","dragPropagation","onDragStart","setDragLock","resolveConstraints","projection","isAnimationBlocked","target","eachAxis","axis","current","getAxisMotionValue","get","percent","test","layout","measuredAxis","layoutBox","calcLength","parseFloat","frame","update","addValueToWillChange","animationState","setActive","onMove","dragDirectionLock","onDirectionLock","onDrag","offset","lockThreshold","Math","abs","getCurrentDirection","updateAxis","render","onSessionEnd","stop","resumeAnimation","snap","startAnimation","transformPagePoint","getTransformPagePoint","contextWindow","getContextWindow","element","panInfo","finalEvent","finalPanInfo","cancel","velocity","onDragEnd","postRender","endPanSession","end","_point","axisValue","next","applyConstraints","set","dragConstraints","dragElastic","measure","prevConstraints","isRefObject","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","invariant","root","scroll","updateScroll","constraintsBox","measurePageBox","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","convertBoundingBoxToBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","transition","min","max","bounceStiffness","bounceDamping","inertia","type","timeConstant","restDelta","restSpeed","startAxisValueAnimation","Promise","all","then","animateMotionValue","dragKey","toUpperCase","externalMotionValue","getValue","latestValues","mixNumber","scalePositionWithinConstraints","boxProgress","latest","calcOrigin","transformTemplate","style","transform","updateLayout","addListeners","stopPointerListener","addPointerEvent","dragListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","resize","stopContainer","startResizeObservers","stopMeasureLayoutListener","addEventListener","read","stopResizeListener","addDomEvent","window","stopLayoutUpdateListener","_ref","delta","hasLayoutChanged","motionValue","translate","props","defaultElastic"],"mappings":"kgDAsCaA,MAAAA,EAAsB,IAAIC,QAivBvC,SAASC,EAAcC,GACnB,IAAIC,GAAU,EACd,MAAO,KACCA,EACAA,GAAU,EAGdD,IAER,CAeA,SAASE,EACLC,EACAC,EACAC,GAEA,SACc,IAATD,GAAiBA,IAASD,GACL,OAArBE,GAA6BA,IAAqBF,EAE3D,yCAztBIG,WAAAA,CAAYC,GA7BJC,KAAAC,aAAoC,KAE5CD,KAAAE,YAAa,EACLF,KAAAH,iBAAyC,KAEzCG,KAAAG,YAAqB,CAAEC,EAAG,EAAGC,EAAG,GAKhCL,KAAAM,aAA2C,EAE3CN,KAAAO,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pK,KAAK0I,kCAOH2B,EAA2BjI,EAAY4H,iBACzC,YACCM,IAAkD,IAAjDC,MAAEA,EAAKC,iBAAEA,GAAoCF,EACvCtK,KAAKE,YAAcsK,IACnBjI,EAAAA,SAAUC,IACN,MAAMiI,EAAczK,KAAK0C,mBAAmBF,GACvCiI,IAELzK,KAAKG,YAAYqC,IAAS+H,EAAM/H,GAAMkI,UACtCD,EAAY/E,IACR+E,EAAY9H,MAAQ4H,EAAM/H,GAAMkI,cAIxC1K,KAAKD,cAAcmE,YAK/B,MAAO,KACHgG,IACAf,IACAY,IACAM,GAA4BA,IAC5Bb,GAAuBA,IAE/B,CAEAlI,QAAAA,GACI,MAAMqJ,EAAQ3K,KAAKD,cAAcuB,YAC3B1B,KACFA,GAAO,EAAK6D,kBACZA,GAAoB,EAAKzB,gBACzBA,GAAkB,EAAK2D,gBACvBA,GAAkB,EAAKC,YACvBA,EAAcgF,EAAcA,eAAA3D,aAC5BA,GAAe,GACf0D,EACJ,MAAO,IACAA,EACH/K,OACA6D,oBACAzB,kBACA2D,kBACAC,cACAqB,eAER"}
1
+ {"version":3,"file":"VisualElementDragControls.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs"],"sourcesContent":["import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, addDomEvent, setDragLock, percent, calcLength, resize, isElementTextInput } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\n\nconst elementDragControls = new WeakMap();\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n this.stopAnimation();\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true);\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true);\n }\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps();\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 });\n }\n };\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.endPanSession();\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined;\n projection.root.updateScroll();\n }\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin === true ||\n dragSnapToOrigin === axis)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false;\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render();\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n const target = event.target;\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild = target !== element && isElementTextInput(target);\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event);\n }\n });\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers;\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());\n }\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n stopResizeObservers && stopResizeObservers();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction skipFirstCall(callback) {\n let isFirst = true;\n return () => {\n if (isFirst) {\n isFirst = false;\n return;\n }\n callback();\n };\n}\nfunction startResizeObservers(element, constraintsElement, onResize) {\n const stopElement = resize(element, skipFirstCall(onResize));\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize));\n return () => {\n stopElement();\n stopContainer();\n };\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n//# sourceMappingURL=VisualElementDragControls.mjs.map\n"],"names":["elementDragControls","WeakMap","skipFirstCall","callback","isFirst","shouldDrag","direction","drag","currentDirection","constructor","visualElement","this","openDragLock","isDragging","originPoint","x","y","constraints","hasMutatedConstraints","elastic","createBox","latestPointerEvent","latestPanInfo","start","originEvent","snapToCursor","distanceThreshold","presenceContext","isPresent","dragSnapToOrigin","getProps","panSession","PanSession","onSessionStart","event","extractEventInfo","point","stopAnimation","onStart","info","dragPropagation","onDragStart","setDragLock","resolveConstraints","projection","isAnimationBlocked","target","undefined","eachAxis","axis","current","getAxisMotionValue","get","percent","test","layout","measuredAxis","layoutBox","calcLength","parseFloat","frame","update","addValueToWillChange","animationState","setActive","onMove","dragDirectionLock","onDirectionLock","onDrag","offset","lockThreshold","Math","abs","getCurrentDirection","updateAxis","render","onSessionEnd","stop","resumeAnimation","snap","startAnimation","transformPagePoint","getTransformPagePoint","contextWindow","getContextWindow","element","panInfo","finalEvent","finalPanInfo","cancel","velocity","onDragEnd","postRender","endPanSession","end","_point","axisValue","next","applyConstraints","set","dragConstraints","dragElastic","measure","prevConstraints","isRefObject","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","invariant","root","scroll","updateScroll","constraintsBox","measurePageBox","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","convertBoundingBoxToBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","transition","min","max","bounceStiffness","bounceDamping","inertia","type","timeConstant","restDelta","restSpeed","startAxisValueAnimation","Promise","all","then","animateMotionValue","dragKey","toUpperCase","externalMotionValue","getValue","latestValues","mixNumber","scalePositionWithinConstraints","boxProgress","latest","calcOrigin","transformTemplate","style","transform","updateLayout","addListeners","stopPointerListener","addPointerEvent","dragListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","resize","stopContainer","startResizeObservers","stopMeasureLayoutListener","addEventListener","read","stopResizeListener","addDomEvent","window","stopLayoutUpdateListener","delta","hasLayoutChanged","motionValue","translate","props","defaultElastic"],"mappings":"kgDAsCaA,MAAAA,EAAsB,IAAIC,QAivBvC,SAASC,EAAcC,GACnB,IAAIC,GAAU,EACd,MAAO,KACCA,EACAA,GAAU,EAGdD,IAER,CAeA,SAASE,EACLC,EACAC,EACAC,GAEA,SACc,IAATD,GAAiBA,IAASD,GACL,OAArBE,GAA6BA,IAAqBF,EAE3D,yCAztBIG,WA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AAAA,YAAYC,OAAQ,SAAU,IACrDlK,KAAKwI,kCAOH2B,EAA2BlI,EAAY6H,iBACzC,YACC,EAAGM,QAAOC,uBACHrK,KAAKE,YAAcmK,IACnBhI,EAAAA,SAAUC,IACN,MAAMgI,EAActK,KAAKwC,mBAAmBF,GACvCgI,IAELtK,KAAKG,YAAYmC,IAAS8H,EAAM9H,GAAMiI,UACtCD,EAAY9E,IACR8E,EAAY7H,MAAQ2H,EAAM9H,GAAMiI,cAIxCvK,KAAKD,cAAciE,YAK/B,MAAO,KACHgG,IACAf,IACAY,IACAM,GAA4BA,IAC5Bb,GAAuBA,IAE/B,CAEAnI,QAAAA,GACI,MAAMqJ,EAAQxK,KAAKD,cAAcoB,YAC3BvB,KACFA,GAAO,EAAK2D,kBACZA,GAAoB,EAAK1B,gBACzBA,GAAkB,EAAK4D,gBACvBA,GAAkB,EAAKC,YACvBA,EAAc+E,EAAcA,eAAA1D,aAC5BA,GAAe,GACfyD,EACJ,MAAO,IACAA,EACH5K,OACA2D,oBACA1B,kBACA4D,kBACAC,cACAqB,eAER"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),i=require("../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.mjs.js"),e=require("../../../../../../motion-utils/dist/es/progress.mjs.js"),n=require("../../../../../../motion-utils/dist/es/clamp.mjs.js");function r(t,i,e){return{min:void 0!==i?t.min+i:void 0,max:void 0!==e?t.max+e-(t.max-t.min):void 0}}function o(t,i){let e=i.min-t.min,n=i.max-t.max;return i.max-i.min<t.max-t.min&&([e,n]=[n,e]),{min:e,max:n}}const s=.35;function m(t,i,e){return{min:a(t,i),max:a(t,e)}}function a(t,i){return"number"==typeof t?t:t[i]||0}exports.applyConstraints=function(i,e,n){let{min:r,max:o}=e;return void 0!==r&&i<r?i=n?t.mixNumber(r,i,n.min):Math.max(i,r):void 0!==o&&i>o&&(i=n?t.mixNumber(o,i,n.max):Math.min(i,o)),i},exports.calcOrigin=function(t,r){let o=.5;const s=i.calcLength(t),m=i.calcLength(r);return m>s?o=e.progress(r.min,r.max-s,t.min):s>m&&(o=e.progress(t.min,t.max-m,r.min)),n.clamp(0,1,o)},exports.calcRelativeAxisConstraints=r,exports.calcRelativeConstraints=function(t,i){let{top:e,left:n,bottom:o,right:s}=i;return{x:r(t.x,n,s),y:r(t.y,e,o)}},exports.calcViewportAxisConstraints=o,exports.calcViewportConstraints=function(t,i){return{x:o(t.x,i.x),y:o(t.y,i.y)}},exports.defaultElastic=s,exports.rebaseAxisConstraints=function(t,i){const e={};return void 0!==i.min&&(e.min=i.min-t.min),void 0!==i.max&&(e.max=i.max-t.min),e},exports.resolveAxisElastic=m,exports.resolveDragElastic=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return!1===t?t=0:!0===t&&(t=s),{x:m(t,"left","right"),y:m(t,"top","bottom")}},exports.resolvePointElastic=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),i=require("../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.mjs.js"),n=require("../../../../../../motion-utils/dist/es/progress.mjs.js"),e=require("../../../../../../motion-utils/dist/es/clamp.mjs.js");function r(t,i,n){return{min:void 0!==i?t.min+i:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function o(t,i){let n=i.min-t.min,e=i.max-t.max;return i.max-i.min<t.max-t.min&&([n,e]=[e,n]),{min:n,max:e}}const s=.35;function m(t,i,n){return{min:a(t,i),max:a(t,n)}}function a(t,i){return"number"==typeof t?t:t[i]||0}exports.applyConstraints=function(i,{min:n,max:e},r){return void 0!==n&&i<n?i=r?t.mixNumber(n,i,r.min):Math.max(i,n):void 0!==e&&i>e&&(i=r?t.mixNumber(e,i,r.max):Math.min(i,e)),i},exports.calcOrigin=function(t,r){let o=.5;const s=i.calcLength(t),m=i.calcLength(r);return m>s?o=n.progress(r.min,r.max-s,t.min):s>m&&(o=n.progress(t.min,t.max-m,r.min)),e.clamp(0,1,o)},exports.calcRelativeAxisConstraints=r,exports.calcRelativeConstraints=function(t,{top:i,left:n,bottom:e,right:o}){return{x:r(t.x,n,o),y:r(t.y,i,e)}},exports.calcViewportAxisConstraints=o,exports.calcViewportConstraints=function(t,i){return{x:o(t.x,i.x),y:o(t.y,i.y)}},exports.defaultElastic=s,exports.rebaseAxisConstraints=function(t,i){const n={};return void 0!==i.min&&(n.min=i.min-t.min),void 0!==i.max&&(n.max=i.max-t.min),n},exports.resolveAxisElastic=m,exports.resolveDragElastic=function(t=.35){return!1===t?t=0:!0===t&&(t=s),{x:m(t,"left","right"),y:m(t,"top","bottom")}},exports.resolvePointElastic=a;
2
2
  //# sourceMappingURL=constraints.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constraints.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs"],"sourcesContent":["import { mixNumber, calcLength } from 'motion-dom';\nimport { progress, clamp } from 'motion-utils';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n//# sourceMappingURL=constraints.mjs.map\n"],"names":["calcRelativeAxisConstraints","axis","min","max","undefined","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","point","_ref","elastic","mixNumber","Math","source","target","origin","sourceLength","calcLength","targetLength","calcProgress","clamp","layoutBox","_ref2","top","left","bottom","right","x","y","constraintsBox","layout","constraints","relativeConstraints","arguments","length"],"mappings":"+WA6DgBA,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAO,CACHD,SAAaE,IAARF,EAAoBD,EAAKC,IAAMA,OAAME,EAC1CD,SACYC,IAARD,EACMF,EAAKE,IAAMA,GAAOF,EAAKE,IAAMF,EAAKC,UAClCE,EAElB,CAmBM,SAAUC,EACZC,EACAC,GAEA,IAAIL,EAAMK,EAAgBL,IAAMI,EAAWJ,IACvCC,EAAMI,EAAgBJ,IAAMG,EAAWH,IAW3C,OANII,EAAgBJ,IAAMI,EAAgBL,IACtCI,EAAWH,IAAMG,EAAWJ,OAE1BA,EAAKC,GAAO,CAACA,EAAKD,IAGjB,CAAEA,MAAKC,MAClB,CAqFO,MAAMK,EAAiB,IAmBdC,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAO,CACHV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oC,EAAYpC,IAAMmC,EAAOnC,UAG/BE,IAApBkC,EAAYnC,MACZoC,EAAoBpC,IAAMmC,EAAYnC,IAAMkC,EAAOnC,KAGhDqC,CACX,0DAMM,WACuC,IAAzC7B,EAAA8B,UAAAC,OAAA,QAAArC,IAAAoC,UAAA,GAAAA,UAAA,GAA2BhC,EAQ3B,OANoB,IAAhBE,EACAA,EAAc,GACS,IAAhBA,IACPA,EAAcF,GAGX,CACH0B,EAAGzB,EAAmBC,EAAa,OAAQ,SAC3CyB,EAAG1B,EAAmBC,EAAa,MAAO,UAElD"}
1
+ {"version":3,"file":"constraints.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs"],"sourcesContent":["import { mixNumber, calcLength } from 'motion-dom';\nimport { progress, clamp } from 'motion-utils';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n//# sourceMappingURL=constraints.mjs.map\n"],"names":["calcRelativeAxisConstraints","axis","min","max","undefined","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","point","elastic","mixNumber","Math","source","target","origin","sourceLength","calcLength","targetLength","calcProgress","clamp","layoutBox","top","left","bottom","right","x","y","constraintsBox","layout","constraints","relativeConstraints"],"mappings":"+WA6DgBA,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAO,CACHD,SAAaE,IAARF,EAAoBD,EAAKC,IAAMA,OAAME,EAC1CD,SACYC,IAARD,EACMF,EAAKE,IAAMA,GAAOF,EAAKE,IAAMF,EAAKC,UAClCE,EAElB,CAmBM,SAAUC,EACZC,EACAC,GAEA,IAAIL,EAAMK,EAAgBL,IAAMI,EAAWJ,IACvCC,EAAMI,EAAgBJ,IAAMG,EAAWH,IAW3C,OANII,EAAgBJ,IAAMI,EAAgBL,IACtCI,EAAWH,IAAMG,EAAWJ,OAE1BA,EAAKC,GAAO,CAACA,EAAKD,IAGjB,CAAEA,MAAKC,MAClB,CAqFO,MAAMK,EAAiB,IAmBdC,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAO,CACHV,IAAKW,EAAoBH,EAAaC,GACtCR,IAAKU,EAAoBH,EAAaE,GAE9C,CAEM,SAAUC,EACZH,EACAI,GAEA,MAA8B,iBAAhBJ,EACRA,EACAA,EAAYI,IAAsC,CAC5D,0BAxNM,SACFC,GACAb,IAAEA,EAAGC,IAAEA,GACPa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SAC3CuB,EAAGxB,EAAmBC,EAAa,MAAO,UAElD"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../events/add-pointer-event.mjs.js"),e=require("../../events/event-info.mjs.js"),s=require("../../utils/distance.mjs.js"),n=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),o=require("../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.js"),i=require("../../../../../motion-utils/dist/es/pipe.mjs.js"),r=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js");const l=new Set(["auto","scroll"]);function a(t,e){return e?{point:e(t.point)}:t}function h(t,e){return{x:t.x-e.x,y:t.y-e.y}}function c(t,e){let{point:s}=t;return{point:s,delta:h(s,v(e)),offset:h(s,d(e)),velocity:m(e,.1)}}function d(t){return t[0]}function v(t){return t[t.length-1]}function m(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const o=v(t);for(;s>=0&&(n=t[s],!(o.timestamp-n.timestamp>r.secondsToMilliseconds(e)));)s--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&o.timestamp-n.timestamp>2*r.secondsToMilliseconds(e)&&(n=t[1]);const i=r.millisecondsToSeconds(o.timestamp-n.timestamp);if(0===i)return{x:0,y:0};const l={x:(o.x-n.x)/i,y:(o.y-n.y)/i};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}exports.PanSession=class{constructor(r,l){let{transformPagePoint:h,contextWindow:d=window,dragSnapToOrigin:v=!1,distanceThreshold:m=3,element:p}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=a(this.lastRawMoveEventInfo,this.transformPagePoint));const t=c(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,o=s.distance2D(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!o)return;const{point:i}=t,{timestamp:r}=n.frameData;this.history.push({...i,timestamp:r});const{onStart:l,onMove:h}=this.handlers;e||(l&&l(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=a(e,this.transformPagePoint),n.frame.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:s,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=c("pointercancel"===t.type?this.lastMoveEventInfo:a(e,this.transformPagePoint),this.history);this.startEvent&&s&&s(t,i),n&&n(t,i)},!o.isPrimaryPointer(r))return;this.dragSnapToOrigin=v,this.handlers=l,this.transformPagePoint=h,this.distanceThreshold=m,this.contextWindow=d||window;const u=a(e.extractEventInfo(r),this.transformPagePoint),{point:f}=u,{timestamp:w}=n.frameData;this.history=[{...f,timestamp:w}];const{onSessionStart:E}=l;E&&E(r,c(u,this.history));const y={passive:!0,capture:!0};this.removeListeners=i.pipe(t.addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove,y),t.addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp,y),t.addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp,y)),p&&this.startScrollTracking(p)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(l.has(t.overflowX)||l.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const s=t===window,o=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i=o.x-e.x,r=o.y-e.y;0===i&&0===r||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=r):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=r),this.scrollPositions.set(t,o),n.frame.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),n.cancelFrame(this.updatePoint)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../events/add-pointer-event.mjs.js"),e=require("../../events/event-info.mjs.js"),s=require("../../utils/distance.mjs.js"),n=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),o=require("../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.js"),i=require("../../../../../motion-utils/dist/es/pipe.mjs.js"),r=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js");const l=new Set(["auto","scroll"]);function a(t,e){return e?{point:e(t.point)}:t}function h(t,e){return{x:t.x-e.x,y:t.y-e.y}}function c({point:t},e){return{point:t,delta:h(t,v(e)),offset:h(t,d(e)),velocity:m(e,.1)}}function d(t){return t[0]}function v(t){return t[t.length-1]}function m(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const o=v(t);for(;s>=0&&(n=t[s],!(o.timestamp-n.timestamp>r.secondsToMilliseconds(e)));)s--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&o.timestamp-n.timestamp>2*r.secondsToMilliseconds(e)&&(n=t[1]);const i=r.millisecondsToSeconds(o.timestamp-n.timestamp);if(0===i)return{x:0,y:0};const l={x:(o.x-n.x)/i,y:(o.y-n.y)/i};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}exports.PanSession=class{constructor(r,l,{transformPagePoint:h,contextWindow:d=window,dragSnapToOrigin:v=!1,distanceThreshold:m=3,element:p}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=a(this.lastRawMoveEventInfo,this.transformPagePoint));const t=c(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,o=s.distance2D(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!o)return;const{point:i}=t,{timestamp:r}=n.frameData;this.history.push({...i,timestamp:r});const{onStart:l,onMove:h}=this.handlers;e||(l&&l(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=a(e,this.transformPagePoint),n.frame.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:s,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=c("pointercancel"===t.type?this.lastMoveEventInfo:a(e,this.transformPagePoint),this.history);this.startEvent&&s&&s(t,i),n&&n(t,i)},!o.isPrimaryPointer(r))return;this.dragSnapToOrigin=v,this.handlers=l,this.transformPagePoint=h,this.distanceThreshold=m,this.contextWindow=d||window;const u=a(e.extractEventInfo(r),this.transformPagePoint),{point:f}=u,{timestamp:w}=n.frameData;this.history=[{...f,timestamp:w}];const{onSessionStart:E}=l;E&&E(r,c(u,this.history));const y={passive:!0,capture:!0};this.removeListeners=i.pipe(t.addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove,y),t.addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp,y),t.addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp,y)),p&&this.startScrollTracking(p)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(l.has(t.overflowX)||l.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const s=t===window,o=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i=o.x-e.x,r=o.y-e.y;0===i&&0===r||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=r):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=r),this.scrollPositions.set(t,o),n.frame.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),n.cancelFrame(this.updatePoint)}};
2
2
  //# sourceMappingURL=PanSession.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PanSession.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs"],"sourcesContent":["import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true };\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp, eventOptions));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n//# sourceMappingURL=PanSession.mjs.map\n"],"names":["overflowStyles","Set","transformPoint","info","transformPagePoint","point","subtractPoint","a","b","x","y","getPanInfo","_ref","history","delta","lastDevicePoint","offset","startDevicePoint","velocity","getVelocity","length","timeDelta","i","timestampedPoint","lastPoint","timestamp","secondsToMilliseconds","time","millisecondsToSeconds","currentVelocity","Infinity","constructor","event","handlers","contextWindow","window","dragSnapToOrigin","distanceThreshold","element","arguments","undefined","this","startEvent","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","Map","removeScrollListeners","onElementScroll","handleScroll","target","onWindowScroll","updatePoint","isPanStarted","isDistancePastThreshold","distance2D","frameData","push","onStart","onMove","handlePointerMove","frame","update","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","type","isPrimaryPointer","initialInfo","extractEventInfo","onSessionStart","eventOptions","passive","capture","removeListeners","pipe","addPointerEvent","startScrollTracking","current","parentElement","style","getComputedStyle","has","overflowX","overflowY","set","scrollLeft","scrollTop","scrollX","scrollY","addEventListener","removeEventListener","initial","get","isWindow","updateHandlers","clear","cancelFrame"],"mappings":"mfAuCA,MAAMA,EAA+B,IAAIC,IAAI,CAAC,OAAQ,WA2TtD,SAASC,EACLC,EACAC,GAEA,OAAOA,EAAqB,CAAEC,MAAOD,EAAmBD,EAAKE,QAAWF,CAC5E,CAEA,SAASG,EAAcC,EAAUC,GAC7B,MAAO,CAAEC,EAAGF,EAAEE,EAAID,EAAEC,EAAGC,EAAGH,EAAEG,EAAIF,EAAEE,EACtC,CAEA,SAASC,EAAUC,EAAuBC,GAA2B,IAAjDR,MAAEA,GAAkBO,EACpC,MAAO,CACHP,QACAS,MAAOR,EAAcD,EAAOU,EAAgBF,IAC5CG,OAAQV,EAAcD,EAAOY,EAAiBJ,IAC9CK,SAAUC,EAAYN,EAAS,IAEvC,CAEA,SAASI,EAAiBJ,GACtB,OAAOA,EAAQ,EACnB,CAEA,SAASE,EAAgBF,GACrB,OAAOA,EAAQA,EAAQO,OAAS,EACpC,CAEA,SAASD,EAAYN,EAA6BQ,GAC9C,GAAIR,EAAQO,OAAS,EACjB,MAAO,CAAEX,EAAG,EAAGC,EAAG,GAGtB,IAAIY,EAAIT,EA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AS,IAEb1C,OAAO4D,oBAAoB,SAAUtD,KAAKW,gBAElD,CAgBQF,YAAAA,CAAaC,GACjB,MAAM6C,EAAUvD,KAAKK,gBAAgBmD,IAAI9C,GACzC,IAAK6C,EAAS,OAEd,MAAME,EAAW/C,IAAWhB,OACtB+C,EAAUgB,EACV,CAAEzF,EAAG0B,OAAOyD,QAASlF,EAAGyB,OAAO0D,SAC/B,CACIpF,EAAI0C,EAAmBuC,WACvBhF,EAAIyC,EAAmBwC,WAG3B7E,EAAaoE,EAAQzE,EAAIuF,EAAQvF,EAAjCK,EAAuCoE,EAAQxE,EAAIsF,EAAQtF,EACjD,IAAZI,GAA6B,IAAZA,IAEjBoF,EAEIzD,KAAKG,oBACLH,KAAKG,kBAAkBvC,MAAMI,GAAKK,EAClC2B,KAAKG,kBAAkBvC,MAAMK,GAAKI,GAIlC2B,KAAK5B,QAAQO,OAAS,IACtBqB,KAAK5B,QAAQ,GAAGJ,GAAKK,EACrB2B,KAAK5B,QAAQ,GAAGH,GAAKI,GAI7B2B,KAAKK,gBAAgB2C,IAAItC,EAAQ+B,GACjCpB,EAAAA,MAAMC,OAAOtB,KAAKY,aAAa,GACnC,CA0EA8C,cAAAA,CAAelE,GACXQ,KAAKR,SAAWA,CACpB,CAEAgC,GAAAA,GACIxB,KAAKqC,iBAAmBrC,KAAKqC,kBAC7BrC,KAAKO,uBAAyBP,KAAKO,wBACnCP,KAAKK,gBAAgBsD,QACrBC,cAAY5D,KAAKY,YACrB"}
1
+ {"version":3,"file":"PanSession.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs"],"sourcesContent":["import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true };\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp, eventOptions));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n//# sourceMappingURL=PanSession.mjs.map\n"],"names":["overflowStyles","Set","transformPoint","info","transformPagePoint","point","subtractPoint","a","b","x","y","getPanInfo","history","delta","lastDevicePoint","offset","startDevicePoint","velocity","getVelocity","length","timeDelta","i","timestampedPoint","lastPoint","timestamp","secondsToMilliseconds","time","millisecondsToSeconds","currentVelocity","Infinity","constructor","event","handlers","contextWindow","window","dragSnapToOrigin","distanceThreshold","element","this","startEvent","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","Map","removeScrollListeners","onElementScroll","handleScroll","target","onWindowScroll","updatePoint","isPanStarted","isDistancePastThreshold","distance2D","frameData","push","onStart","onMove","handlePointerMove","frame","update","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","type","isPrimaryPointer","initialInfo","extractEventInfo","onSessionStart","eventOptions","passive","capture","removeListeners","pipe","addPointerEvent","startScrollTracking","current","parentElement","style","getComputedStyle","has","overflowX","overflowY","set","scrollLeft","scrollTop","scrollX","scrollY","addEventListener","removeEventListener","initial","get","isWindow","updateHandlers","clear","cancelFrame"],"mappings":"mfAuCA,MAAMA,EAA+B,IAAIC,IAAI,CAAC,OAAQ,WA2TtD,SAASC,EACLC,EACAC,GAEA,OAAOA,EAAqB,CAAEC,MAAOD,EAAmBD,EAAKE,QAAWF,CAC5E,CAEA,SAASG,EAAcC,EAAUC,GAC7B,MAAO,CAAEC,EAAGF,EAAEE,EAAID,EAAEC,EAAGC,EAAGH,EAAEG,EAAIF,EAAEE,EACtC,CAEA,SAASC,GAAWN,MAAEA,GAAoBO,GACtC,MAAO,CACHP,QACAQ,MAAOP,EAAcD,EAAOS,EAAgBF,IAC5CG,OAAQT,EAAcD,EAAOW,EAAiBJ,IAC9CK,SAAUC,EAAYN,EAAS,IAEvC,CAEA,SAASI,EAAiBJ,GACtB,OAAOA,EAAQ,EACnB,CAEA,SAASE,EAAgBF,GACrB,OAAOA,EAAQA,EAAQO,OAAS,EACpC,CAEA,SAASD,EAAYN,EAA6BQ,GAC9C,GAAIR,EAAQO,OAAS,EACjB,MAAO,CAAEV,EAAG,EAAGC,EAAG,GAGtB,IAAIW,EAAIT,EAAQO,OAAS,EACrBG,EAA4C,KAChD,MAAMC,EAAYT,EAAgBF,GAClC,KAAOS,GAAK,IACRC,EAAmBV,EAAQS,KAEvB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IAAWd,OACtB6C,EAAUgB,EACV,CAAEtF,EAAGyB,OAAOuD,QAAS/E,EAAGwB,OAAOwD,SAC/B,CACIjF,EAAIuC,EAAmBuC,WACvB7E,EAAIsC,EAAmBwC,WAG3B3E,EAAakE,EAAQtE,EAAIoF,EAAQpF,EAAjCI,EAAuCkE,EAAQrE,EAAImF,EAAQnF,EACjD,IAAZG,GAA6B,IAAZA,IAEjBkF,EAEIzD,KAAKG,oBACLH,KAAKG,kBAAkBpC,MAAMI,GAAKI,EAClCyB,KAAKG,kBAAkBpC,MAAMK,GAAKG,GAIlCyB,KAAK1B,QAAQO,OAAS,IACtBmB,KAAK1B,QAAQ,GAAGH,GAAKI,EACrByB,KAAK1B,QAAQ,GAAGF,GAAKG,GAI7ByB,KAAKK,gBAAgB2C,IAAItC,EAAQ+B,GACjCpB,EAAAA,MAAMC,OAAOtB,KAAKY,aAAa,GACnC,CA0EA8C,cAAAA,CAAehE,GACXM,KAAKN,SAAWA,CACpB,CAEA8B,GAAAA,GACIxB,KAAKqC,iBAAmBrC,KAAKqC,kBAC7BrC,KAAKO,uBAAyBP,KAAKO,wBACnCP,KAAKK,gBAAgBsD,QACrBC,cAAY5D,KAAKY,YACrB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../events/event-info.mjs.js"),t=require("../../../../motion-dom/dist/es/render/Feature.mjs.js"),s=require("../../../../motion-dom/dist/es/gestures/press/index.mjs.js"),r=require("../../../../motion-dom/dist/es/frameloop/frame.mjs.js");function n(t,s,n){const{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap","Start"===n);const a=o["onTap"+("End"===n?"":n)];a&&r.frame.postRender(()=>a(s,e.extractEventInfo(s)))}class o extends t.Feature{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:r}=this.node.props;this.unmount=s.press(e,(e,t)=>(n(this.node,t,"Start"),(e,t)=>{let{success:s}=t;return n(this.node,e,s?"End":"Cancel")}),{useGlobalTarget:t,stopPropagation:!1===r?.tap})}unmount(){}}exports.PressGesture=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../events/event-info.mjs.js"),t=require("../../../../motion-dom/dist/es/render/Feature.mjs.js"),s=require("../../../../motion-dom/dist/es/gestures/press/index.mjs.js"),n=require("../../../../motion-dom/dist/es/frameloop/frame.mjs.js");function r(t,s,r){const{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap","Start"===r);const a=o["onTap"+("End"===r?"":r)];a&&n.frame.postRender(()=>a(s,e.extractEventInfo(s)))}class o extends t.Feature{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=s.press(e,(e,t)=>(r(this.node,t,"Start"),(e,{success:t})=>r(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}exports.PressGesture=o;
2
2
  //# sourceMappingURL=press.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"press.mjs.js","sources":["../../../../../../node_modules/framer-motion/dist/es/gestures/press.mjs"],"sourcesContent":["import { Feature, press, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\n\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n\nexport { PressGesture };\n//# sourceMappingURL=press.mjs.map\n"],"names":["handlePressEvent","node","event","lifecycle","props","current","HTMLButtonElement","disabled","animationState","whileTap","setActive","callback","frame","postRender","extractEventInfo","PressGesture","Feature","mount","this","globalTapTarget","propagate","unmount","press","_element","startEvent","endEvent","_ref","success","useGlobalTarget","stopPropagation","tap"],"mappings":"8TAGA,SAASA,EACLC,EACAC,EACAC,GAEA,MAAMC,MAAEA,GAAUH,EAElB,GAAIA,EAAKI,mBAAmBC,mBAAqBL,EAAKI,QAAQE,SAC1D,OAGAN,EAAKO,gBAAkBJ,EAAMK,UAC7BR,EAAKO,eAAeE,UAAU,WAA0B,UAAdP,GAG9C,MAKMQ,EAAWP,EALE,SAAyB,QAAdD,EAAsB,GAAKA,IAMrDQ,GACAC,EAAKA,MAACC,WAAW,IAAMF,EAAST,EAAOY,mBAAiBZ,IAEhE,CAEM,MAAOa,UAAqBC,EAAAA,QAC9BC,KAAAA,GACI,MAAMZ,QAAEA,GAAYa,KAAKjB,KACzB,IAAKI,EAAS,OAEd,MAAMc,gBAAEA,EAAeC,UAAEA,GAAcF,KAAKjB,KAAKG,MAEjDc,KAAKG,QAAUC,EAAKA,MAChBjB,EACA,CAACkB,EAAUC,KACPxB,EAAiBkB,KAAKjB,KAAMuB,EAAY,SAEjC,CAACC,EAAQC,KAAA,IAAEC,QAAEA,GAASD,EAAA,OACzB1B,EACIkB,KAAKjB,KACLwB,EACAE,EAAU,MAAQ,YAG9B,CACIC,gBAAiBT,EACjBU,iBAAoC,IAAnBT,GAAWU,KAGxC,CAEAT,OAAAA,GAAW"}
1
+ {"version":3,"file":"press.mjs.js","sources":["../../../../../../node_modules/framer-motion/dist/es/gestures/press.mjs"],"sourcesContent":["import { Feature, press, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\n\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n\nexport { PressGesture };\n//# sourceMappingURL=press.mjs.map\n"],"names":["handlePressEvent","node","event","lifecycle","props","current","HTMLButtonElement","disabled","animationState","whileTap","setActive","callback","frame","postRender","extractEventInfo","PressGesture","Feature","mount","this","globalTapTarget","propagate","unmount","press","_element","startEvent","endEvent","success","useGlobalTarget","stopPropagation","tap"],"mappings":"8TAGA,SAASA,EACLC,EACAC,EACAC,GAEA,MAAMC,MAAEA,GAAUH,EAElB,GAAIA,EAAKI,mBAAmBC,mBAAqBL,EAAKI,QAAQE,SAC1D,OAGAN,EAAKO,gBAAkBJ,EAAMK,UAC7BR,EAAKO,eAAeE,UAAU,WAA0B,UAAdP,GAG9C,MAKMQ,EAAWP,EALE,SAAyB,QAAdD,EAAsB,GAAKA,IAMrDQ,GACAC,EAAKA,MAACC,WAAW,IAAMF,EAAST,EAAOY,mBAAiBZ,IAEhE,CAEM,MAAOa,UAAqBC,EAAAA,QAC9BC,KAAAA,GACI,MAAMZ,QAAEA,GAAYa,KAAKjB,KACzB,IAAKI,EAAS,OAEd,MAAMc,gBAAEA,EAAeC,UAAEA,GAAcF,KAAKjB,KAAKG,MAEjDc,KAAKG,QAAUC,EAAKA,MAChBjB,EACA,CAACkB,EAAUC,KACPxB,EAAiBkB,KAAKjB,KAAMuB,EAAY,SAEjC,CAACC,GAAYC,aAChB1B,EACIkB,KAAKjB,KACLwB,EACAC,EAAU,MAAQ,WAG9B,CACIC,gBAAiBR,EACjBS,iBAAoC,IAAnBR,GAAWS,KAGxC,CAEAR,OAAAA,GAAW"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./observers.mjs.js"),t=require("../../../../../../motion-dom/dist/es/render/Feature.mjs.js");const r={some:0,all:1};class s extends t.Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:i,amount:o="some",once:n}=t,a={root:s?s.current:void 0,rootMargin:i,threshold:"number"==typeof o?o:r[o]};this.stopObserver=e.observeIntersection(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,n&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:s}=this.node.getProps(),i=t?r:s;i&&i(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node,r=["amount","margin","root"].some(function(e){let{viewport:t={}}=e,{viewport:r={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=>t[e]!==r[e]}(e,t));r&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}exports.InViewFeature=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./observers.mjs.js"),t=require("../../../../../../motion-dom/dist/es/render/Feature.mjs.js");const r={some:0,all:1};class s extends t.Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:i,amount:o="some",once:n}=t,a={root:s?s.current:void 0,rootMargin:i,threshold:"number"==typeof o?o:r[o]};this.stopObserver=e.observeIntersection(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,n&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:s}=this.node.getProps(),i=t?r:s;i&&i(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}exports.InViewFeature=s;
2
2
  //# sourceMappingURL=index.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs"],"sourcesContent":["import { Feature } from 'motion-dom';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.stopObserver?.();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() {\n this.stopObserver?.();\n this.hasEnteredView = false;\n this.isInView = false;\n }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n//# sourceMappingURL=index.mjs.map\n"],"names":["thresholdNames","some","all","InViewFeature","Feature","constructor","this","hasEnteredView","isInView","startObserver","stopObserver","viewport","node","getProps","root","margin","rootMargin","amount","once","options","current","undefined","threshold","observeIntersection","entry","isIntersecting","animationState","setActive","onViewportEnter","onViewportLeave","callback","mount","update","IntersectionObserver","props","prevProps","hasOptionsChanged","_ref","prevViewport","arguments","length","name","hasViewportOptionChanged","unmount"],"mappings":"gLAIA,MAAMA,EAAiB,CACnBC,KAAM,EACNC,IAAK,GAGH,MAAOC,UAAsBC,EAAAA,QAAnCC,WAAAA,uBACYC,KAAAC,gBAAiB,EAEjBD,KAAAE,UAAW,CAkFvB,CA9EYC,aAAAA,GACJH,KAAKI,iBAEL,MAAMC,SAAEA,EAAW,CAAA,GAAOL,KAAKM,KAAKC,YAC9BC,KAAEA,EAAMC,OAAQC,EAAUC,OAAEA,EAAS,OAAMC,KAAEA,GAASP,EAEtDQ,EAAU,CACZL,KAAMA,EAAOA,EAAKM,aAAUC,EAC5BL,aACAM,UACsB,iBAAXL,EAAsBA,EAASjB,EAAeiB,IAuC7DX,KAAKI,aAAea,EAAAA,oBAChBjB,KAAKM,KAAKQ,QACVD,EAtC0BK,IAC1B,MAAMC,eAAEA,GAAmBD,EAK3B,GAAIlB,KAAKE,WAAaiB,EAAgB,OAQtC,GANAnB,KAAKE,SAAWiB,EAMZP,IAASO,GAAkBnB,KAAKC,eAChC,OACOkB,IACPnB,KAAKC,gBAAiB,GAGtBD,KAAKM,KAAKc,gBACVpB,KAAKM,KAAKc,eAAeC,UACrB,cACAF,GAQR,MAAMG,gBAAEA,EAAeC,gBAAEA,GAAoBvB,KAAKM,KAAKC,WACjDiB,EAAWL,EAAiBG,EAAkBC,EACpDC,GAAYA,EAASN,IAQ7B,CAEAO,KAAAA,GACIzB,KAAKG,eACT,CAEAuB,MAAAA,GACI,GAAoC,oBAAzBC,qBAAsC,OAEjD,MAAMC,MAAEA,EAAKC,UAAEA,GAAc7B,KAAKM,KAC5BwB,EAAoB,CAAC,SAAU,SAAU,QAAQnC,KAgB/D,SAAiCoC,GAEoB,IADjD1B,SAAEA,EAAW,CAAA,GAAiB0B,GAC5B1B,SAAU2B,EAAe,CAAA,GAAEC,UAAAC,OAAAD,QAAAlB,IAAAkB,aAAAA,UAAA,GAAkB,GAE/C,OAAQE,GACJ9B,EAAS8B,KAAUH,EAAaG,EACxC,CArBYC,CAAyBR,EAAOC,IAGhCC,GACA9B,KAAKG,eAEb,CAEAkC,OAAAA,GACIrC,KAAKI,iBACLJ,KAAKC,gBAAiB,EACtBD,KAAKE,UAAW,CACpB"}
1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs"],"sourcesContent":["import { Feature } from 'motion-dom';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.stopObserver?.();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() {\n this.stopObserver?.();\n this.hasEnteredView = false;\n this.isInView = false;\n }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n//# sourceMappingURL=index.mjs.map\n"],"names":["thresholdNames","some","all","InViewFeature","Feature","constructor","this","hasEnteredView","isInView","startObserver","stopObserver","viewport","node","getProps","root","margin","rootMargin","amount","once","options","current","undefined","threshold","observeIntersection","entry","isIntersecting","animationState","setActive","onViewportEnter","onViewportLeave","callback","mount","update","IntersectionObserver","props","prevProps","prevViewport","name","hasViewportOptionChanged","unmount"],"mappings":"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B"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=new WeakMap,t=new WeakMap,n=t=>{const n=e.get(t.target);n&&n(t)},o=e=>{e.forEach(n)};exports.observeIntersection=function(n,r,s){const c=function(e){let{root:n,...r}=e;const s=n||document;t.has(s)||t.set(s,{});const c=t.get(s),u=JSON.stringify(r);return c[u]||(c[u]=new IntersectionObserver(o,{root:n,...r})),c[u]}(r);return e.set(n,s),c.observe(n),()=>{e.delete(n),c.unobserve(n)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=new WeakMap,t=new WeakMap,n=t=>{const n=e.get(t.target);n&&n(t)},o=e=>{e.forEach(n)};exports.observeIntersection=function(n,r,s){const c=function({root:e,...n}){const r=e||document;t.has(r)||t.set(r,{});const s=t.get(r),c=JSON.stringify(n);return s[c]||(s[c]=new IntersectionObserver(o,{root:e,...n})),s[c]}(r);return e.set(n,s),c.observe(n),()=>{e.delete(n),c.unobserve(n)}};
2
2
  //# sourceMappingURL=observers.mjs.js.map