@helpdice/draggable 0.0.2 → 0.0.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"draggable.cjs.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/file:/D:/Github/draggable/src/dev-warning.ts","../src/file:/D:/Github/draggable/src/empty.ts","../src/view/event-bindings/file:/D:/Github/draggable/src/view/event-bindings/bind-events.ts","../src/file:/D:/Github/draggable/src/invariant.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/error-boundary.tsx","../src/file:/D:/Github/draggable/src/screen-reader-message-preset.ts","../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js","../node_modules/use-sync-external-store/with-selector.js","../node_modules/react-redux/dist/react-redux.mjs","../node_modules/@helpdice/memoizer/dist/memoizer.esm.js","../node_modules/redux/dist/redux.mjs","../src/state/file:/D:/Github/draggable/src/state/position.ts","../node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../node_modules/css-box-model/dist/css-box-model.esm.js","../src/state/droppable/util/file:/D:/Github/draggable/src/state/droppable/util/clip.ts","../src/state/file:/D:/Github/draggable/src/state/spacing.ts","../src/state/droppable/util/file:/D:/Github/draggable/src/state/droppable/util/get-subject.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/scroll-droppable.ts","../node_modules/memoize-one/dist/memoize-one.esm.js","../src/file:/D:/Github/draggable/src/native-with-fallback.ts","../src/state/file:/D:/Github/draggable/src/state/dimension-structures.ts","../src/state/file:/D:/Github/draggable/src/state/get-draggables-inside-droppable.ts","../src/state/file:/D:/Github/draggable/src/state/get-impact-location.ts","../src/state/file:/D:/Github/draggable/src/state/remove-draggable-from-list.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-combine/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-combine/index.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/is-home-of.ts","../src/state/file:/D:/Github/draggable/src/state/no-impact.ts","../src/state/file:/D:/Github/draggable/src/state/is-within.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-partially-visible-through-frame.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-totally-visible-through-frame.ts","../src/state/file:/D:/Github/draggable/src/state/axis.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-totally-visible-through-frame-on-axis.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-visible.ts","../src/state/file:/D:/Github/draggable/src/state/get-displacement-groups.ts","../src/state/calculate-drag-impact/file:/D:/Github/draggable/src/state/calculate-drag-impact/calculate-reorder-impact.ts","../src/state/file:/D:/Github/draggable/src/state/did-start-after-critical.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-index/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-index/from-combine.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-index/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-index/from-reorder.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-index/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-index/index.ts","../src/state/file:/D:/Github/draggable/src/state/get-combined-item-displacement.ts","../src/state/get-center-from-impact/get-page-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-page-border-box-center/when-combining.ts","../src/state/get-center-from-impact/file:/D:/Github/draggable/src/state/get-center-from-impact/move-relative-to.ts","../src/state/get-center-from-impact/get-page-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-page-border-box-center/when-reordering.ts","../src/state/with-scroll-change/file:/D:/Github/draggable/src/state/with-scroll-change/with-droppable-displacement.ts","../src/state/get-center-from-impact/get-page-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-page-border-box-center/index.ts","../src/state/file:/D:/Github/draggable/src/state/scroll-viewport.ts","../src/state/update-displacement-visibility/file:/D:/Github/draggable/src/state/update-displacement-visibility/speculatively-increase.ts","../src/state/with-scroll-change/file:/D:/Github/draggable/src/state/with-scroll-change/with-viewport-displacement.ts","../src/state/get-center-from-impact/get-client-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center.ts","../src/state/move-in-direction/move-to-next-place/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/is-totally-visible-in-new-location.ts","../src/state/move-in-direction/move-to-next-place/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/index.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/get-best-cross-axis-droppable.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/without-starting-displacement.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/get-closest-draggable.ts","../src/state/file:/D:/Github/draggable/src/state/get-displaced-by.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/with-placeholder.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/move-to-new-droppable.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/index.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/what-is-dragged-over.ts","../src/state/move-in-direction/file:/D:/Github/draggable/src/state/move-in-direction/index.ts","../src/state/file:/D:/Github/draggable/src/state/is-movement-allowed.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-position-in-frame.ts","../src/state/file:/D:/Github/draggable/src/state/get-droppable-over.ts","../src/state/file:/D:/Github/draggable/src/state/rect.ts","../src/state/with-scroll-change/file:/D:/Github/draggable/src/state/with-scroll-change/with-droppable-scroll.ts","../src/state/file:/D:/Github/draggable/src/state/get-is-displaced.ts","../src/state/get-drag-impact/file:/D:/Github/draggable/src/state/get-drag-impact/get-reorder-impact.ts","../src/state/get-drag-impact/file:/D:/Github/draggable/src/state/get-drag-impact/get-combine-impact.ts","../src/state/get-drag-impact/file:/D:/Github/draggable/src/state/get-drag-impact/index.ts","../src/state/file:/D:/Github/draggable/src/state/patch-droppable-map.ts","../src/state/file:/D:/Github/draggable/src/state/recompute-placeholders.ts","../src/state/post-reducer/when-moving/file:/D:/Github/draggable/src/state/post-reducer/when-moving/update.ts","../src/state/update-displacement-visibility/file:/D:/Github/draggable/src/state/update-displacement-visibility/recompute.ts","../src/state/get-center-from-impact/get-client-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-client-border-box-center/index.ts","../src/state/post-reducer/when-moving/file:/D:/Github/draggable/src/state/post-reducer/when-moving/refresh-snap.ts","../src/state/file:/D:/Github/draggable/src/state/get-home-location.ts","../src/state/file:/D:/Github/draggable/src/state/get-lift-effect.ts","../src/state/file:/D:/Github/draggable/src/state/patch-dimension-map.ts","../src/debug/file:/D:/Github/draggable/src/debug/timings.ts","../src/state/publish-while-dragging-in-virtual/file:/D:/Github/draggable/src/state/publish-while-dragging-in-virtual/offset-draggable.ts","../src/state/file:/D:/Github/draggable/src/state/get-frame.ts","../src/state/publish-while-dragging-in-virtual/file:/D:/Github/draggable/src/state/publish-while-dragging-in-virtual/adjust-additions-for-scroll-changes.ts","../src/state/publish-while-dragging-in-virtual/file:/D:/Github/draggable/src/state/publish-while-dragging-in-virtual/index.ts","../src/state/file:/D:/Github/draggable/src/state/reducer.ts","../src/state/file:/D:/Github/draggable/src/state/action-creators.ts","../src/state/middleware/util/file:/D:/Github/draggable/src/state/middleware/util/validate-dimensions.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/lift.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/style.ts","../src/file:/D:/Github/draggable/src/animation.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/get-drop-duration.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/get-new-home-client-offset.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/get-drop-impact.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/drop-middleware.ts","../node_modules/raf-schd/dist/raf-schd.esm.js","../src/view/window/file:/D:/Github/draggable/src/view/window/get-window-scroll.ts","../src/view/file:/D:/Github/draggable/src/view/scroll-listener.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/scroll-listener.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/expiring-announce.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/async-marshal.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/is-equal.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/publisher.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/responders-middleware.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/drop-animation-finish-middleware.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/drop-animation-flush-on-scroll-middleware.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/dimension-marshal-stopper.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/focus.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/auto-scroll.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/pending-drop.ts","../src/state/file:/D:/Github/draggable/src/state/create-store.ts","../src/state/dimension-marshal/file:/D:/Github/draggable/src/state/dimension-marshal/while-dragging-publisher.ts","../src/state/file:/D:/Github/draggable/src/state/get-max-scroll.ts","../src/view/file:/D:/Github/draggable/src/view/get-document-element.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/get-max-window-scroll.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/get-viewport.ts","../src/state/dimension-marshal/file:/D:/Github/draggable/src/state/dimension-marshal/get-initial-publish.ts","../src/state/dimension-marshal/file:/D:/Github/draggable/src/state/dimension-marshal/dimension-marshal.ts","../src/state/file:/D:/Github/draggable/src/state/can-start-drag.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/scroll-window.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-best-scrollable-droppable.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/config.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-distance-thresholds.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-percentage.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/min-scroll.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value-from-distance.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/dampen-value-by-time.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/index.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/adjust-for-size-limits.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/index.ts","../src/state/auto-scroller/file:/D:/Github/draggable/src/state/auto-scroller/can-scroll.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-window-scroll-change.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-droppable-scroll-change.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/scroll.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/index.ts","../src/state/auto-scroller/file:/D:/Github/draggable/src/state/auto-scroller/jump-scroller.ts","../src/state/auto-scroller/file:/D:/Github/draggable/src/state/auto-scroller/index.ts","../src/view/file:/D:/Github/draggable/src/view/data-attributes.ts","../src/view/use-style-marshal/file:/D:/Github/draggable/src/view/use-style-marshal/get-styles.ts","../src/view/file:/D:/Github/draggable/src/view/use-isomorphic-layout-effect.ts","../src/view/use-style-marshal/file:/D:/Github/draggable/src/view/use-style-marshal/use-style-marshal.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/get-window-from-el.ts","../src/view/is-type-of-element/file:/D:/Github/draggable/src/view/is-type-of-element/is-html-element.ts","../src/view/get-elements/file:/D:/Github/draggable/src/view/get-elements/find-drag-handle.ts","../src/view/use-focus-marshal/file:/D:/Github/draggable/src/view/use-focus-marshal/use-focus-marshal.ts","../src/state/registry/file:/D:/Github/draggable/src/state/registry/create-registry.ts","../src/state/registry/file:/D:/Github/draggable/src/state/registry/use-registry.ts","../src/view/context/file:/D:/Github/draggable/src/view/context/store-context.ts","../src/view/file:/D:/Github/draggable/src/view/get-body-element.ts","../src/view/file:/D:/Github/draggable/src/view/visually-hidden-style.ts","../src/view/use-announcer/file:/D:/Github/draggable/src/view/use-announcer/use-announcer.ts","../src/view/file:/D:/Github/draggable/src/view/use-unique-id.ts","../src/view/use-hidden-text-element/file:/D:/Github/draggable/src/view/use-hidden-text-element/use-hidden-text-element.ts","../src/view/context/file:/D:/Github/draggable/src/view/context/app-context.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/check-react-version.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/check-doctype.ts","../src/view/file:/D:/Github/draggable/src/view/use-dev.ts","../src/view/file:/D:/Github/draggable/src/view/use-dev-setup-warning.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/use-startup-validation.ts","../src/view/file:/D:/Github/draggable/src/view/use-previous-ref.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/lock.ts","../src/view/file:/D:/Github/draggable/src/view/key-codes.ts","../src/view/use-sensor-marshal/sensors/util/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/util/prevent-standard-key-events.ts","../src/view/use-sensor-marshal/sensors/util/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/util/supported-page-visibility-event-name.ts","../src/view/use-sensor-marshal/sensors/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/use-mouse-sensor.ts","../src/view/use-sensor-marshal/sensors/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/use-keyboard-sensor.ts","../src/view/use-sensor-marshal/sensors/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/use-touch-sensor.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/use-validate-sensor-hooks.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/is-event-in-interactive-element.ts","../src/view/file:/D:/Github/draggable/src/view/get-border-box-center-position.ts","../src/view/is-type-of-element/file:/D:/Github/draggable/src/view/is-type-of-element/is-element.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/closest.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/find-closest-draggable-id-from-event.ts","../src/view/get-elements/file:/D:/Github/draggable/src/view/get-elements/find-draggable.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/use-sensor-marshal.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/app.tsx","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/use-unique-context-id.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/drag-drop-context.tsx","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-closest-scrollable.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/check-for-nested-scroll-container.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-scroll.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-env.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/get-droppable.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-dimension.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-listener-options.ts","../src/view/file:/D:/Github/draggable/src/view/use-required-context.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/use-droppable-publisher.ts","../src/view/placeholder/file:/D:/Github/draggable/src/view/placeholder/placeholder.tsx","../src/view/context/file:/D:/Github/draggable/src/view/context/droppable-context.ts","../src/view/file:/D:/Github/draggable/src/view/check-is-valid-inner-ref.ts","../src/view/droppable/file:/D:/Github/draggable/src/view/droppable/use-validation.ts","../src/view/animate-in-out/file:/D:/Github/draggable/src/view/animate-in-out/animate-in-out.tsx","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/get-style.ts","../src/view/use-draggable-publisher/file:/D:/Github/draggable/src/view/use-draggable-publisher/get-dimension.ts","../src/view/use-draggable-publisher/file:/D:/Github/draggable/src/view/use-draggable-publisher/use-draggable-publisher.ts","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/use-validation.ts","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/draggable.tsx","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/what-is-dragged-over-from-result.ts","../src/view/context/file:/D:/Github/draggable/src/view/context/hooks.ts","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/connected-draggable.tsx","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/draggable-api.tsx","../src/view/droppable/file:/D:/Github/draggable/src/view/droppable/droppable.tsx","../src/view/droppable/file:/D:/Github/draggable/src/view/droppable/connected-droppable.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n if (trackActualOwner) {\n var previousStackTraceLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = 10;\n var debugStackDEV = Error(\"react-stack-top-frame\");\n Error.stackTraceLimit = previousStackTraceLimit;\n } else debugStackDEV = unknownOwnerDebugStack;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n debugStackDEV,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n if (trackActualOwner) {\n var previousStackTraceLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = 10;\n var debugStackDEV = Error(\"react-stack-top-frame\");\n Error.stackTraceLimit = previousStackTraceLimit;\n } else debugStackDEV = unknownOwnerDebugStack;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n debugStackDEV,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","// @flow\n\nconst isProduction: boolean = process.env.NODE_ENV === 'production';\n\n// not replacing newlines (which \\s does)\nconst spacesAndTabs: RegExp = /[ \\t]{2,}/g;\nconst lineStartWithSpaces: RegExp = /^[ \\t]*/gm;\n\n// using .trim() to clear the any newlines before the first text and after last text\nconst clean = (value: string): string =>\n value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();\n\nconst getDevMessage = (message: string): string =>\n clean(`\n %creact-beautiful-dnd\n\n %c${clean(message)}\n\n %c👷‍ This is a development only message. It will be removed in production builds.\n`);\n\nexport const getFormattedMessage = (message: string): string[] => [\n getDevMessage(message),\n // title (green400)\n 'color: #00C584; font-size: 1.2em; font-weight: bold;',\n // message\n 'line-height: 1.5',\n // footer (purple300)\n 'color: #723874;',\n];\n\nconst isDisabledFlag: string = '__react-beautiful-dnd-disable-dev-warnings';\n\nexport function log(type: 'error' | 'warn', message: string) {\n // no warnings in production\n if (isProduction) {\n return;\n }\n\n // manual opt out of warnings\n if (typeof window !== 'undefined' && window[isDisabledFlag as any]) {\n return;\n }\n\n // eslint-disable-next-line no-console\n console[type](...getFormattedMessage(message));\n}\n\nexport const warning = log.bind(null, 'warn');\nexport const error = log.bind(null, 'error');\n","// @flow\nexport function noop(): void {}\n\nexport function identity<T>(value: T): T {\n return value;\n}\n","// @flow\nimport type { EventBinding, EventOptions } from './event-types';\n\ntype UnbindFn = () => void;\n\nfunction getOptions(\n shared?: EventOptions | null,\n fromBinding?: EventOptions | null,\n): EventOptions {\n return {\n ...shared,\n ...fromBinding,\n };\n}\n\nexport default function bindEvents(\n el: HTMLElement | Window,\n bindings: EventBinding[],\n sharedOptions: EventOptions,\n): () => void {\n const unbindings: UnbindFn[] = bindings.map(\n (binding: EventBinding): UnbindFn => {\n const options: Object = getOptions(sharedOptions, binding.options);\n\n el.addEventListener(binding.eventName, binding.fn as EventListenerOrEventListenerObject, options);\n\n return function unbind() {\n el.removeEventListener(binding.eventName, binding.fn as EventListenerOrEventListenerObject, options);\n };\n },\n );\n\n // Return a function to unbind events\n return function unbindAll() {\n unbindings.forEach((unbind: UnbindFn) => {\n unbind();\n });\n };\n}\n","// @flow\n/* eslint-disable no-restricted-syntax */\nconst isProduction: boolean = process.env.NODE_ENV === 'production';\nconst prefix: string = 'Invariant failed';\n\n// Want to use this:\n// export class RbdInvariant extends Error { }\n// But it causes babel to bring in a lot of code\n\n// export function RbdInvariant(message: string) {\n// this.message = message;\n// }\n// // $FlowFixMe\n// RbdInvariant.prototype.toString = function toString() {\n// return this.message;\n// };\n\n// // A copy-paste of tiny-invariant but with a custom error type\n// // Throw an error if the condition fails\n// export function invariant(condition: unknown, message?: string) {\n// if (condition) {\n// return;\n// }\n\n// if (isProduction) {\n// // In production we strip the message but still throw\n// throw new RbdInvariant(prefix);\n// } else {\n// // When not in production we allow the message to pass through\n// // *This block will be removed in production builds*\n// throw new RbdInvariant(`${prefix}: ${message || ''}`);\n// }\n// }\n\n\nexport class RbdInvariant extends Error {\n constructor(message: string) {\n super(message);\n\n this.name = 'RbdInvariant';\n\n // Required for correct prototype chain in some JS targets\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n// A copy-paste of tiny-invariant but with a custom error type\n// Throw an error if the condition fails\nexport function invariant(\n condition: unknown,\n message?: string,\n): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n // In production we strip the message but still throw\n throw new RbdInvariant(prefix);\n } else {\n // In development we allow the message to pass through\n throw new RbdInvariant(`${prefix}: ${message || ''}`);\n }\n}","// @flow\nimport React, { type ReactNode } from 'react';\nimport { warning, error } from '../../dev-warning';\nimport { noop } from '../../empty';\nimport bindEvents from '../event-bindings/bind-events';\nimport { RbdInvariant } from '../../invariant';\nimport type { AppCallbacks } from './drag-drop-context-types';\n\n// Exact\ntype Props = {\n children: (setCallbacks: (callbacks: AppCallbacks) => void) => ReactNode,\n};\n\n// Lame that this is not in flow\ntype ErrorEvent = Event & {\n error: Error | null,\n};\n\nexport default class ErrorBoundary extends React.Component<Props> {\n callbacks: AppCallbacks | null = null;\n unbind: () => void = noop;\n\n componentDidMount() {\n this.unbind = bindEvents(window, [\n {\n eventName: 'error',\n fn: this.onWindowError,\n },\n ], {});\n }\n\n componentDidCatch(err: Error) {\n if (err instanceof RbdInvariant) {\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n\n this.setState({});\n return;\n }\n\n // throwing error for other error boundaries\n // eslint-disable-next-line no-restricted-syntax\n throw err;\n }\n\n componentWillUnmount() {\n this.unbind();\n }\n\n onWindowError = (event: ErrorEvent) => {\n const callbacks: AppCallbacks = this.getCallbacks();\n\n if (callbacks.isDragging()) {\n callbacks.tryAbort();\n warning(`\n An error was caught by our window 'error' event listener while a drag was occurring.\n The active drag has been aborted.\n `);\n }\n\n const err: Error | null = event.error;\n\n if (err instanceof RbdInvariant) {\n // Marking the event as dealt with.\n // This will prevent any 'uncaught' error warnings in the console\n event.preventDefault();\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n }\n };\n\n getCallbacks = (): AppCallbacks => {\n if (!this.callbacks) {\n // eslint-disable-next-line no-restricted-syntax\n throw new Error('Unable to find AppCallbacks in <ErrorBoundary/>');\n }\n return this.callbacks;\n };\n\n setCallbacks = (callbacks: AppCallbacks) => {\n this.callbacks = callbacks;\n };\n\n render() {\n return this.props.children(this.setCallbacks);\n }\n}\n","// @flow\nimport type {\n DraggableId,\n DragStart,\n DragUpdate,\n DropResult,\n DraggableLocation,\n Combine,\n} from './types';\n\n// Exact\nexport type MessagePreset = {\n dragHandleUsageInstructions: string,\n onDragStart: (start: DragStart) => string,\n onDragUpdate: (update: DragUpdate) => string,\n onDragEnd: (result: DropResult) => string,\n};\n\nconst dragHandleUsageInstructions: string = `\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n`;\n\nconst position = (index: number): number => index + 1;\n\n// We cannot list what index the Droppable is in automatically as we are not sure how\n// the Droppable's have been configured\nconst onDragStart = (start: DragStart): string => `\n You have lifted an item in position ${position(start.source.index)}\n`;\n\nconst withLocation = (\n source: DraggableLocation,\n destination: DraggableLocation,\n) => {\n const isInHomeList: boolean = source.droppableId === destination.droppableId;\n\n const startPosition: number = position(source.index);\n const endPosition: number = position(destination.index);\n\n if (isInHomeList) {\n return `\n You have moved the item from position ${startPosition}\n to position ${endPosition}\n `;\n }\n\n return `\n You have moved the item from position ${startPosition}\n in list ${source.droppableId}\n to list ${destination.droppableId}\n in position ${endPosition}\n `;\n};\n\nconst withCombine = (\n id: DraggableId,\n source: DraggableLocation,\n combine: Combine,\n): string => {\n const inHomeList: boolean = source.droppableId === combine.droppableId;\n\n if (inHomeList) {\n return `\n The item ${id}\n has been combined with ${combine.draggableId}`;\n }\n\n return `\n The item ${id}\n in list ${source.droppableId}\n has been combined with ${combine.draggableId}\n in list ${combine.droppableId}\n `;\n};\n\nconst onDragUpdate = (update: DragUpdate): string => {\n const location: DraggableLocation | null = update.destination;\n if (location) {\n return withLocation(update.source, location);\n }\n\n const combine: Combine | null = update.combine;\n if (combine) {\n return withCombine(update.draggableId, update.source, combine);\n }\n\n return 'You are over an area that cannot be dropped on';\n};\n\nconst returnedToStart = (source: DraggableLocation): string => `\n The item has returned to its starting position\n of ${position(source.index)}\n`;\n\nconst onDragEnd = (result: DropResult): string => {\n if (result.reason === 'CANCEL') {\n return `\n Movement cancelled.\n ${returnedToStart(result.source)}\n `;\n }\n\n const location: DraggableLocation | null = result.destination;\n const combine: Combine | null = result.combine;\n\n if (location) {\n return `\n You have dropped the item.\n ${withLocation(result.source, location)}\n `;\n }\n\n if (combine) {\n return `\n You have dropped the item.\n ${withCombine(result.draggableId, result.source, combine)}\n `;\n }\n\n return `\n The item has been dropped while not over a drop area.\n ${returnedToStart(result.source)}\n `;\n};\n\nconst preset: MessagePreset = {\n dragHandleUsageInstructions,\n onDragStart,\n onDragUpdate,\n onDragEnd,\n};\n\nexport default preset;\n","/**\n * @license React\n * use-sync-external-store-with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","import * as React from \"react\";\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/with-selector.js\";\n//#region src/utils/react-is.ts\nconst IS_REACT_19 = /* @__PURE__ */ React.version.startsWith(\"19\");\nconst REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(IS_REACT_19 ? \"react.transitional.element\" : \"react.element\");\nconst REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for(\"react.portal\");\nconst REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for(\"react.fragment\");\nconst REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for(\"react.strict_mode\");\nconst REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for(\"react.profiler\");\nconst REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for(\"react.consumer\");\nconst REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for(\"react.context\");\nconst REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for(\"react.forward_ref\");\nconst REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for(\"react.suspense\");\nconst REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(\"react.suspense_list\");\nconst REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for(\"react.memo\");\nconst REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for(\"react.lazy\");\nconst REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for(\"react.offscreen\");\nconst REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(\"react.client.reference\");\nconst ForwardRef = REACT_FORWARD_REF_TYPE;\nconst Memo = REACT_MEMO_TYPE;\nfunction isValidElementType(type) {\n\treturn typeof type === \"string\" || typeof type === \"function\" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE || typeof type === \"object\" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0) ? !0 : !1;\n}\nfunction typeOf(object) {\n\tif (typeof object === \"object\" && object !== null) {\n\t\tconst { $$typeof } = object;\n\t\tswitch ($$typeof) {\n\t\t\tcase REACT_ELEMENT_TYPE: switch (object = object.type, object) {\n\t\t\t\tcase REACT_FRAGMENT_TYPE:\n\t\t\t\tcase REACT_PROFILER_TYPE:\n\t\t\t\tcase REACT_STRICT_MODE_TYPE:\n\t\t\t\tcase REACT_SUSPENSE_TYPE:\n\t\t\t\tcase REACT_SUSPENSE_LIST_TYPE: return object;\n\t\t\t\tdefault: switch (object = object && object.$$typeof, object) {\n\t\t\t\t\tcase REACT_CONTEXT_TYPE:\n\t\t\t\t\tcase REACT_FORWARD_REF_TYPE:\n\t\t\t\t\tcase REACT_LAZY_TYPE:\n\t\t\t\t\tcase REACT_MEMO_TYPE: return object;\n\t\t\t\t\tcase REACT_CONSUMER_TYPE: return object;\n\t\t\t\t\tdefault: return $$typeof;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase REACT_PORTAL_TYPE: return $$typeof;\n\t\t}\n\t}\n}\nfunction isContextConsumer(object) {\n\treturn IS_REACT_19 ? typeOf(object) === REACT_CONSUMER_TYPE : typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isMemo(object) {\n\treturn typeOf(object) === REACT_MEMO_TYPE;\n}\n//#endregion\n//#region src/utils/warning.ts\n/**\n* Prints a warning in the console if it exists.\n*\n* @param {String} message The warning message.\n* @returns {void}\n*/\nfunction warning(message) {\n\tif (typeof console !== \"undefined\" && typeof console.error === \"function\") console.error(message);\n\ttry {\n\t\tthrow new Error(message);\n\t} catch (e) {}\n}\n//#endregion\n//#region src/connect/verifySubselectors.ts\nfunction verify(selector, methodName) {\n\tif (!selector) throw new Error(`Unexpected value for ${methodName} in connect.`);\n\telse if (methodName === \"mapStateToProps\" || methodName === \"mapDispatchToProps\") {\n\t\tif (!Object.prototype.hasOwnProperty.call(selector, \"dependsOnOwnProps\")) warning(`The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`);\n\t}\n}\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {\n\tverify(mapStateToProps, \"mapStateToProps\");\n\tverify(mapDispatchToProps, \"mapDispatchToProps\");\n\tverify(mergeProps, \"mergeProps\");\n}\n//#endregion\n//#region src/connect/selectorFactory.ts\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, { areStatesEqual, areOwnPropsEqual, areStatePropsEqual }) {\n\tlet hasRunAtLeastOnce = false;\n\tlet state;\n\tlet ownProps;\n\tlet stateProps;\n\tlet dispatchProps;\n\tlet mergedProps;\n\tfunction handleFirstCall(firstState, firstOwnProps) {\n\t\tstate = firstState;\n\t\townProps = firstOwnProps;\n\t\tstateProps = mapStateToProps(state, ownProps);\n\t\tdispatchProps = mapDispatchToProps(dispatch, ownProps);\n\t\tmergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\thasRunAtLeastOnce = true;\n\t\treturn mergedProps;\n\t}\n\tfunction handleNewPropsAndNewState() {\n\t\tstateProps = mapStateToProps(state, ownProps);\n\t\tif (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\t\tmergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\treturn mergedProps;\n\t}\n\tfunction handleNewProps() {\n\t\tif (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\t\tif (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\t\tmergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\treturn mergedProps;\n\t}\n\tfunction handleNewState() {\n\t\tconst nextStateProps = mapStateToProps(state, ownProps);\n\t\tconst statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n\t\tstateProps = nextStateProps;\n\t\tif (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\treturn mergedProps;\n\t}\n\tfunction handleSubsequentCalls(nextState, nextOwnProps) {\n\t\tconst propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n\t\tconst stateChanged = !areStatesEqual(nextState, state, nextOwnProps, ownProps);\n\t\tstate = nextState;\n\t\townProps = nextOwnProps;\n\t\tif (propsChanged && stateChanged) return handleNewPropsAndNewState();\n\t\tif (propsChanged) return handleNewProps();\n\t\tif (stateChanged) return handleNewState();\n\t\treturn mergedProps;\n\t}\n\treturn function pureFinalPropsSelector(nextState, nextOwnProps) {\n\t\treturn hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n\t};\n}\nfunction finalPropsSelectorFactory(dispatch, { initMapStateToProps, initMapDispatchToProps, initMergeProps, ...options }) {\n\tconst mapStateToProps = initMapStateToProps(dispatch, options);\n\tconst mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n\tconst mergeProps = initMergeProps(dispatch, options);\n\tif (process.env.NODE_ENV !== \"production\") verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps);\n\treturn pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n//#endregion\n//#region src/utils/bindActionCreators.ts\nfunction bindActionCreators(actionCreators, dispatch) {\n\tconst boundActionCreators = {};\n\tfor (const key in actionCreators) {\n\t\tconst actionCreator = actionCreators[key];\n\t\tif (typeof actionCreator === \"function\") boundActionCreators[key] = (...args) => dispatch(actionCreator(...args));\n\t}\n\treturn boundActionCreators;\n}\n//#endregion\n//#region src/utils/isPlainObject.ts\n/**\n* @param {any} obj The object to inspect.\n* @returns {boolean} True if the argument appears to be a plain object.\n*/\nfunction isPlainObject(obj) {\n\tif (typeof obj !== \"object\" || obj === null) return false;\n\tconst proto = Object.getPrototypeOf(obj);\n\tif (proto === null) return true;\n\tlet baseProto = proto;\n\twhile (Object.getPrototypeOf(baseProto) !== null) baseProto = Object.getPrototypeOf(baseProto);\n\treturn proto === baseProto;\n}\n//#endregion\n//#region src/utils/verifyPlainObject.ts\nfunction verifyPlainObject(value, displayName, methodName) {\n\tif (!isPlainObject(value)) warning(`${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`);\n}\n//#endregion\n//#region src/connect/wrapMapToProps.ts\nfunction wrapMapToPropsConstant(getConstant) {\n\treturn function initConstantSelector(dispatch) {\n\t\tconst constant = getConstant(dispatch);\n\t\tfunction constantSelector() {\n\t\t\treturn constant;\n\t\t}\n\t\tconstantSelector.dependsOnOwnProps = false;\n\t\treturn constantSelector;\n\t};\n}\nfunction getDependsOnOwnProps(mapToProps) {\n\treturn mapToProps.dependsOnOwnProps != null ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n\treturn function initProxySelector(dispatch, { displayName }) {\n\t\tconst proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t\t\treturn proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0);\n\t\t};\n\t\tproxy.dependsOnOwnProps = true;\n\t\tproxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t\t\tproxy.mapToProps = mapToProps;\n\t\t\tproxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t\t\tlet props = proxy(stateOrDispatch, ownProps);\n\t\t\tif (typeof props === \"function\") {\n\t\t\t\tproxy.mapToProps = props;\n\t\t\t\tproxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t\t\t\tprops = proxy(stateOrDispatch, ownProps);\n\t\t\t}\n\t\t\tif (process.env.NODE_ENV !== \"production\") verifyPlainObject(props, displayName, methodName);\n\t\t\treturn props;\n\t\t};\n\t\treturn proxy;\n\t};\n}\n//#endregion\n//#region src/connect/invalidArgFactory.ts\nfunction createInvalidArgFactory(arg, name) {\n\treturn (dispatch, options) => {\n\t\tthrow new Error(`Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`);\n\t};\n}\n//#endregion\n//#region src/connect/mapDispatchToProps.ts\nfunction mapDispatchToPropsFactory(mapDispatchToProps) {\n\treturn mapDispatchToProps && typeof mapDispatchToProps === \"object\" ? wrapMapToPropsConstant((dispatch) => bindActionCreators(mapDispatchToProps, dispatch)) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({ dispatch })) : typeof mapDispatchToProps === \"function\" ? wrapMapToPropsFunc(mapDispatchToProps, \"mapDispatchToProps\") : createInvalidArgFactory(mapDispatchToProps, \"mapDispatchToProps\");\n}\n//#endregion\n//#region src/connect/mapStateToProps.ts\nfunction mapStateToPropsFactory(mapStateToProps) {\n\treturn !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === \"function\" ? wrapMapToPropsFunc(mapStateToProps, \"mapStateToProps\") : createInvalidArgFactory(mapStateToProps, \"mapStateToProps\");\n}\n//#endregion\n//#region src/connect/mergeProps.ts\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n\treturn {\n\t\t...ownProps,\n\t\t...stateProps,\n\t\t...dispatchProps\n\t};\n}\nfunction wrapMergePropsFunc(mergeProps) {\n\treturn function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) {\n\t\tlet hasRunOnce = false;\n\t\tlet mergedProps;\n\t\treturn function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n\t\t\tconst nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\t\tif (hasRunOnce) {\n\t\t\t\tif (!areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n\t\t\t} else {\n\t\t\t\thasRunOnce = true;\n\t\t\t\tmergedProps = nextMergedProps;\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") verifyPlainObject(mergedProps, displayName, \"mergeProps\");\n\t\t\t}\n\t\t\treturn mergedProps;\n\t\t};\n\t};\n}\nfunction mergePropsFactory(mergeProps) {\n\treturn !mergeProps ? () => defaultMergeProps : typeof mergeProps === \"function\" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, \"mergeProps\");\n}\n//#endregion\n//#region src/utils/batch.ts\nfunction defaultNoopBatch(callback) {\n\tcallback();\n}\n//#endregion\n//#region src/utils/Subscription.ts\nfunction createListenerCollection() {\n\tlet first = null;\n\tlet last = null;\n\treturn {\n\t\tclear() {\n\t\t\tfirst = null;\n\t\t\tlast = null;\n\t\t},\n\t\tnotify() {\n\t\t\tdefaultNoopBatch(() => {\n\t\t\t\tlet listener = first;\n\t\t\t\twhile (listener) {\n\t\t\t\t\tlistener.callback();\n\t\t\t\t\tlistener = listener.next;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tget() {\n\t\t\tconst listeners = [];\n\t\t\tlet listener = first;\n\t\t\twhile (listener) {\n\t\t\t\tlisteners.push(listener);\n\t\t\t\tlistener = listener.next;\n\t\t\t}\n\t\t\treturn listeners;\n\t\t},\n\t\tsubscribe(callback) {\n\t\t\tlet isSubscribed = true;\n\t\t\tconst listener = last = {\n\t\t\t\tcallback,\n\t\t\t\tnext: null,\n\t\t\t\tprev: last\n\t\t\t};\n\t\t\tif (listener.prev) listener.prev.next = listener;\n\t\t\telse first = listener;\n\t\t\treturn function unsubscribe() {\n\t\t\t\tif (!isSubscribed || first === null) return;\n\t\t\t\tisSubscribed = false;\n\t\t\t\tif (listener.next) listener.next.prev = listener.prev;\n\t\t\t\telse last = listener.prev;\n\t\t\t\tif (listener.prev) listener.prev.next = listener.next;\n\t\t\t\telse first = listener.next;\n\t\t\t};\n\t\t}\n\t};\n}\nconst nullListeners = {\n\tnotify() {},\n\tget: () => []\n};\nfunction createSubscription(store, parentSub) {\n\tlet unsubscribe;\n\tlet listeners = nullListeners;\n\tlet subscriptionsAmount = 0;\n\tlet selfSubscribed = false;\n\tfunction addNestedSub(listener) {\n\t\ttrySubscribe();\n\t\tconst cleanupListener = listeners.subscribe(listener);\n\t\tlet removed = false;\n\t\treturn () => {\n\t\t\tif (!removed) {\n\t\t\t\tremoved = true;\n\t\t\t\tcleanupListener();\n\t\t\t\ttryUnsubscribe();\n\t\t\t}\n\t\t};\n\t}\n\tfunction notifyNestedSubs() {\n\t\tlisteners.notify();\n\t}\n\tfunction handleChangeWrapper() {\n\t\tif (subscription.onStateChange) subscription.onStateChange();\n\t}\n\tfunction isSubscribed() {\n\t\treturn selfSubscribed;\n\t}\n\tfunction trySubscribe() {\n\t\tsubscriptionsAmount++;\n\t\tif (!unsubscribe) {\n\t\t\tunsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n\t\t\tlisteners = createListenerCollection();\n\t\t}\n\t}\n\tfunction tryUnsubscribe() {\n\t\tsubscriptionsAmount--;\n\t\tif (unsubscribe && subscriptionsAmount === 0) {\n\t\t\tunsubscribe();\n\t\t\tunsubscribe = void 0;\n\t\t\tlisteners.clear();\n\t\t\tlisteners = nullListeners;\n\t\t}\n\t}\n\tfunction trySubscribeSelf() {\n\t\tif (!selfSubscribed) {\n\t\t\tselfSubscribed = true;\n\t\t\ttrySubscribe();\n\t\t}\n\t}\n\tfunction tryUnsubscribeSelf() {\n\t\tif (selfSubscribed) {\n\t\t\tselfSubscribed = false;\n\t\t\ttryUnsubscribe();\n\t\t}\n\t}\n\tconst subscription = {\n\t\taddNestedSub,\n\t\tnotifyNestedSubs,\n\t\thandleChangeWrapper,\n\t\tisSubscribed,\n\t\ttrySubscribe: trySubscribeSelf,\n\t\ttryUnsubscribe: tryUnsubscribeSelf,\n\t\tgetListeners: () => listeners\n\t};\n\treturn subscription;\n}\n//#endregion\n//#region src/utils/useIsomorphicLayoutEffect.ts\nconst canUseDOM = () => !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nconst isDOM = /* @__PURE__ */ canUseDOM();\n/**\n* Checks if the code is running in a React Native environment.\n*\n* @returns Whether the code is running in a React Native environment.\n*\n* @see {@link https://github.com/facebook/react-native/issues/1331 Reference}\n*/\nconst isRunningInReactNative = () => typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\";\nconst isReactNative = /* @__PURE__ */ isRunningInReactNative();\nconst getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React.useLayoutEffect : React.useEffect;\nconst useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();\n//#endregion\n//#region src/utils/shallowEqual.ts\nfunction is(x, y) {\n\tif (x === y) return x !== 0 || y !== 0 || 1 / x === 1 / y;\n\telse return x !== x && y !== y;\n}\nfunction shallowEqual(objA, objB) {\n\tif (is(objA, objB)) return true;\n\tif (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) return false;\n\tconst keysA = Object.keys(objA);\n\tconst keysB = Object.keys(objB);\n\tif (keysA.length !== keysB.length) return false;\n\tfor (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/utils/hoistStatics.ts\nconst REACT_STATICS = {\n\tchildContextTypes: true,\n\tcontextType: true,\n\tcontextTypes: true,\n\tdefaultProps: true,\n\tdisplayName: true,\n\tgetDefaultProps: true,\n\tgetDerivedStateFromError: true,\n\tgetDerivedStateFromProps: true,\n\tmixins: true,\n\tpropTypes: true,\n\ttype: true\n};\nconst KNOWN_STATICS = {\n\tname: true,\n\tlength: true,\n\tprototype: true,\n\tcaller: true,\n\tcallee: true,\n\targuments: true,\n\tarity: true\n};\nconst FORWARD_REF_STATICS = {\n\t$$typeof: true,\n\trender: true,\n\tdefaultProps: true,\n\tdisplayName: true,\n\tpropTypes: true\n};\nconst MEMO_STATICS = {\n\t$$typeof: true,\n\tcompare: true,\n\tdefaultProps: true,\n\tdisplayName: true,\n\tpropTypes: true,\n\ttype: true\n};\nconst TYPE_STATICS = {\n\t[ForwardRef]: FORWARD_REF_STATICS,\n\t[Memo]: MEMO_STATICS\n};\nfunction getStatics(component) {\n\tif (isMemo(component)) return MEMO_STATICS;\n\treturn TYPE_STATICS[component[\"$$typeof\"]] || REACT_STATICS;\n}\nconst defineProperty = Object.defineProperty;\nconst getOwnPropertyNames = Object.getOwnPropertyNames;\nconst getOwnPropertySymbols = Object.getOwnPropertySymbols;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent) {\n\tif (typeof sourceComponent !== \"string\") {\n\t\tif (objectPrototype) {\n\t\t\tconst inheritedComponent = getPrototypeOf(sourceComponent);\n\t\t\tif (inheritedComponent && inheritedComponent !== objectPrototype) hoistNonReactStatics(targetComponent, inheritedComponent);\n\t\t}\n\t\tlet keys = getOwnPropertyNames(sourceComponent);\n\t\tif (getOwnPropertySymbols) keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n\t\tconst targetStatics = getStatics(targetComponent);\n\t\tconst sourceStatics = getStatics(sourceComponent);\n\t\tfor (let i = 0; i < keys.length; ++i) {\n\t\t\tconst key = keys[i];\n\t\t\tif (!KNOWN_STATICS[key] && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n\t\t\t\tconst descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\t\t\t\ttry {\n\t\t\t\t\tdefineProperty(targetComponent, key, descriptor);\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\t\t}\n\t}\n\treturn targetComponent;\n}\n//#endregion\n//#region src/components/Context.ts\nconst ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);\nconst gT = typeof globalThis !== \"undefined\" ? globalThis : {};\nfunction getContext() {\n\tif (!React.createContext) return {};\n\tconst contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();\n\tlet realContext = contextMap.get(React.createContext);\n\tif (!realContext) {\n\t\trealContext = React.createContext(null);\n\t\tif (process.env.NODE_ENV !== \"production\") realContext.displayName = \"ReactRedux\";\n\t\tcontextMap.set(React.createContext, realContext);\n\t}\n\treturn realContext;\n}\nconst ReactReduxContext = /*#__PURE__*/ getContext();\n//#endregion\n//#region src/components/connect.tsx\nconst NO_SUBSCRIPTION_ARRAY = [null, null];\nconst stringifyComponent = (Comp) => {\n\ttry {\n\t\treturn JSON.stringify(Comp);\n\t} catch (err) {\n\t\treturn String(Comp);\n\t}\n};\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n\tuseIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);\n}\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n\tlastWrapperProps.current = wrapperProps;\n\trenderIsScheduled.current = false;\n\tif (childPropsFromStoreUpdate.current) {\n\t\tchildPropsFromStoreUpdate.current = null;\n\t\tnotifyNestedSubs();\n\t}\n}\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener, displayName) {\n\tif (!shouldHandleStateChanges) return () => {};\n\tlet didUnsubscribe = false;\n\tlet lastThrownError = null;\n\tconst checkForUpdates = () => {\n\t\tif (didUnsubscribe || !isMounted.current) return;\n\t\tconst latestStoreState = store.getState();\n\t\tlet newChildProps, error;\n\t\ttry {\n\t\t\tnewChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t\tlastThrownError = e;\n\t\t\tif (process.env.NODE_ENV !== \"production\") console.error(`An error occurred in \\`mapStateToProps\\` (or a selector) of the \\`connect()\\`-ed component \"${displayName}\". See https://github.com/reduxjs/react-redux/issues/1942 for details.`, e);\n\t\t}\n\t\tif (!error) lastThrownError = null;\n\t\tif (newChildProps === lastChildProps.current) {\n\t\t\tif (!renderIsScheduled.current) notifyNestedSubs();\n\t\t} else {\n\t\t\tlastChildProps.current = newChildProps;\n\t\t\tchildPropsFromStoreUpdate.current = newChildProps;\n\t\t\trenderIsScheduled.current = true;\n\t\t\tadditionalSubscribeListener();\n\t\t}\n\t};\n\tsubscription.onStateChange = checkForUpdates;\n\tsubscription.trySubscribe();\n\tcheckForUpdates();\n\tconst unsubscribeWrapper = () => {\n\t\tdidUnsubscribe = true;\n\t\tsubscription.tryUnsubscribe();\n\t\tsubscription.onStateChange = null;\n\t\tif (lastThrownError) throw lastThrownError;\n\t};\n\treturn unsubscribeWrapper;\n}\nfunction strictEqual(a, b) {\n\treturn a === b;\n}\nlet hasWarnedAboutDeprecatedPureOption = false;\n/**\n* @deprecated\n*\n* **We recommend using the `useSelector` and `useDispatch` hooks instead.**\n* See https://react-redux.js.org/api/hooks\n*\n* If you need to use `connect` without this visual deprecation warning,\n* import `legacy_connect` instead:\n*\n* `import { legacy_connect as connect } from 'react-redux'`\n*\n* Connects a React component to a Redux store.\n*\n* - Without arguments, just wraps the component, without changing the behavior / props\n*\n* - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior\n* is to override ownProps (as stated in the docs), so what remains is everything that's\n* not a state or dispatch prop\n*\n* - When 3rd param is passed, we don't know if ownProps propagate and whether they\n* should be valid component props, because it depends on mergeProps implementation.\n* As such, it is the user's responsibility to extend ownProps interface from state or\n* dispatch props or both when applicable\n*\n* @param mapStateToProps A function that extracts values from state\n* @param mapDispatchToProps Setup for dispatching actions\n* @param mergeProps Optional callback to merge state and dispatch props together\n* @param options Options for configuring the connection\n*\n*/\nfunction _connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areStatesEqual = strictEqual, areOwnPropsEqual = shallowEqual, areStatePropsEqual = shallowEqual, areMergedPropsEqual = shallowEqual, forwardRef = false, context = ReactReduxContext } = {}) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (pure !== void 0 && !hasWarnedAboutDeprecatedPureOption) {\n\t\t\thasWarnedAboutDeprecatedPureOption = true;\n\t\t\twarning(\"The `pure` option has been removed. `connect` is now always a \\\"pure/memoized\\\" component\");\n\t\t}\n\t}\n\tconst Context = context;\n\tconst initMapStateToProps = mapStateToPropsFactory(mapStateToProps);\n\tconst initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);\n\tconst initMergeProps = mergePropsFactory(mergeProps);\n\tconst shouldHandleStateChanges = Boolean(mapStateToProps);\n\tconst wrapWithConnect = (WrappedComponent) => {\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!/* @__PURE__ */ isValidElementType(WrappedComponent)) throw new Error(`You must pass a component to the function returned by connect. Instead received ${stringifyComponent(WrappedComponent)}`);\n\t\t}\n\t\tconst wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n\t\tconst displayName = `Connect(${wrappedComponentName})`;\n\t\tconst selectorFactoryOptions = {\n\t\t\tshouldHandleStateChanges,\n\t\t\tdisplayName,\n\t\t\twrappedComponentName,\n\t\t\tWrappedComponent,\n\t\t\tinitMapStateToProps,\n\t\t\tinitMapDispatchToProps,\n\t\t\tinitMergeProps,\n\t\t\tareStatesEqual,\n\t\t\tareStatePropsEqual,\n\t\t\tareOwnPropsEqual,\n\t\t\tareMergedPropsEqual\n\t\t};\n\t\tfunction ConnectFunction(props) {\n\t\t\tconst [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => {\n\t\t\t\tconst { reactReduxForwardedRef, ...wrapperProps } = props;\n\t\t\t\treturn [\n\t\t\t\t\tprops.context,\n\t\t\t\t\treactReduxForwardedRef,\n\t\t\t\t\twrapperProps\n\t\t\t\t];\n\t\t\t}, [props]);\n\t\t\tconst ContextToUse = React.useMemo(() => {\n\t\t\t\tlet ResultContext = Context;\n\t\t\t\tif (propsContext?.Consumer) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\t\t\tif (!/* @__PURE__ */ isContextConsumer(/* @__PURE__ */ React.createElement(propsContext.Consumer, null))) throw new Error(\"You must pass a valid React context consumer as `props.context`\");\n\t\t\t\t\t}\n\t\t\t\t\tResultContext = propsContext;\n\t\t\t\t}\n\t\t\t\treturn ResultContext;\n\t\t\t}, [propsContext, Context]);\n\t\t\tconst contextValue = React.useContext(ContextToUse);\n\t\t\tconst didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n\t\t\tconst didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\t\t\tif (process.env.NODE_ENV !== \"production\" && !didStoreComeFromProps && !didStoreComeFromContext) throw new Error(`Could not find \"store\" in the context of \"${displayName}\". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${displayName} in connect options.`);\n\t\t\tconst store = didStoreComeFromProps ? props.store : contextValue.store;\n\t\t\tconst getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;\n\t\t\tconst childPropsSelector = React.useMemo(() => {\n\t\t\t\treturn finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);\n\t\t\t}, [store]);\n\t\t\tconst [subscription, notifyNestedSubs] = React.useMemo(() => {\n\t\t\t\tif (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY;\n\t\t\t\tconst subscription = createSubscription(store, didStoreComeFromProps ? void 0 : contextValue.subscription);\n\t\t\t\treturn [subscription, subscription.notifyNestedSubs.bind(subscription)];\n\t\t\t}, [\n\t\t\t\tstore,\n\t\t\t\tdidStoreComeFromProps,\n\t\t\t\tcontextValue\n\t\t\t]);\n\t\t\tconst overriddenContextValue = React.useMemo(() => {\n\t\t\t\tif (didStoreComeFromProps) return contextValue;\n\t\t\t\treturn {\n\t\t\t\t\t...contextValue,\n\t\t\t\t\tsubscription\n\t\t\t\t};\n\t\t\t}, [\n\t\t\t\tdidStoreComeFromProps,\n\t\t\t\tcontextValue,\n\t\t\t\tsubscription\n\t\t\t]);\n\t\t\tconst lastChildProps = React.useRef(void 0);\n\t\t\tconst lastWrapperProps = React.useRef(wrapperProps);\n\t\t\tconst childPropsFromStoreUpdate = React.useRef(void 0);\n\t\t\tconst renderIsScheduled = React.useRef(false);\n\t\t\tconst isMounted = React.useRef(false);\n\t\t\t/**\n\t\t\t* @todo Change this to `React.useRef<Error>(undefined)` after upgrading to React 19.\n\t\t\t*/\n\t\t\tconst latestSubscriptionCallbackError = React.useRef(void 0);\n\t\t\tuseIsomorphicLayoutEffect(() => {\n\t\t\t\tisMounted.current = true;\n\t\t\t\treturn () => {\n\t\t\t\t\tisMounted.current = false;\n\t\t\t\t};\n\t\t\t}, []);\n\t\t\tconst actualChildPropsSelector = React.useMemo(() => {\n\t\t\t\tconst selector = () => {\n\t\t\t\t\tif (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) return childPropsFromStoreUpdate.current;\n\t\t\t\t\treturn childPropsSelector(store.getState(), wrapperProps);\n\t\t\t\t};\n\t\t\t\treturn selector;\n\t\t\t}, [store, wrapperProps]);\n\t\t\tconst subscribeForReact = React.useMemo(() => {\n\t\t\t\tconst subscribe = (reactListener) => {\n\t\t\t\t\tif (!subscription) return () => {};\n\t\t\t\t\treturn subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener, displayName);\n\t\t\t\t};\n\t\t\t\treturn subscribe;\n\t\t\t}, [subscription]);\n\t\t\tuseIsomorphicLayoutEffectWithArgs(captureWrapperProps, [\n\t\t\t\tlastWrapperProps,\n\t\t\t\tlastChildProps,\n\t\t\t\trenderIsScheduled,\n\t\t\t\twrapperProps,\n\t\t\t\tchildPropsFromStoreUpdate,\n\t\t\t\tnotifyNestedSubs\n\t\t\t]);\n\t\t\tlet actualChildProps;\n\t\t\ttry {\n\t\t\t\tactualChildProps = React.useSyncExternalStore(subscribeForReact, actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector);\n\t\t\t} catch (err) {\n\t\t\t\tif (latestSubscriptionCallbackError.current) err.message += `\\nThe error may be correlated with this previous error:\\n${latestSubscriptionCallbackError.current.stack}\\n\\n`;\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tuseIsomorphicLayoutEffect(() => {\n\t\t\t\tlatestSubscriptionCallbackError.current = void 0;\n\t\t\t\tchildPropsFromStoreUpdate.current = void 0;\n\t\t\t\tlastChildProps.current = actualChildProps;\n\t\t\t});\n\t\t\tconst renderedWrappedComponent = React.useMemo(() => {\n\t\t\t\tconst effectiveProps = { ...actualChildProps };\n\t\t\t\tif (forwardRef) effectiveProps.ref = reactReduxForwardedRef;\n\t\t\t\treturn /* @__PURE__ */ React.createElement(WrappedComponent, effectiveProps);\n\t\t\t}, [\n\t\t\t\treactReduxForwardedRef,\n\t\t\t\tWrappedComponent,\n\t\t\t\tactualChildProps\n\t\t\t]);\n\t\t\treturn React.useMemo(() => {\n\t\t\t\tif (shouldHandleStateChanges) return /* @__PURE__ */ React.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent);\n\t\t\t\treturn renderedWrappedComponent;\n\t\t\t}, [\n\t\t\t\tContextToUse,\n\t\t\t\trenderedWrappedComponent,\n\t\t\t\toverriddenContextValue\n\t\t\t]);\n\t\t}\n\t\tconst Connect = React.memo(ConnectFunction);\n\t\tConnect.WrappedComponent = WrappedComponent;\n\t\tConnect.displayName = ConnectFunction.displayName = displayName;\n\t\tif (forwardRef) {\n\t\t\tconst forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n\t\t\t\treturn /* @__PURE__ */ React.createElement(Connect, {\n\t\t\t\t\t...props,\n\t\t\t\t\treactReduxForwardedRef: ref\n\t\t\t\t});\n\t\t\t});\n\t\t\tforwarded.displayName = displayName;\n\t\t\tforwarded.WrappedComponent = WrappedComponent;\n\t\t\treturn /*#__PURE__*/ hoistNonReactStatics(forwarded, WrappedComponent);\n\t\t}\n\t\treturn /*#__PURE__*/ hoistNonReactStatics(Connect, WrappedComponent);\n\t};\n\treturn wrapWithConnect;\n}\n/**\n* * @deprecated\n*\n* **We recommend using the `useSelector` and `useDispatch` hooks instead.**\n* See https://react-redux.js.org/api/hooks\n*\n* If you need to use `connect` without this visual deprecation warning,\n* import `legacy_connect` instead:\n*\n* `import { legacy_connect as connect } from 'react-redux'`\n*/\nconst connect = _connect;\n/**\n* Connects a React component to a Redux store. Same as `connect` but without\n* the deprecation warning.\n*\n* **We recommend using the `useSelector` and `useDispatch` hooks instead.**\n* See https://react-redux.js.org/api/hooks\n*/\nconst legacy_connect = _connect;\n//#endregion\n//#region src/components/Provider.tsx\nfunction Provider(providerProps) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (typeof useIsomorphicLayoutEffect !== \"function\") throw new Error(\"The React Redux `<Provider>` component requires React hooks that are not available in a React Server Component. This usually means you are rendering `<Provider>` in a Server Component. Add the `\\\"use client\\\"` directive to the top of the file that renders `<Provider>` (or a parent that ends up rendering it) so it is treated as a Client Component. See https://react.dev/reference/rsc/use-client for more information.\");\n\t}\n\tconst { children, context, serverState, store } = providerProps;\n\tconst contextValue = React.useMemo(() => {\n\t\tconst subscription = createSubscription(store);\n\t\tconst baseContextValue = {\n\t\t\tstore,\n\t\t\tsubscription,\n\t\t\tgetServerState: serverState != null ? () => serverState : void 0\n\t\t};\n\t\tif (process.env.NODE_ENV === \"production\") return baseContextValue;\n\t\telse {\n\t\t\tconst { identityFunctionCheck = \"once\", stabilityCheck = \"once\" } = providerProps;\n\t\t\treturn /* @__PURE__ */ Object.assign(baseContextValue, {\n\t\t\t\tstabilityCheck,\n\t\t\t\tidentityFunctionCheck\n\t\t\t});\n\t\t}\n\t}, [store, serverState]);\n\tconst previousState = React.useMemo(() => store.getState(), [store]);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconst { subscription } = contextValue;\n\t\tsubscription.onStateChange = subscription.notifyNestedSubs;\n\t\tsubscription.trySubscribe();\n\t\tif (previousState !== store.getState()) subscription.notifyNestedSubs();\n\t\treturn () => {\n\t\t\tsubscription.tryUnsubscribe();\n\t\t\tsubscription.onStateChange = void 0;\n\t\t};\n\t}, [contextValue, previousState]);\n\tconst Context = context || ReactReduxContext;\n\treturn /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children);\n}\n//#endregion\n//#region src/hooks/useReduxContext.ts\n/**\n* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level\n* hook that you should usually not need to call directly.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useReduxContext` hook bound to the specified context.\n*/\nfunction createReduxContextHook(context = ReactReduxContext) {\n\treturn function useReduxContext() {\n\t\tconst contextValue = React.useContext(context);\n\t\tif (process.env.NODE_ENV !== \"production\" && !contextValue) throw new Error(\"could not find react-redux context value; please ensure the component is wrapped in a <Provider>\");\n\t\treturn contextValue;\n\t};\n}\n/**\n* A hook to access the value of the `ReactReduxContext`. This is a low-level\n* hook that you should usually not need to call directly.\n*\n* @returns {any} the value of the `ReactReduxContext`\n*\n* @example\n*\n* import React from 'react'\n* import { useReduxContext } from 'react-redux'\n*\n* export const CounterComponent = () => {\n* const { store } = useReduxContext()\n* return <div>{store.getState()}</div>\n* }\n*/\nconst useReduxContext = /*#__PURE__*/ createReduxContextHook();\n//#endregion\n//#region src/hooks/useStore.ts\n/**\n* Hook factory, which creates a `useStore` hook bound to a given context.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useStore` hook bound to the specified context.\n*/\nfunction createStoreHook(context = ReactReduxContext) {\n\tconst useReduxContext$2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n\tconst useStore = () => {\n\t\tconst { store } = useReduxContext$2();\n\t\treturn store;\n\t};\n\tObject.assign(useStore, { withTypes: () => useStore });\n\treturn useStore;\n}\n/**\n* A hook to access the redux store.\n*\n* @returns {any} the redux store\n*\n* @example\n*\n* import React from 'react'\n* import { useStore } from 'react-redux'\n*\n* export const ExampleComponent = () => {\n* const store = useStore()\n* return <div>{store.getState()}</div>\n* }\n*/\nconst useStore = /*#__PURE__*/ createStoreHook();\n//#endregion\n//#region src/hooks/useDispatch.ts\n/**\n* Hook factory, which creates a `useDispatch` hook bound to a given context.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useDispatch` hook bound to the specified context.\n*/\nfunction createDispatchHook(context = ReactReduxContext) {\n\tconst useStore$1 = context === ReactReduxContext ? useStore : createStoreHook(context);\n\tconst useDispatch = () => {\n\t\treturn useStore$1().dispatch;\n\t};\n\tObject.assign(useDispatch, { withTypes: () => useDispatch });\n\treturn useDispatch;\n}\n/**\n* A hook to access the redux `dispatch` function.\n*\n* @returns {any|function} redux store's `dispatch` function\n*\n* @example\n*\n* import React, { useCallback } from 'react'\n* import { useDispatch } from 'react-redux'\n*\n* export const CounterComponent = ({ value }) => {\n* const dispatch = useDispatch()\n* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\n* return (\n* <div>\n* <span>{value}</span>\n* <button onClick={increaseCounter}>Increase counter</button>\n* </div>\n* )\n* }\n*/\nconst useDispatch = /*#__PURE__*/ createDispatchHook();\n//#endregion\n//#region src/hooks/useSelector.ts\nconst refEquality = (a, b) => a === b;\n/**\n* Hook factory, which creates a `useSelector` hook bound to a given context.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useSelector` hook bound to the specified context.\n*/\nfunction createSelectorHook(context = ReactReduxContext) {\n\tconst useReduxContext$1 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n\tconst useSelector = (selector, equalityFnOrOptions = {}) => {\n\t\tconst { equalityFn = refEquality } = typeof equalityFnOrOptions === \"function\" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!selector) throw new Error(`You must pass a selector to useSelector`);\n\t\t\tif (typeof selector !== \"function\") throw new Error(`You must pass a function as a selector to useSelector`);\n\t\t\tif (typeof equalityFn !== \"function\") throw new Error(`You must pass a function as an equality function to useSelector`);\n\t\t}\n\t\tconst reduxContext = useReduxContext$1();\n\t\tconst { store, subscription, getServerState } = reduxContext;\n\t\tconst firstRun = React.useRef(true);\n\t\tconst wrappedSelector = React.useCallback({ [selector.name](state) {\n\t\t\tconst selected = selector(state);\n\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\tconst { devModeChecks = {} } = typeof equalityFnOrOptions === \"function\" ? {} : equalityFnOrOptions;\n\t\t\t\tconst { identityFunctionCheck, stabilityCheck } = reduxContext;\n\t\t\t\tconst { identityFunctionCheck: finalIdentityFunctionCheck, stabilityCheck: finalStabilityCheck } = {\n\t\t\t\t\tstabilityCheck,\n\t\t\t\t\tidentityFunctionCheck,\n\t\t\t\t\t...devModeChecks\n\t\t\t\t};\n\t\t\t\tif (finalStabilityCheck === \"always\" || finalStabilityCheck === \"once\" && firstRun.current) {\n\t\t\t\t\tconst toCompare = selector(state);\n\t\t\t\t\tif (!equalityFn(selected, toCompare)) {\n\t\t\t\t\t\tlet stack = void 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new Error();\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t({stack} = e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconsole.warn(\"Selector \" + (selector.name || \"unknown\") + \" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization\", {\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tselected,\n\t\t\t\t\t\t\tselected2: toCompare,\n\t\t\t\t\t\t\tstack\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (finalIdentityFunctionCheck === \"always\" || finalIdentityFunctionCheck === \"once\" && firstRun.current) {\n\t\t\t\t\tif (selected === state) {\n\t\t\t\t\t\tlet stack = void 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new Error();\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t({stack} = e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconsole.warn(\"Selector \" + (selector.name || \"unknown\") + \" returned the root state when called. This can lead to unnecessary rerenders.\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.\", { stack });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (firstRun.current) firstRun.current = false;\n\t\t\t}\n\t\t\treturn selected;\n\t\t} }[selector.name], [selector]);\n\t\tconst selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);\n\t\tReact.useDebugValue(selectedState);\n\t\treturn selectedState;\n\t};\n\tObject.assign(useSelector, { withTypes: () => useSelector });\n\treturn useSelector;\n}\n/**\n* A hook to access the redux store's state. This hook takes a selector function\n* as an argument. The selector is called with the store state.\n*\n* This hook takes an optional equality comparison function as the second parameter\n* that allows you to customize the way the selected state is compared to determine\n* whether the component needs to be re-rendered.\n*\n* @param {Function} selector the selector function\n* @param {Function=} equalityFn the function that will be used to determine equality\n*\n* @returns {any} the selected state\n*\n* @example\n*\n* import React from 'react'\n* import { useSelector } from 'react-redux'\n*\n* export const CounterComponent = () => {\n* const counter = useSelector(state => state.counter)\n* return <div>{counter}</div>\n* }\n*/\nconst useSelector = /*#__PURE__*/ createSelectorHook();\n//#endregion\n//#region src/exports.ts\n/**\n* @deprecated As of React 18, batching is enabled by default for ReactDOM and React Native.\n* This is now a no-op that immediately runs the callback.\n*/\nconst batch = defaultNoopBatch;\n//#endregion\nexport { Provider, ReactReduxContext, batch, connect, createDispatchHook, createSelectorHook, createStoreHook, legacy_connect, shallowEqual, useDispatch, useSelector, useStore };\n\n//# sourceMappingURL=react-redux.mjs.map","import { useState, useRef, useEffect } from 'react';\n\n// @flow\nfunction areInputsEqual(newInputs, lastInputs) {\n // no checks needed if the inputs length has changed\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n // Using for loop for speed. It generally performs better than array.every\n // https://github.com/alexreardon/memoize-one/pull/59\n let i = 0;\n for (i; i < newInputs.length; i++) {\n // using shallow equality check\n if (newInputs[i] !== lastInputs[i]) {\n return false;\n }\n }\n return true;\n}\n\n// @flow\nfunction useMemoOne(\n// getResult changes on every call,\ngetResult, \n// the inputs array changes on every call\ninputs) {\n // using useState to generate initial value as it is lazy\n const initial = useState(() => ({\n inputs,\n result: getResult(),\n }))[0];\n const isFirstRun = useRef(true);\n const committed = useRef(initial);\n // persist any uncommitted changes after they have been committed\n const useCache = isFirstRun.current ||\n Boolean(inputs &&\n committed.current.inputs &&\n areInputsEqual(inputs, committed.current.inputs));\n // create a new cache if required\n const cache = useCache\n ? committed.current\n : {\n inputs,\n result: getResult(),\n };\n // commit the cache\n useEffect(() => {\n isFirstRun.current = false;\n committed.current = cache;\n }, [cache]);\n return cache.result;\n}\nfunction useCallbackOne(\n// getResult changes on every call,\ncallback, \n// the inputs array changes on every call\ninputs) {\n return useMemoOne(() => callback, inputs);\n}\n// Aliased exports\n// A drop in replacement for useMemo and useCallback that plays\n// very well with eslint-plugin-react-hooks\nconst useMemo = useMemoOne;\nconst useCallback = useCallbackOne;\n\nexport { useCallback, useCallbackOne, useMemo, useMemoOne };\n","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? \"keys\" : \"key\"} \"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. Expected to find one of the known reducer keys instead: \"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : \"(unknown type)\"}, the slice reducer for key \"${key}\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","// @flow\nimport { type Position } from 'css-box-model';\n\nexport const origin: Position = { x: 0, y: 0 };\n\nexport const add = (point1: Position, point2: Position): Position => ({\n x: point1.x + point2.x,\n y: point1.y + point2.y,\n});\n\nexport const subtract = (point1: Position, point2: Position): Position => ({\n x: point1.x - point2.x,\n y: point1.y - point2.y,\n});\n\nexport const isEqual = (point1: Position, point2: Position): boolean =>\n point1.x === point2.x && point1.y === point2.y;\n\nexport const negate = (point: Position): Position => ({\n // if the value is already 0, do not return -0\n x: point.x !== 0 ? -point.x : 0,\n y: point.y !== 0 ? -point.y : 0,\n});\n\n// Allows you to build a position from values.\n// Really useful when working with the Axis type\n// patch('x', 5) = { x: 5, y: 0 }\n// patch('y', 5, 1) = { x: 1, y: 5 }\nexport const patch = (\n line: 'x' | 'y',\n value: number,\n otherValue: number = 0,\n): Position => {\n const result: Position = {\n x: 0,\n y: 0,\n };\n \n // set the value of 'x', or 'y'\n result[line] = value;\n\n // set the value of the other line\n result[line === 'x' ? 'y' : 'x'] = otherValue;\n return result;\n};\n\n// Returns the distance between two points\n// https://www.mathsisfun.com/algebra/distance-2-points.html\nexport const distance = (point1: Position, point2: Position): number =>\n Math.sqrt(\n Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2),\n );\n\n// When given a list of points, it finds the smallest distance to any point\nexport const closest = (target: Position, points: Position[]): number =>\n Math.min(...points.map((point: Position) => distance(target, point)));\n\n// used to apply any function to both values of a point\n// eg: const floor = apply(Math.floor)(point);\nexport const apply = (fn: (value: number) => number) => (\n point: Position,\n): Position => ({\n x: fn(point.x),\n y: fn(point.y),\n});\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import invariant from 'tiny-invariant';\n\nvar getRect = function getRect(_ref) {\n var top = _ref.top,\n right = _ref.right,\n bottom = _ref.bottom,\n left = _ref.left;\n var width = right - left;\n var height = bottom - top;\n var rect = {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: width,\n height: height,\n x: left,\n y: top,\n center: {\n x: (right + left) / 2,\n y: (bottom + top) / 2\n }\n };\n return rect;\n};\nvar expand = function expand(target, expandBy) {\n return {\n top: target.top - expandBy.top,\n left: target.left - expandBy.left,\n bottom: target.bottom + expandBy.bottom,\n right: target.right + expandBy.right\n };\n};\nvar shrink = function shrink(target, shrinkBy) {\n return {\n top: target.top + shrinkBy.top,\n left: target.left + shrinkBy.left,\n bottom: target.bottom - shrinkBy.bottom,\n right: target.right - shrinkBy.right\n };\n};\n\nvar shift = function shift(target, shiftBy) {\n return {\n top: target.top + shiftBy.y,\n left: target.left + shiftBy.x,\n bottom: target.bottom + shiftBy.y,\n right: target.right + shiftBy.x\n };\n};\n\nvar noSpacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n};\nvar createBox = function createBox(_ref2) {\n var borderBox = _ref2.borderBox,\n _ref2$margin = _ref2.margin,\n margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,\n _ref2$border = _ref2.border,\n border = _ref2$border === void 0 ? noSpacing : _ref2$border,\n _ref2$padding = _ref2.padding,\n padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;\n var marginBox = getRect(expand(borderBox, margin));\n var paddingBox = getRect(shrink(borderBox, border));\n var contentBox = getRect(shrink(paddingBox, padding));\n return {\n marginBox: marginBox,\n borderBox: getRect(borderBox),\n paddingBox: paddingBox,\n contentBox: contentBox,\n margin: margin,\n border: border,\n padding: padding\n };\n};\n\nvar parse = function parse(raw) {\n var value = raw.slice(0, -2);\n var suffix = raw.slice(-2);\n\n if (suffix !== 'px') {\n return 0;\n }\n\n var result = Number(value);\n !!isNaN(result) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not parse value [raw: \" + raw + \", without suffix: \" + value + \"]\") : invariant(false) : void 0;\n return result;\n};\n\nvar getWindowScroll = function getWindowScroll() {\n return {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n};\n\nvar offset = function offset(original, change) {\n var borderBox = original.borderBox,\n border = original.border,\n margin = original.margin,\n padding = original.padding;\n var shifted = shift(borderBox, change);\n return createBox({\n borderBox: shifted,\n border: border,\n margin: margin,\n padding: padding\n });\n};\nvar withScroll = function withScroll(original, scroll) {\n if (scroll === void 0) {\n scroll = getWindowScroll();\n }\n\n return offset(original, scroll);\n};\nvar calculateBox = function calculateBox(borderBox, styles) {\n var margin = {\n top: parse(styles.marginTop),\n right: parse(styles.marginRight),\n bottom: parse(styles.marginBottom),\n left: parse(styles.marginLeft)\n };\n var padding = {\n top: parse(styles.paddingTop),\n right: parse(styles.paddingRight),\n bottom: parse(styles.paddingBottom),\n left: parse(styles.paddingLeft)\n };\n var border = {\n top: parse(styles.borderTopWidth),\n right: parse(styles.borderRightWidth),\n bottom: parse(styles.borderBottomWidth),\n left: parse(styles.borderLeftWidth)\n };\n return createBox({\n borderBox: borderBox,\n margin: margin,\n padding: padding,\n border: border\n });\n};\nvar getBox = function getBox(el) {\n var borderBox = el.getBoundingClientRect();\n var styles = window.getComputedStyle(el);\n return calculateBox(borderBox, styles);\n};\n\nexport { calculateBox, createBox, expand, getBox, getRect, offset, shrink, withScroll };\n","// @flow\nimport { getRect, type Rect, type Spacing } from 'css-box-model';\n\nexport default (frame: Spacing, subject: Spacing): Rect | null => {\n const result: Rect = getRect({\n top: Math.max(subject.top, frame.top),\n right: Math.min(subject.right, frame.right),\n bottom: Math.min(subject.bottom, frame.bottom),\n left: Math.max(subject.left, frame.left),\n });\n\n if (result.width <= 0 || result.height <= 0) {\n return null;\n }\n\n return result;\n};\n","// @flow\nimport type { Spacing, Position } from 'css-box-model';\n\n// TODO add test\nexport const isEqual = (first: Spacing, second: Spacing): boolean =>\n first.top === second.top &&\n first.right === second.right &&\n first.bottom === second.bottom &&\n first.left === second.left;\n\nexport const offsetByPosition = (\n spacing: Spacing,\n point: Position,\n): Spacing => ({\n top: spacing.top + point.y,\n left: spacing.left + point.x,\n bottom: spacing.bottom + point.y,\n right: spacing.right + point.x,\n});\n\nexport const expandByPosition = (\n spacing: Spacing,\n position: Position,\n): Spacing => ({\n // pulling back to increase size\n top: spacing.top - position.y,\n left: spacing.left - position.x,\n // pushing forward to increase size\n right: spacing.right + position.x,\n bottom: spacing.bottom + position.y,\n});\n\nexport const getCorners = (spacing: Spacing): Position[] => [\n { x: spacing.left, y: spacing.top },\n { x: spacing.right, y: spacing.top },\n { x: spacing.left, y: spacing.bottom },\n { x: spacing.right, y: spacing.bottom },\n];\n\nexport const noSpacing: Spacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n};\n","// @flow\nimport { getRect, type Rect, type Spacing, type BoxModel } from 'css-box-model';\nimport type {\n Axis,\n Scrollable,\n DroppableSubject,\n PlaceholderInSubject,\n} from '../../../types';\nimport executeClip from './clip';\nimport { offsetByPosition } from '../../spacing';\n\nconst scroll = (target: Spacing, frame: Scrollable | null): Spacing => {\n if (!frame) {\n return target;\n }\n\n return offsetByPosition(target, frame.scroll.diff.displacement);\n};\n\nconst increase = (\n target: Spacing,\n axis: Axis,\n withPlaceholder: PlaceholderInSubject | null,\n): Spacing => {\n if (withPlaceholder && withPlaceholder.increasedBy) {\n return {\n ...target,\n [axis.end]: target[axis.end] + withPlaceholder.increasedBy[axis.line],\n };\n }\n return target;\n};\n\nconst clip = (target: Spacing, frame: Scrollable | null): Rect | null => {\n if (frame && frame.shouldClipSubject) {\n return executeClip(frame.pageMarginBox, target);\n }\n return getRect(target);\n};\n\ntype Args = {\n page: BoxModel,\n withPlaceholder: PlaceholderInSubject | null,\n axis: Axis,\n frame: Scrollable | null,\n};\n\nexport default ({\n page,\n withPlaceholder,\n axis,\n frame,\n}: Args): DroppableSubject => {\n const scrolled: Spacing = scroll(page.marginBox, frame);\n const increased: Spacing = increase(scrolled, axis, withPlaceholder);\n const clipped: Rect | null = clip(increased, frame);\n\n return {\n page,\n withPlaceholder,\n active: clipped,\n };\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport type {\n DroppableDimension,\n Scrollable,\n DroppableSubject,\n} from '../../types';\nimport { negate, subtract } from '../position';\nimport getSubject from './util/get-subject';\n\nexport default (\n droppable: DroppableDimension,\n newScroll: Position,\n): DroppableDimension => {\n invariant(droppable.frame);\n const scrollable: Scrollable = droppable.frame;\n\n const scrollDiff: Position = subtract(newScroll, scrollable.scroll.initial);\n // a positive scroll difference leads to a negative displacement\n // (scrolling down pulls an item upwards)\n const scrollDisplacement: Position = negate(scrollDiff);\n\n // Sometimes it is possible to scroll beyond the max point.\n // This can occur when scrolling a foreign list that now has a placeholder.\n\n const frame: Scrollable = {\n ...scrollable,\n scroll: {\n initial: scrollable.scroll.initial,\n current: newScroll,\n diff: {\n value: scrollDiff,\n displacement: scrollDisplacement,\n },\n // TODO: rename 'softMax?'\n max: scrollable.scroll.max,\n },\n };\n\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: droppable.subject.withPlaceholder,\n axis: droppable.axis,\n frame,\n });\n const result: DroppableDimension = {\n ...droppable,\n frame,\n subject,\n };\n return result;\n};\n","var safeIsNaN = Number.isNaN ||\n function ponyfill(value) {\n return typeof value === 'number' && value !== value;\n };\nfunction isEqual(first, second) {\n if (first === second) {\n return true;\n }\n if (safeIsNaN(first) && safeIsNaN(second)) {\n return true;\n }\n return false;\n}\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) { isEqual = areInputsEqual; }\n var cache = null;\n function memoized() {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {\n return cache.lastResult;\n }\n var lastResult = resultFn.apply(this, newArgs);\n cache = {\n lastResult: lastResult,\n lastArgs: newArgs,\n lastThis: this,\n };\n return lastResult;\n }\n memoized.clear = function clear() {\n cache = null;\n };\n return memoized;\n}\n\nexport { memoizeOne as default };\n","// @flow\n/* eslint-disable es5/no-es6-methods */\n/* eslint-disable es5/no-es6-static-methods */\n/* eslint-disable no-restricted-globals */\n\ntype Map<T> = {\n [key: string]: T,\n};\n\nexport function isInteger(value: unknown): boolean {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return (\n typeof value === 'number' && isFinite(value) && Math.floor(value) === value\n );\n}\n\n// Using this helper to ensure there are correct flow types\n// https://github.com/facebook/flow/issues/2221\nexport function values<T>(map: Map<T>): T[] {\n if (Object.values) {\n // $FlowFixMe - Object.values currently does not have good flow support\n return Object.values(map);\n }\n\n return Object.keys(map).map((key) => map[key]);\n}\n\n// Could also extend to pass index and list\ntype PredicateFn<T> = (value: T) => boolean;\n\n// TODO: swap order\nexport function findIndex<T>(\n list: Array<T>,\n predicate: PredicateFn<T>,\n): number {\n if (list.findIndex) {\n return list.findIndex(predicate);\n }\n\n // Using a for loop so that we can exit early\n for (let i = 0; i < list.length; i++) {\n if (predicate(list[i])) {\n return i;\n }\n }\n // Array.prototype.find returns -1 when nothing is found\n return -1;\n}\n\nexport function find<T>(list: Array<T>, predicate: PredicateFn<T>): T | undefined {\n if (list.find) {\n return list.find(predicate);\n }\n const index: number = findIndex(list, predicate);\n if (index !== -1) {\n return list[index];\n }\n // Array.prototype.find returns undefined when nothing is found\n return undefined;\n}\n\n// Using this rather than Array.from as Array.from adds 2kb to the gzip\n// document.querySelector actually returns Element[], but flow thinks it is HTMLElement[]\n// So we downcast the result to Element[]\nexport function toArray(list: NodeListOf<HTMLElement>): Element[] {\n return Array.prototype.slice.call(list);\n}\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { values } from '../native-with-fallback';\nimport type {\n DroppableDimension,\n DroppableDimensionMap,\n DraggableDimension,\n DraggableDimensionMap,\n} from '../types';\n\nexport const toDroppableMap = memoizeOne(\n (droppables: DroppableDimension[]): DroppableDimensionMap =>\n droppables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n }, {} as DroppableDimensionMap),\n);\n\nexport const toDraggableMap = memoizeOne(\n (draggables: DraggableDimension[]): DraggableDimensionMap =>\n draggables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n }, {} as DraggableDimensionMap),\n);\n\nexport const toDroppableList = memoizeOne(\n (droppables: DroppableDimensionMap): DroppableDimension[] =>\n values(droppables),\n);\n\nexport const toDraggableList = memoizeOne(\n (draggables: DraggableDimensionMap): DraggableDimension[] =>\n values(draggables),\n);\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { toDraggableList } from './dimension-structures';\nimport type {\n DraggableDimension,\n DroppableId,\n DraggableDimensionMap,\n} from '../types';\n\nexport default memoizeOne(\n (\n // using droppableId to avoid cache busted when we\n // update the droppable (such as when it scrolls)\n droppableId: DroppableId,\n draggables: DraggableDimensionMap,\n ): DraggableDimension[] => {\n const result = toDraggableList(draggables)\n .filter(\n (draggable: DraggableDimension): boolean =>\n droppableId === draggable.descriptor.droppableId,\n )\n // Dimensions are not guarenteed to be ordered in the same order as keys\n // So we need to sort them so they are in the correct order\n .sort(\n (a: DraggableDimension, b: DraggableDimension): number =>\n a.descriptor.index - b.descriptor.index,\n );\n\n return result;\n },\n);\n","// @flow\nimport type { DragImpact, DraggableLocation, Combine } from '../types';\n\nexport function tryGetDestination(impact: DragImpact): DraggableLocation | null {\n if (impact.at && impact.at.type === 'REORDER') {\n return impact.at.destination;\n }\n return null;\n}\n\nexport function tryGetCombine(impact: DragImpact): Combine | null {\n if (impact.at && impact.at.type === 'COMBINE') {\n return impact.at.combine;\n }\n return null;\n}\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport type { DraggableDimension } from '../types';\n\nexport default memoizeOne(\n (\n remove: DraggableDimension,\n list: DraggableDimension[],\n ): DraggableDimension[] =>\n list.filter(\n (item: DraggableDimension) => item.descriptor.id !== remove.descriptor.id,\n ),\n);\n","// @flow\nimport { invariant } from '../../../../invariant';\nimport type {\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n CombineImpact,\n DraggableLocation,\n DraggableId,\n} from '../../../../types';\nimport { tryGetDestination } from '../../../get-impact-location';\nimport { findIndex } from '../../../../native-with-fallback';\nimport removeDraggableFromList from '../../../remove-draggable-from-list';\n\n// Exact\nexport type Args = {\n isMovingForward: boolean,\n draggable: DraggableDimension,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n previousImpact: DragImpact,\n};\n\nexport default ({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact,\n}: Args): DragImpact | null => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n\n const location: DraggableLocation | null = tryGetDestination(previousImpact);\n\n if (!location) {\n return null;\n }\n\n function getImpact(target: DraggableId) {\n const at: CombineImpact = {\n type: 'COMBINE',\n combine: {\n draggableId: target,\n droppableId: destination.descriptor.id,\n },\n };\n return {\n ...previousImpact,\n at,\n };\n }\n\n const all: DraggableId[] = previousImpact.displaced.all;\n const closestId: DraggableId | null = all.length ? all[0] : null;\n\n if (isMovingForward) {\n return closestId ? getImpact(closestId) : null;\n }\n\n const withoutDraggable = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n // Moving backwards\n\n // if nothing is displaced - move backwards onto the last item\n if (!closestId) {\n if (!withoutDraggable.length) {\n return null;\n }\n const last: DraggableDimension =\n withoutDraggable[withoutDraggable.length - 1];\n return getImpact(last.descriptor.id);\n }\n\n // We are moving from being between two displaced items\n // backwards onto the first one\n\n // need to find the first item before the closest\n const indexOfClosest: number = findIndex(\n withoutDraggable,\n (d) => d.descriptor.id === closestId,\n );\n invariant(indexOfClosest !== -1, 'Could not find displaced item in set');\n\n const proposedIndex: number = indexOfClosest - 1;\n\n // There is no displaced item before\n if (proposedIndex < 0) {\n return null;\n }\n\n const before: DraggableDimension = withoutDraggable[proposedIndex];\n return getImpact(before.descriptor.id);\n};\n","// @flow\nimport type { DraggableDimension, DroppableDimension } from '../../types';\n\nexport default (\n draggable: DraggableDimension,\n destination: DroppableDimension,\n): boolean => draggable.descriptor.droppableId === destination.descriptor.id;\n","// @flow\nimport type {\n DisplacementGroups,\n DragImpact,\n DisplacedBy,\n LiftEffect,\n} from '../types';\nimport { origin } from './position';\n\nexport const noDisplacedBy: DisplacedBy = {\n point: origin,\n value: 0,\n};\n\nexport const emptyGroups: DisplacementGroups = {\n invisible: {},\n visible: {},\n all: [],\n};\n\nconst noImpact: DragImpact = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: null,\n};\n\nexport default noImpact;\n\nexport const noAfterCritical: LiftEffect = {\n inVirtualList: false,\n effected: {},\n displacedBy: noDisplacedBy,\n};\n","// @flow\n\n// is a value between two other values\n\nexport default (\n lowerBound: number,\n upperBound: number,\n): ((arg: number) => boolean) => (value: number): boolean =>\n lowerBound <= value && value <= upperBound;\n","// @flow\nimport { type Spacing } from 'css-box-model';\nimport isWithin from '../is-within';\n\nexport default (frame: Spacing) => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return (subject: Spacing) => {\n // situations where target is visible:\n // 1. is completely contained within frame\n // 2. is partially visible on both axis within frame\n // 3. is bigger than frame on both axis\n // 4. is bigger than frame on one axis and is partially visible on the other\n\n // completely contained\n const isContained: boolean =\n isWithinVertical(subject.top) &&\n isWithinVertical(subject.bottom) &&\n isWithinHorizontal(subject.left) &&\n isWithinHorizontal(subject.right);\n\n if (isContained) {\n return true;\n }\n\n const isPartiallyVisibleVertically: boolean =\n isWithinVertical(subject.top) || isWithinVertical(subject.bottom);\n const isPartiallyVisibleHorizontally: boolean =\n isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right);\n\n // partially visible on both axis\n const isPartiallyContained: boolean =\n isPartiallyVisibleVertically && isPartiallyVisibleHorizontally;\n\n if (isPartiallyContained) {\n return true;\n }\n\n const isBiggerVertically: boolean =\n subject.top < frame.top && subject.bottom > frame.bottom;\n const isBiggerHorizontally: boolean =\n subject.left < frame.left && subject.right > frame.right;\n\n // is bigger than frame on both axis\n const isTargetBiggerThanFrame: boolean =\n isBiggerVertically && isBiggerHorizontally;\n\n if (isTargetBiggerThanFrame) {\n return true;\n }\n\n // is bigger on one axis, and partially visible on another\n const isTargetBiggerOnOneAxis: boolean =\n (isBiggerVertically && isPartiallyVisibleHorizontally) ||\n (isBiggerHorizontally && isPartiallyVisibleVertically);\n\n return isTargetBiggerOnOneAxis;\n };\n};\n","// @flow\nimport { type Spacing } from 'css-box-model';\nimport isWithin from '../is-within';\n\nexport default (frame: Spacing) => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return (subject: Spacing) => {\n const isContained: boolean =\n isWithinVertical(subject.top) &&\n isWithinVertical(subject.bottom) &&\n isWithinHorizontal(subject.left) &&\n isWithinHorizontal(subject.right);\n\n return isContained;\n };\n};\n","// @flow\nimport type { HorizontalAxis, VerticalAxis } from '../types';\n\nexport const vertical: VerticalAxis = {\n direction: 'vertical',\n line: 'y',\n crossAxisLine: 'x',\n start: 'top',\n end: 'bottom',\n size: 'height',\n crossAxisStart: 'left',\n crossAxisEnd: 'right',\n crossAxisSize: 'width',\n};\n\nexport const horizontal: HorizontalAxis = {\n direction: 'horizontal',\n line: 'x',\n crossAxisLine: 'y',\n start: 'left',\n end: 'right',\n size: 'width',\n crossAxisStart: 'top',\n crossAxisEnd: 'bottom',\n crossAxisSize: 'height',\n};\n","// @flow\nimport { type Spacing } from 'css-box-model';\nimport type { Axis } from '../../types';\nimport isWithin from '../is-within';\nimport { vertical } from '../axis';\n\nexport default (axis: Axis) => (frame: Spacing) => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return (subject: Spacing) => {\n if (axis === vertical) {\n return isWithinVertical(subject.top) && isWithinVertical(subject.bottom);\n }\n return (\n isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right)\n );\n };\n};\n","// @flow\nimport { type Position, type Spacing, type Rect } from 'css-box-model';\nimport type { DroppableDimension } from '../../types';\nimport isPartiallyVisibleThroughFrame from './is-partially-visible-through-frame';\nimport isTotallyVisibleThroughFrame from './is-totally-visible-through-frame';\nimport isTotallyVisibleThroughFrameOnAxis from './is-totally-visible-through-frame-on-axis';\nimport { offsetByPosition } from '../spacing';\nimport { origin } from '../position';\n\n// Exact\nexport type Args = {\n target: Spacing,\n destination: DroppableDimension,\n viewport: Rect,\n withDroppableDisplacement: boolean,\n shouldCheckDroppable?: boolean,\n shouldCheckViewport?: boolean,\n};\n\ntype IsVisibleThroughFrameFn = (\n frame: Spacing,\n) => (subject: Spacing) => boolean;\n\ntype InternalArgs = Args & {\n isVisibleThroughFrameFn: IsVisibleThroughFrameFn,\n};\n\nconst getDroppableDisplaced = (\n target: Spacing,\n destination: DroppableDimension,\n): Spacing => {\n const displacement: Position = destination.frame\n ? destination.frame.scroll.diff.displacement\n : origin;\n\n return offsetByPosition(target, displacement);\n};\n\nconst isVisibleInDroppable = (\n target: Spacing,\n destination: DroppableDimension,\n isVisibleThroughFrameFn: IsVisibleThroughFrameFn,\n): boolean => {\n // destination subject is totally hidden by frame\n // this should never happen - but just guarding against it\n if (!destination.subject.active) {\n return false;\n }\n\n // When considering if the target is visible in the droppable we need\n // to consider the change in scroll of the droppable. We need to\n // adjust for the scroll as the clipped viewport takes into account\n // the scroll of the droppable.\n\n return isVisibleThroughFrameFn(destination.subject.active)(target);\n};\n\nconst isVisibleInViewport = (\n target: Spacing,\n viewport: Rect,\n isVisibleThroughFrameFn: IsVisibleThroughFrameFn,\n): boolean => isVisibleThroughFrameFn(viewport)(target);\n\nconst isVisible = ({\n target: toBeDisplaced,\n destination,\n viewport,\n withDroppableDisplacement,\n isVisibleThroughFrameFn,\n}: InternalArgs): boolean => {\n const displacedTarget: Spacing = withDroppableDisplacement\n ? getDroppableDisplaced(toBeDisplaced, destination)\n : toBeDisplaced;\n\n return (\n isVisibleInDroppable(\n displacedTarget,\n destination,\n isVisibleThroughFrameFn,\n ) && isVisibleInViewport(displacedTarget, viewport, isVisibleThroughFrameFn)\n );\n};\n\nexport const isPartiallyVisible = (args: Args): boolean =>\n isVisible({\n ...args,\n isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame,\n });\n\nexport const isTotallyVisible = (args: Args): boolean =>\n isVisible({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrame,\n });\n\nexport const isTotallyVisibleOnAxis = (args: Args): boolean =>\n isVisible({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrameOnAxis(\n args.destination.axis,\n ),\n });\n","// @flow\nimport { type Rect, type Spacing, expand, getRect } from 'css-box-model';\nimport type {\n DraggableId,\n Displacement,\n DraggableDimension,\n DroppableDimension,\n DisplacementGroups,\n DisplacedBy,\n} from '../types';\nimport { isPartiallyVisible } from './visibility/is-visible';\n\n// Exact\ntype Args = {\n afterDragging: DraggableDimension[],\n destination: DroppableDimension,\n displacedBy: DisplacedBy,\n last: DisplacementGroups | null,\n viewport: Rect,\n forceShouldAnimate?: boolean,\n};\n\nconst getShouldAnimate = (\n id: any,\n last: DisplacementGroups | null,\n forceShouldAnimate?: boolean,\n) => {\n // Use a forced value if provided\n if (typeof forceShouldAnimate === 'boolean') {\n return forceShouldAnimate;\n }\n\n // nothing to gauge animation from\n if (!last) {\n return true;\n }\n\n const { invisible, visible } = last;\n\n // it was previously invisible - no animation\n if (invisible[id]) {\n return false;\n }\n\n const previous: Displacement | null = visible[id];\n\n return previous ? previous.shouldAnimate : true;\n};\n\n// Note: it is also an optimisation to not render the displacement on\n// items when they are not longer visible.\n// This prevents a lot of .render() calls when leaving / entering a list\n\nfunction getTarget(\n draggable: DraggableDimension,\n displacedBy: DisplacedBy,\n): Rect {\n const marginBox: Rect = draggable.page.marginBox;\n\n // ## Visibility overscanning\n // We are expanding rather than offsetting the marginBox.\n // In some cases we want\n // - the target based on the starting position (such as when dropping outside of any list)\n // - the target based on the items position without starting displacement (such as when moving inside a list)\n // To keep things simple we just expand the whole area for this check\n // The worst case is some minor redundant offscreen movements\n const expandBy: Spacing = {\n // pull backwards into viewport\n top: displacedBy.point.y,\n right: 0,\n bottom: 0,\n // pull backwards into viewport\n left: displacedBy.point.x,\n };\n\n return getRect(expand(marginBox, expandBy));\n}\n\nexport default function getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy,\n viewport,\n forceShouldAnimate,\n last,\n}: Args): DisplacementGroups {\n return afterDragging.reduce(\n function process(\n groups: DisplacementGroups,\n draggable: DraggableDimension,\n ): DisplacementGroups {\n const target: Rect = getTarget(draggable, displacedBy);\n const id: DraggableId = draggable.descriptor.id;\n\n groups.all.push(id);\n\n const isVisible: boolean = isPartiallyVisible({\n target,\n destination,\n viewport,\n withDroppableDisplacement: true,\n });\n\n if (!isVisible) {\n groups.invisible[draggable.descriptor.id] = true;\n return groups;\n }\n\n // item is visible\n\n const shouldAnimate: boolean = getShouldAnimate(\n id,\n last,\n forceShouldAnimate,\n );\n\n const displacement: Displacement = {\n draggableId: id,\n shouldAnimate,\n };\n\n groups.visible[id] = displacement;\n return groups;\n },\n {\n all: [],\n visible: {},\n invisible: {},\n },\n );\n}\n","// @flow\nimport type {\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n DisplacementGroups,\n Viewport,\n DisplacedBy,\n} from '../../types';\nimport removeDraggableFromList from '../remove-draggable-from-list';\nimport isHomeOf from '../droppable/is-home-of';\nimport { emptyGroups } from '../no-impact';\nimport { find } from '../../native-with-fallback';\nimport getDisplacementGroups from '../get-displacement-groups';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n insideDestination: DraggableDimension[],\n destination: DroppableDimension,\n viewport: Viewport,\n displacedBy: DisplacedBy,\n last: DisplacementGroups,\n index: number | null,\n forceShouldAnimate?: boolean,\n};\n\nfunction getIndexOfLastItem(\n draggables: DraggableDimension[],\n options: { inHomeList: boolean }, // Exact\n): number {\n if (!draggables.length) {\n return 0;\n }\n\n const indexOfLastItem: number =\n draggables[draggables.length - 1].descriptor.index;\n\n // When in a foreign list there will be an additional one item in the list\n return options.inHomeList ? indexOfLastItem : indexOfLastItem + 1;\n}\n\n// Exact\ntype GoAtEndArgs = {\n insideDestination: DraggableDimension[],\n inHomeList: boolean,\n displacedBy: DisplacedBy,\n destination: DroppableDimension,\n};\n\nfunction goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination,\n}: GoAtEndArgs): DragImpact {\n const newIndex: number = getIndexOfLastItem(insideDestination, {\n inHomeList,\n });\n\n return {\n displaced: emptyGroups,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: newIndex,\n },\n },\n };\n}\n\nexport default function calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n last,\n index,\n forceShouldAnimate,\n}: Args): DragImpact {\n const inHomeList: boolean = isHomeOf(draggable, destination);\n\n // Go into last spot of list\n if (index == null) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination,\n });\n }\n\n // this might be the dragging item\n const match: DraggableDimension | null | undefined = find(\n insideDestination,\n (item: DraggableDimension) => item.descriptor.index === index,\n );\n\n if (!match) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination,\n });\n }\n const withoutDragging: DraggableDimension[] = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n const sliceFrom: number = insideDestination.indexOf(match);\n const impacted: DraggableDimension[] = withoutDragging.slice(sliceFrom);\n\n const displaced: DisplacementGroups = getDisplacementGroups({\n afterDragging: impacted,\n destination,\n displacedBy,\n last,\n viewport: viewport.frame,\n forceShouldAnimate,\n });\n\n return {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index,\n },\n },\n };\n}\n","// @flow\nimport type { DraggableId, LiftEffect } from '../types';\n\nexport default function didStartAfterCritical(\n draggableId: DraggableId,\n afterCritical: LiftEffect,\n): boolean {\n return Boolean(afterCritical.effected[draggableId]);\n}\n","// @flow\nimport type {\n DroppableDimension,\n Combine,\n DraggableDimension,\n DraggableDimensionMap,\n DisplacementGroups,\n DraggableId,\n LiftEffect,\n} from '../../../../types';\nimport didStartAfterCritical from '../../../did-start-after-critical';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n destination: DroppableDimension,\n displaced: DisplacementGroups,\n draggables: DraggableDimensionMap,\n combine: Combine,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n destination,\n draggables,\n combine,\n afterCritical,\n}: Args): number | null => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const combineId: DraggableId = combine.draggableId;\n const combineWith: DraggableDimension = draggables[combineId];\n const combineWithIndex: number = combineWith.descriptor.index;\n const didCombineWithStartAfterCritical: boolean = didStartAfterCritical(\n combineId,\n afterCritical,\n );\n\n if (didCombineWithStartAfterCritical) {\n if (isMovingForward) {\n return combineWithIndex;\n }\n return combineWithIndex - 1;\n }\n\n if (isMovingForward) {\n return combineWithIndex + 1;\n }\n\n return combineWithIndex;\n};\n","// @flow\nimport type { DraggableDimension, DraggableLocation } from '../../../../types';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n isInHomeList: boolean,\n location: DraggableLocation,\n insideDestination: DraggableDimension[],\n};\n\nexport default ({\n isMovingForward,\n isInHomeList,\n insideDestination,\n location,\n}: Args): number | null => {\n // cannot move in the list\n if (!insideDestination.length) {\n return null;\n }\n\n const currentIndex: number = location.index;\n const proposedIndex: number = isMovingForward\n ? currentIndex + 1\n : currentIndex - 1;\n\n // Accounting for lists that might not start with an index of 0\n const firstIndex: number = insideDestination[0].descriptor.index;\n const lastIndex: number =\n insideDestination[insideDestination.length - 1].descriptor.index;\n\n // When in foreign list we allow movement after the last item\n const upperBound: number = isInHomeList ? lastIndex : lastIndex + 1;\n\n if (proposedIndex < firstIndex) {\n return null;\n }\n if (proposedIndex > upperBound) {\n return null;\n }\n\n return proposedIndex;\n};\n","// @flow\nimport { invariant } from '../../../../invariant';\nimport type {\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DragImpact,\n LiftEffect,\n Viewport,\n ImpactLocation,\n} from '../../../../types';\nimport calculateReorderImpact from '../../../calculate-drag-impact/calculate-reorder-impact';\nimport fromCombine from './from-combine';\nimport fromReorder from './from-reorder';\n\n// Exact\nexport type Args = {\n isMovingForward: boolean,\n isInHomeList: boolean,\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n previousImpact: DragImpact,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical,\n}: Args): DragImpact | null => {\n const wasAt: ImpactLocation | null = previousImpact.at;\n invariant(wasAt, 'Cannot move in direction without previous impact location');\n\n if (wasAt.type === 'REORDER') {\n const newIndex: number | null = fromReorder({\n isMovingForward,\n isInHomeList,\n location: wasAt.destination,\n insideDestination,\n });\n // TODO: can we just pass new index on?\n if (newIndex == null) {\n return null;\n }\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex,\n });\n }\n\n // COMBINE\n const newIndex: number | null = fromCombine({\n isMovingForward,\n destination,\n displaced: previousImpact.displaced,\n draggables,\n combine: wasAt.combine,\n afterCritical,\n });\n if (newIndex == null) {\n return null;\n }\n\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex,\n });\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DisplacementGroups,\n LiftEffect,\n DraggableId,\n DisplacedBy,\n} from '../types';\nimport { origin, negate } from './position';\nimport didStartAfterCritical from './did-start-after-critical';\n\n// Exact\ntype Args = {\n displaced: DisplacementGroups,\n afterCritical: LiftEffect,\n combineWith: DraggableId,\n displacedBy: DisplacedBy,\n};\n\nexport default ({\n displaced,\n afterCritical,\n combineWith,\n displacedBy,\n}: Args): Position => {\n const isDisplaced: boolean = Boolean(\n displaced.visible[combineWith] || displaced.invisible[combineWith],\n );\n\n if (didStartAfterCritical(combineWith, afterCritical)) {\n return isDisplaced ? origin : negate(displacedBy.point);\n }\n\n return isDisplaced ? displacedBy.point : origin;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport type {\n DraggableDimensionMap,\n DraggableId,\n Combine,\n LiftEffect,\n DragImpact,\n} from '../../../types';\nimport { add } from '../../position';\nimport getCombinedItemDisplacement from '../../get-combined-item-displacement';\nimport { tryGetCombine } from '../../get-impact-location';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n // all draggables in the system\n draggables: DraggableDimensionMap,\n afterCritical: LiftEffect,\n};\n\n// Returns the client offset required to move an item from its\n// original client position to its final resting position\nexport default ({ afterCritical, impact, draggables }: Args): Position => {\n const combine: Combine | null = tryGetCombine(impact);\n invariant(combine);\n\n const combineWith: DraggableId = combine.draggableId;\n const center: Position = draggables[combineWith].page.borderBox.center;\n\n const displaceBy: Position = getCombinedItemDisplacement({\n displaced: impact.displaced,\n afterCritical,\n combineWith,\n displacedBy: impact.displacedBy,\n });\n\n return add(center, displaceBy);\n};\n","// @flow\nimport type { Position, BoxModel, Rect } from 'css-box-model';\nimport { patch } from '../position';\nimport type { Axis } from '../../types';\n\ntype Args = {\n axis: Axis,\n moveRelativeTo: BoxModel,\n isMoving: BoxModel,\n};\n\nconst distanceFromStartToBorderBoxCenter = (\n axis: Axis,\n box: BoxModel,\n): number => box.margin[axis.start] + box.borderBox[axis.size] / 2;\n\nconst distanceFromEndToBorderBoxCenter = (axis: Axis, box: BoxModel): number =>\n box.margin[axis.end] + box.borderBox[axis.size] / 2;\n\n// We align the moving item against the cross axis start of the target\n// We used to align the moving item cross axis center with the cross axis center of the target.\n// However, this leads to a bad experience when reordering columns\nconst getCrossAxisBorderBoxCenter = (\n axis: Axis,\n target: Rect,\n isMoving: BoxModel,\n): number =>\n target[axis.crossAxisStart] +\n isMoving.margin[axis.crossAxisStart] +\n isMoving.borderBox[axis.crossAxisSize] / 2;\n\nexport const goAfter = ({ axis, moveRelativeTo, isMoving }: Args): Position =>\n patch(\n axis.line,\n // start measuring from the end of the target\n moveRelativeTo.marginBox[axis.end] +\n distanceFromStartToBorderBoxCenter(axis, isMoving),\n getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving),\n );\n\nexport const goBefore = ({ axis, moveRelativeTo, isMoving }: Args): Position =>\n patch(\n axis.line,\n // start measuring from the start of the target\n moveRelativeTo.marginBox[axis.start] -\n distanceFromEndToBorderBoxCenter(axis, isMoving),\n getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving),\n );\n\n// Exact\ntype GoIntoArgs = {\n axis: Axis,\n moveInto: BoxModel,\n isMoving: BoxModel,\n};\n\n// moves into the content box\nexport const goIntoStart = ({\n axis,\n moveInto,\n isMoving,\n}: GoIntoArgs): Position =>\n patch(\n axis.line,\n moveInto.contentBox[axis.start] +\n distanceFromStartToBorderBoxCenter(axis, isMoving),\n getCrossAxisBorderBoxCenter(axis, moveInto.contentBox, isMoving),\n );\n","// @flow\nimport { offset, type Position, type BoxModel } from 'css-box-model';\nimport type {\n Axis,\n DragImpact,\n DraggableId,\n DraggableDimension,\n DraggableDimensionMap,\n DroppableDimension,\n LiftEffect,\n} from '../../../types';\nimport { goBefore, goAfter, goIntoStart } from '../move-relative-to';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport { negate } from '../../position';\nimport didStartAfterCritical from '../../did-start-after-critical';\n\n// Exact\ntype NewHomeArgs = {\n impact: DragImpact,\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n droppable: DroppableDimension,\n afterCritical: LiftEffect,\n};\n\n// Returns the client offset required to move an item from its\n// original client position to its final resting position\nexport default ({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical,\n}: NewHomeArgs): Position => {\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n droppable.descriptor.id,\n draggables,\n );\n\n const draggablePage: BoxModel = draggable.page;\n const axis: Axis = droppable.axis;\n\n // this will only happen in a foreign list\n if (!insideDestination.length) {\n return goIntoStart({\n axis,\n moveInto: droppable.page,\n isMoving: draggablePage,\n });\n }\n\n const { displaced, displacedBy } = impact;\n const closestAfter: DraggableId | null = displaced.all[0];\n\n // go before the first displaced item\n // items can only be displaced forwards\n if (closestAfter) {\n const closest: DraggableDimension = draggables[closestAfter];\n // want to go before where it would be with the displacement\n\n // target is displaced and is already in it's starting position\n if (didStartAfterCritical(closestAfter, afterCritical)) {\n return goBefore({\n axis,\n moveRelativeTo: closest.page,\n isMoving: draggablePage,\n });\n }\n\n // target has been displaced during the drag and it is not in its starting position\n // we need to account for the displacement\n const withDisplacement: BoxModel = offset(closest.page, displacedBy.point);\n\n return goBefore({\n axis,\n moveRelativeTo: withDisplacement,\n isMoving: draggablePage,\n });\n }\n\n // Nothing in list is displaced, we should go after the last item\n\n const last: DraggableDimension =\n insideDestination[insideDestination.length - 1];\n\n // we can just go into our original position if the last item\n // is the dragging item\n if (last.descriptor.id === draggable.descriptor.id) {\n return draggablePage.borderBox.center;\n }\n\n if (didStartAfterCritical(last.descriptor.id, afterCritical)) {\n // if the item started displaced and it is no longer displaced then\n // we need to go after it it's non-displaced position\n\n const page: BoxModel = offset(\n last.page,\n negate(afterCritical.displacedBy.point),\n );\n return goAfter({\n axis,\n moveRelativeTo: page,\n isMoving: draggablePage,\n });\n }\n\n // item is in its resting spot. we can go straight after it\n return goAfter({\n axis,\n moveRelativeTo: last.page,\n isMoving: draggablePage,\n });\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { add } from '../position';\nimport type { Scrollable, DroppableDimension } from '../../types';\n\nexport default (droppable: DroppableDimension, point: Position): Position => {\n const frame: Scrollable | null = droppable.frame;\n if (!frame) {\n return point;\n }\n\n return add(point, frame.scroll.diff.displacement);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DragImpact,\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n ImpactLocation,\n LiftEffect,\n} from '../../../types';\nimport whenCombining from './when-combining';\nimport whenReordering from './when-reordering';\nimport withDroppableDisplacement from '../../with-scroll-change/with-droppable-displacement';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n afterCritical: LiftEffect,\n draggable: DraggableDimension,\n droppable: DroppableDimension | null,\n draggables: DraggableDimensionMap,\n};\n\nconst getResultWithoutDroppableDisplacement = ({\n impact,\n draggable,\n droppable,\n draggables,\n afterCritical,\n}: Args): Position => {\n const original: Position = draggable.page.borderBox.center;\n const at: ImpactLocation | null = impact.at;\n\n if (!droppable) {\n return original;\n }\n\n if (!at) {\n return original;\n }\n\n if (at.type === 'REORDER') {\n return whenReordering({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical,\n });\n }\n\n return whenCombining({\n impact,\n draggables,\n afterCritical,\n });\n};\n\nexport default (args: Args): Position => {\n const withoutDisplacement: Position = getResultWithoutDroppableDisplacement(\n args,\n );\n\n const droppable: DroppableDimension | null = args.droppable;\n\n const withDisplacement: Position = droppable\n ? withDroppableDisplacement(droppable, withoutDisplacement)\n : withoutDisplacement;\n\n return withDisplacement;\n};\n","// @flow\nimport { getRect, type Rect } from 'css-box-model';\nimport type { Position } from 'css-box-model';\nimport { subtract, negate } from './position';\nimport type { Viewport } from '../types';\n\nexport default (viewport: Viewport, newScroll: Position): Viewport => {\n const diff: Position = subtract(newScroll, viewport.scroll.initial);\n const displacement: Position = negate(diff);\n\n // We need to update the frame so that it is always a live value\n // The top / left of the frame should always match the newScroll position\n const frame: Rect = getRect({\n top: newScroll.y,\n bottom: newScroll.y + viewport.frame.height,\n left: newScroll.x,\n right: newScroll.x + viewport.frame.width,\n });\n\n const updated: Viewport = {\n frame,\n scroll: {\n initial: viewport.scroll.initial,\n max: viewport.scroll.max,\n current: newScroll,\n diff: {\n value: diff,\n displacement,\n },\n },\n };\n\n return updated;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DraggableId,\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n DragImpact,\n Displacement,\n DisplacementGroups,\n DraggableIdMap,\n DisplacementMap,\n Viewport,\n} from '../../types';\nimport scrollViewport from '../scroll-viewport';\nimport scrollDroppable from '../droppable/scroll-droppable';\nimport { add } from '../position';\nimport getDisplacementGroups from '../get-displacement-groups';\n\n// Exact\ntype SpeculativeArgs = {\n impact: DragImpact,\n destination: DroppableDimension,\n viewport: Viewport,\n draggables: DraggableDimensionMap,\n maxScrollChange: Position,\n};\n\nfunction getDraggables(\n ids: DraggableId[],\n draggables: DraggableDimensionMap,\n): DraggableDimension[] {\n return ids.map((id: DraggableId): DraggableDimension => draggables[id]);\n}\n\nfunction tryGetVisible(\n id: DraggableId,\n groups: DisplacementGroups[],\n): Displacement | null {\n for (let i = 0; i < groups.length; i++) {\n const displacement: Displacement | null = groups[i].visible[id];\n if (displacement) {\n return displacement;\n }\n }\n return null;\n}\n\nexport default ({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange,\n}: SpeculativeArgs): DragImpact => {\n const scrolledViewport: Viewport = scrollViewport(\n viewport,\n add(viewport.scroll.current, maxScrollChange),\n );\n const scrolledDroppable: DroppableDimension = destination.frame\n ? scrollDroppable(\n destination,\n add(destination.frame.scroll.current, maxScrollChange),\n )\n : destination;\n\n const last: DisplacementGroups = impact.displaced;\n const withViewportScroll: DisplacementGroups = getDisplacementGroups({\n afterDragging: getDraggables(last.all, draggables),\n destination,\n displacedBy: impact.displacedBy,\n viewport: scrolledViewport.frame,\n last,\n // we want the addition to be animated\n forceShouldAnimate: false,\n });\n const withDroppableScroll: DisplacementGroups = getDisplacementGroups({\n afterDragging: getDraggables(last.all, draggables),\n destination: scrolledDroppable,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n last,\n // we want the addition to be animated\n forceShouldAnimate: false,\n });\n\n const invisible: DraggableIdMap = {};\n const visible: DisplacementMap = {};\n const groups: DisplacementGroups[] = [\n // this will populate the previous entries with the correct animation values\n last,\n withViewportScroll,\n withDroppableScroll,\n ];\n\n last.all.forEach((id: DraggableId) => {\n const displacement: Displacement | null = tryGetVisible(id, groups);\n\n if (displacement) {\n visible[id] = displacement;\n return;\n }\n invisible[id] = true;\n });\n\n const newImpact: DragImpact = {\n ...impact,\n displaced: { all: last.all, invisible, visible },\n };\n\n return newImpact;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type { Viewport } from '../../types';\nimport { add } from '../position';\n\nexport default (viewport: Viewport, point: Position): Position =>\n add(viewport.scroll.diff.displacement, point);\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type { Viewport, DraggableDimension } from '../../../types';\nimport { add, subtract } from '../../position';\nimport withViewportDisplacement from '../../with-scroll-change/with-viewport-displacement';\n\n// Exact\ntype Args = {\n pageBorderBoxCenter: Position,\n draggable: DraggableDimension,\n viewport: Viewport,\n};\n\nexport default ({\n pageBorderBoxCenter,\n draggable,\n viewport,\n}: Args): Position => {\n const withoutPageScrollChange: Position = withViewportDisplacement(\n viewport,\n pageBorderBoxCenter,\n );\n\n const offset: Position = subtract(\n withoutPageScrollChange,\n draggable.page.borderBox.center,\n );\n\n return add(draggable.client.borderBox.center, offset);\n};\n","// @flow\nimport { type Position, type Rect, type Spacing } from 'css-box-model';\nimport { subtract } from '../../position';\nimport { offsetByPosition } from '../../spacing';\nimport {\n isTotallyVisible,\n isTotallyVisibleOnAxis,\n type Args as IsVisibleArgs,\n} from '../../visibility/is-visible';\nimport type { DraggableDimension, DroppableDimension } from '../../../types';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n destination: DroppableDimension,\n newPageBorderBoxCenter: Position,\n viewport: Rect,\n // only allowing a 'false' value. Being super clear\n withDroppableDisplacement: false,\n onlyOnMainAxis?: boolean,\n};\n\nexport default ({\n draggable,\n destination,\n newPageBorderBoxCenter,\n viewport,\n withDroppableDisplacement,\n onlyOnMainAxis = false,\n}: Args): boolean => {\n // What would the location of the Draggable be once the move is completed?\n // We are not considering margins for this calculation.\n // This is because a move might move a Draggable slightly outside of the bounds\n // of a Droppable (which is okay)\n const changeNeeded: Position = subtract(\n newPageBorderBoxCenter,\n draggable.page.borderBox.center,\n );\n const shifted: Spacing = offsetByPosition(\n draggable.page.borderBox,\n changeNeeded,\n );\n\n // Must be totally visible, not just partially visible.\n const args: IsVisibleArgs = {\n target: shifted,\n destination,\n withDroppableDisplacement,\n viewport,\n };\n\n return onlyOnMainAxis ? isTotallyVisibleOnAxis(args) : isTotallyVisible(args);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n DragImpact,\n Viewport,\n LiftEffect,\n} from '../../../types';\nimport type { PublicResult } from '../move-in-direction-types';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport moveToNextCombine from './move-to-next-combine';\nimport moveToNextIndex from './move-to-next-index';\nimport isHomeOf from '../../droppable/is-home-of';\nimport getPageBorderBoxCenter from '../../get-center-from-impact/get-page-border-box-center';\nimport speculativelyIncrease from '../../update-displacement-visibility/speculatively-increase';\nimport getClientFromPageBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center';\nimport { subtract } from '../../position';\nimport isTotallyVisibleInNewLocation from './is-totally-visible-in-new-location';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n draggable: DraggableDimension,\n destination: DroppableDimension,\n draggables: DraggableDimensionMap,\n previousImpact: DragImpact,\n viewport: Viewport,\n previousClientSelection: Position,\n previousPageBorderBoxCenter: Position,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n draggable,\n destination,\n draggables,\n previousImpact,\n viewport,\n previousPageBorderBoxCenter,\n previousClientSelection,\n afterCritical,\n}: Args): PublicResult | null => {\n if (!destination.isEnabled) {\n return null;\n }\n\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n destination.descriptor.id,\n draggables,\n );\n const isInHomeList: boolean = isHomeOf(draggable, destination);\n\n const impact: DragImpact | null =\n moveToNextCombine({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact,\n }) ||\n moveToNextIndex({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical,\n });\n\n if (!impact) {\n return null;\n }\n\n const pageBorderBoxCenter: Position = getPageBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical,\n });\n\n const isVisibleInNewLocation: boolean = isTotallyVisibleInNewLocation({\n draggable,\n destination,\n newPageBorderBoxCenter: pageBorderBoxCenter,\n viewport: viewport.frame,\n // already taken into account by getPageBorderBoxCenter\n withDroppableDisplacement: false,\n // we only care about it being visible relative to the main axis\n // this is important with dynamic changes as scroll bar and toggle\n // on the cross axis during a drag\n onlyOnMainAxis: true,\n });\n\n if (isVisibleInNewLocation) {\n // using the client center as the selection point\n const clientSelection: Position = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport,\n });\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null,\n };\n }\n\n const distance: Position = subtract(\n pageBorderBoxCenter,\n previousPageBorderBoxCenter,\n );\n\n const cautious: DragImpact = speculativelyIncrease({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange: distance,\n });\n\n return {\n clientSelection: previousClientSelection,\n impact: cautious,\n scrollJumpRequest: distance,\n };\n};\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport { closest } from '../../position';\nimport isWithin from '../../is-within';\nimport { getCorners } from '../../spacing';\nimport isPartiallyVisibleThroughFrame from '../../visibility/is-partially-visible-through-frame';\nimport { toDroppableList } from '../../dimension-structures';\nimport type {\n Axis,\n DroppableDimension,\n DroppableDimensionMap,\n Viewport,\n} from '../../../types';\n\n// Exact\ntype GetBestDroppableArgs = {\n isMovingForward: boolean,\n // the current position of the dragging item\n pageBorderBoxCenter: Position,\n // the home of the draggable\n source: DroppableDimension,\n // all the droppables in the system\n droppables: DroppableDimensionMap,\n viewport: Viewport,\n};\n\nconst getKnownActive = (droppable: DroppableDimension): Rect => {\n const rect: Rect | null = droppable.subject.active;\n\n invariant(rect, 'Cannot get clipped area from droppable');\n\n return rect;\n};\n\nexport default ({\n isMovingForward,\n pageBorderBoxCenter,\n source,\n droppables,\n viewport,\n}: GetBestDroppableArgs): DroppableDimension | null => {\n const active: Rect | null = source.subject.active;\n\n if (!active) {\n return null;\n }\n\n const axis: Axis = source.axis;\n const isBetweenSourceClipped = isWithin(active[axis.start], active[axis.end]);\n const candidates: DroppableDimension[] = toDroppableList(droppables)\n // Remove the source droppable from the list\n .filter((droppable: DroppableDimension): boolean => droppable !== source)\n // Remove any options that are not enabled\n .filter((droppable: DroppableDimension): boolean => droppable.isEnabled)\n // Remove any droppables that do not have a visible subject\n .filter((droppable: DroppableDimension): boolean =>\n Boolean(droppable.subject.active),\n )\n // Remove any that are not visible in the window\n .filter((droppable: DroppableDimension): boolean =>\n isPartiallyVisibleThroughFrame(viewport.frame)(getKnownActive(droppable)),\n )\n .filter((droppable: DroppableDimension): boolean => {\n const activeOfTarget: Rect = getKnownActive(droppable);\n\n // is the target in front of the source on the cross axis?\n if (isMovingForward) {\n return active[axis.crossAxisEnd] < activeOfTarget[axis.crossAxisEnd];\n }\n // is the target behind the source on the cross axis?\n return activeOfTarget[axis.crossAxisStart] < active[axis.crossAxisStart];\n })\n // Must have some overlap on the main axis\n .filter((droppable: DroppableDimension): boolean => {\n const activeOfTarget: Rect = getKnownActive(droppable);\n\n const isBetweenDestinationClipped = isWithin(\n activeOfTarget[axis.start],\n activeOfTarget[axis.end],\n );\n\n return (\n isBetweenSourceClipped(activeOfTarget[axis.start]) ||\n isBetweenSourceClipped(activeOfTarget[axis.end]) ||\n isBetweenDestinationClipped(active[axis.start]) ||\n isBetweenDestinationClipped(active[axis.end])\n );\n })\n // Sort on the cross axis\n .sort((a: DroppableDimension, b: DroppableDimension) => {\n const first: number = getKnownActive(a)[axis.crossAxisStart];\n const second: number = getKnownActive(b)[axis.crossAxisStart];\n\n if (isMovingForward) {\n return first - second;\n }\n return second - first;\n })\n // Find the droppables that have the same cross axis value as the first item\n .filter(\n (\n droppable: DroppableDimension,\n _index: number,\n array: DroppableDimension[],\n ): boolean =>\n getKnownActive(droppable)[axis.crossAxisStart] ===\n getKnownActive(array[0])[axis.crossAxisStart],\n );\n\n // no possible candidates\n if (!candidates.length) {\n return null;\n }\n\n // only one result - all done!\n if (candidates.length === 1) {\n return candidates[0];\n }\n\n // At this point we have a number of candidates that\n // all have the same axis.crossAxisStart value.\n\n // Check to see if the center position is within the size of a Droppable on the main axis\n const contains: DroppableDimension[] = candidates.filter(\n (droppable: DroppableDimension) => {\n const isWithinDroppable = isWithin(\n getKnownActive(droppable)[axis.start],\n getKnownActive(droppable)[axis.end],\n );\n return isWithinDroppable(pageBorderBoxCenter[axis.line]);\n },\n );\n\n if (contains.length === 1) {\n return contains[0];\n }\n\n // The center point of the draggable falls on the boundary between two droppables\n if (contains.length > 1) {\n // sort on the main axis and choose the first\n return contains.sort(\n (a: DroppableDimension, b: DroppableDimension): number =>\n getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start],\n )[0];\n }\n\n // The center is not contained within any droppable\n // 1. Find the candidate that has the closest corner\n // 2. If there is a tie - choose the one that is first on the main axis\n return candidates.sort(\n (a: DroppableDimension, b: DroppableDimension): number => {\n const first = closest(pageBorderBoxCenter, getCorners(getKnownActive(a)));\n const second = closest(\n pageBorderBoxCenter,\n getCorners(getKnownActive(b)),\n );\n\n // if the distances are not equal - choose the shortest\n if (first !== second) {\n return first - second;\n }\n\n // They both have the same distance -\n // choose the one that is first on the main axis\n return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];\n },\n )[0];\n};\n","// @flow\nimport type { Position, Rect, Spacing } from 'css-box-model';\nimport type { DraggableDimension, LiftEffect } from '../../../types';\nimport { negate, subtract } from '../../position';\nimport { offsetByPosition } from '../../spacing';\nimport didStartAfterCritical from '../../did-start-after-critical';\n\nexport const getCurrentPageBorderBoxCenter = (\n draggable: DraggableDimension,\n afterCritical: LiftEffect,\n): Position => {\n // If an item started displaced it is now resting\n // in a non-displaced location\n const original: Position = draggable.page.borderBox.center;\n return didStartAfterCritical(draggable.descriptor.id, afterCritical)\n ? subtract(original, afterCritical.displacedBy.point)\n : original;\n};\n\nexport const getCurrentPageBorderBox = (\n draggable: DraggableDimension,\n afterCritical: LiftEffect,\n): Spacing => {\n // If an item started displaced it is now resting\n // in a non-displaced location\n const original: Rect = draggable.page.borderBox;\n\n return didStartAfterCritical(draggable.descriptor.id, afterCritical)\n ? offsetByPosition(original, negate(afterCritical.displacedBy.point))\n : original;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type {\n Viewport,\n DraggableDimension,\n DroppableDimension,\n LiftEffect,\n} from '../../../types';\nimport { distance } from '../../position';\nimport { isTotallyVisible } from '../../visibility/is-visible';\nimport withDroppableDisplacement from '../../with-scroll-change/with-droppable-displacement';\nimport {\n getCurrentPageBorderBox,\n getCurrentPageBorderBoxCenter,\n} from './without-starting-displacement';\n\n// Exact\ntype Args = {\n pageBorderBoxCenter: Position,\n viewport: Viewport,\n // the droppable that is being moved to\n destination: DroppableDimension,\n // the droppables inside the destination\n insideDestination: DraggableDimension[],\n afterCritical: LiftEffect,\n};\n\nexport default ({\n pageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical,\n}: Args): DraggableDimension | null => {\n const sorted: DraggableDimension[] = insideDestination\n .filter((draggable: DraggableDimension): boolean =>\n // Allowing movement to draggables that are not visible in the viewport\n // but must be visible in the droppable\n // We can improve this, but this limitation is easier for now\n isTotallyVisible({\n target: getCurrentPageBorderBox(draggable, afterCritical),\n destination,\n viewport: viewport.frame,\n withDroppableDisplacement: true,\n }),\n )\n .sort((a: DraggableDimension, b: DraggableDimension): number => {\n // Need to consider the change in scroll in the destination\n const distanceToA = distance(\n pageBorderBoxCenter,\n withDroppableDisplacement(\n destination,\n getCurrentPageBorderBoxCenter(a, afterCritical),\n ),\n );\n const distanceToB = distance(\n pageBorderBoxCenter,\n withDroppableDisplacement(\n destination,\n getCurrentPageBorderBoxCenter(b, afterCritical),\n ),\n );\n\n // if a is closer - return a\n if (distanceToA < distanceToB) {\n return -1;\n }\n\n // if b is closer - return b\n if (distanceToB < distanceToA) {\n return 1;\n }\n\n // if the distance to a and b are the same:\n // return the one with the lower index (it will be higher on the main axis)\n return a.descriptor.index - b.descriptor.index;\n });\n\n return sorted[0] || null;\n};\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { type Position } from 'css-box-model';\nimport type { Axis, DisplacedBy } from '../types';\nimport { patch } from './position';\n\n// TODO: memoization needed?\nexport default memoizeOne(function getDisplacedBy(\n axis: Axis,\n displaceBy: Position,\n): DisplacedBy {\n const displacement: number = displaceBy[axis.line];\n return {\n value: displacement,\n point: patch(axis.line, displacement),\n };\n});\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport type {\n Axis,\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n Scrollable,\n DroppableSubject,\n PlaceholderInSubject,\n} from '../../types';\nimport getDraggablesInsideDroppable from '../get-draggables-inside-droppable';\nimport { add, patch } from '../position';\nimport getSubject from './util/get-subject';\nimport isHomeOf from './is-home-of';\nimport getDisplacedBy from '../get-displaced-by';\n\nconst getRequiredGrowthForPlaceholder = (\n droppable: DroppableDimension,\n placeholderSize: Position,\n draggables: DraggableDimensionMap,\n): Position | null => {\n const axis: Axis = droppable.axis;\n\n // A virtual list will most likely not contain all of the Draggables\n // so counting them does not help.\n if (droppable.descriptor.mode === 'virtual') {\n return patch(axis.line, placeholderSize[axis.line]);\n }\n\n // TODO: consider margin collapsing?\n // Using contentBox as that is where the Draggables will sit\n const availableSpace: number = droppable.subject.page.contentBox[axis.size];\n const insideDroppable: DraggableDimension[] = getDraggablesInsideDroppable(\n droppable.descriptor.id,\n draggables,\n );\n const spaceUsed: number = insideDroppable.reduce(\n (sum: number, dimension: DraggableDimension): number =>\n sum + dimension.client.marginBox[axis.size],\n 0,\n );\n const requiredSpace: number = spaceUsed + placeholderSize[axis.line];\n const needsToGrowBy: number = requiredSpace - availableSpace;\n\n // nothing to do here\n if (needsToGrowBy <= 0) {\n return null;\n }\n\n return patch(axis.line, needsToGrowBy);\n};\n\nconst withMaxScroll = (frame: Scrollable, max: Position): Scrollable => ({\n ...frame,\n scroll: {\n ...frame.scroll,\n max,\n },\n});\n\nexport const addPlaceholder = (\n droppable: DroppableDimension,\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n): DroppableDimension => {\n const frame: Scrollable | null = droppable.frame;\n\n invariant(\n !isHomeOf(draggable, droppable),\n 'Should not add placeholder space to home list',\n );\n\n invariant(\n !droppable.subject.withPlaceholder,\n 'Cannot add placeholder size to a subject when it already has one',\n );\n\n const placeholderSize: Position = getDisplacedBy(\n droppable.axis,\n draggable.displaceBy,\n ).point;\n\n const requiredGrowth: Position | null = getRequiredGrowthForPlaceholder(\n droppable,\n placeholderSize,\n draggables,\n );\n\n const added: PlaceholderInSubject = {\n placeholderSize,\n increasedBy: requiredGrowth,\n oldFrameMaxScroll: droppable.frame ? droppable.frame.scroll.max : null,\n };\n\n if (!frame) {\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: droppable.frame,\n });\n return {\n ...droppable,\n subject,\n };\n }\n\n const maxScroll: Position = requiredGrowth\n ? add(frame.scroll.max, requiredGrowth)\n : frame.scroll.max;\n\n const newFrame: Scrollable = withMaxScroll(frame, maxScroll);\n\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: newFrame,\n });\n return {\n ...droppable,\n subject,\n frame: newFrame,\n };\n};\n\nexport const removePlaceholder = (\n droppable: DroppableDimension,\n): DroppableDimension => {\n const added: PlaceholderInSubject | null = droppable.subject.withPlaceholder;\n invariant(\n added,\n 'Cannot remove placeholder form subject when there was none',\n );\n\n const frame: Scrollable | null = droppable.frame;\n\n if (!frame) {\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: null,\n // cleared\n withPlaceholder: null,\n });\n return {\n ...droppable,\n subject,\n };\n }\n\n const oldMaxScroll: Position | null = added.oldFrameMaxScroll;\n invariant(\n oldMaxScroll,\n 'Expected droppable with frame to have old max frame scroll when removing placeholder',\n );\n\n const newFrame: Scrollable = withMaxScroll(frame, oldMaxScroll);\n\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: newFrame,\n // cleared\n withPlaceholder: null,\n });\n return {\n ...droppable,\n subject,\n frame: newFrame,\n };\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DragImpact,\n DraggableDimension,\n DraggableDimensionMap,\n DroppableDimension,\n Viewport,\n DisplacedBy,\n LiftEffect,\n} from '../../../types';\nimport getDisplacedBy from '../../get-displaced-by';\nimport { emptyGroups, noDisplacedBy } from '../../no-impact';\nimport getPageBorderBoxCenter from '../../get-center-from-impact/get-page-border-box-center';\nimport isTotallyVisibleInNewLocation from '../move-to-next-place/is-totally-visible-in-new-location';\nimport { addPlaceholder } from '../../droppable/with-placeholder';\nimport isHomeOf from '../../droppable/is-home-of';\nimport calculateReorderImpact from '../../calculate-drag-impact/calculate-reorder-impact';\n\n// Exact\ntype Args = {\n previousPageBorderBoxCenter: Position,\n moveRelativeTo: DraggableDimension | null,\n insideDestination: DraggableDimension[],\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n destination: DroppableDimension,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n previousPageBorderBoxCenter,\n moveRelativeTo,\n insideDestination,\n draggable,\n draggables,\n destination,\n viewport,\n afterCritical,\n}: Args): DragImpact | null => {\n if (!moveRelativeTo) {\n // Draggables available, but none are candidates for movement\n if (insideDestination.length) {\n return null;\n }\n\n // Try move to top of empty list if it is visible\n const proposed: DragImpact = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: 0,\n },\n },\n };\n const proposedPageBorderBoxCenter: Position = getPageBorderBoxCenter({\n impact: proposed,\n draggable,\n droppable: destination,\n draggables,\n afterCritical,\n });\n\n // need to add room for a placeholder in a foreign list\n const withPlaceholder: DroppableDimension = isHomeOf(draggable, destination)\n ? destination\n : addPlaceholder(destination, draggable, draggables);\n\n const isVisibleInNewLocation: boolean = isTotallyVisibleInNewLocation({\n draggable,\n destination: withPlaceholder,\n newPageBorderBoxCenter: proposedPageBorderBoxCenter,\n viewport: viewport.frame,\n // already taken into account by getPageBorderBoxCenter\n withDroppableDisplacement: false,\n onlyOnMainAxis: true,\n });\n\n return isVisibleInNewLocation ? proposed : null;\n }\n\n const isGoingBeforeTarget: boolean = Boolean(\n // Using <= as we optimise slightly for moving before items in a new list\n // This is nicer in lists with fixed height items\n previousPageBorderBoxCenter[destination.axis.line] <=\n moveRelativeTo.page.borderBox.center[destination.axis.line],\n );\n\n const proposedIndex: number = (() => {\n const relativeTo: number = moveRelativeTo.descriptor.index;\n\n if (moveRelativeTo.descriptor.id === draggable.descriptor.id) {\n return relativeTo;\n }\n\n if (isGoingBeforeTarget) {\n return relativeTo;\n }\n\n return relativeTo + 1;\n })();\n\n const displacedBy: DisplacedBy = getDisplacedBy(\n destination.axis,\n draggable.displaceBy,\n );\n\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n // last groups won't be relevant\n last: emptyGroups,\n index: proposedIndex,\n });\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type { PublicResult } from '../move-in-direction-types';\nimport type {\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n DroppableDimensionMap,\n DragImpact,\n Viewport,\n LiftEffect,\n} from '../../../types';\nimport getBestCrossAxisDroppable from './get-best-cross-axis-droppable';\nimport getClosestDraggable from './get-closest-draggable';\n// import moveToNewDroppable from './move-to-new-droppable';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport getClientFromPageBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center';\nimport getPageBorderBoxCenter from '../../get-center-from-impact/get-page-border-box-center';\nimport moveToNewDroppable from './move-to-new-droppable';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n // the current page center of the dragging item\n previousPageBorderBoxCenter: Position,\n // the dragging item\n draggable: DraggableDimension,\n // the droppable the dragging item is in\n isOver: DroppableDimension,\n // all the dimensions in the system\n draggables: DraggableDimensionMap,\n droppables: DroppableDimensionMap,\n // the current viewport\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport,\n afterCritical,\n}: Args): PublicResult | null => {\n // not considering the container scroll changes as container scrolling cancels a keyboard drag\n\n const destination: DroppableDimension | null = getBestCrossAxisDroppable({\n isMovingForward,\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n source: isOver,\n droppables,\n viewport,\n });\n\n // nothing available to move to\n if (!destination) {\n return null;\n }\n\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n destination.descriptor.id,\n draggables,\n );\n\n const moveRelativeTo: DraggableDimension | null= getClosestDraggable({\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical,\n });\n\n const impact: DragImpact | null = moveToNewDroppable({\n previousPageBorderBoxCenter,\n destination,\n draggable,\n draggables,\n moveRelativeTo,\n insideDestination,\n viewport,\n afterCritical,\n });\n\n if (!impact) {\n return null;\n }\n\n const pageBorderBoxCenter: Position = getPageBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical,\n });\n\n const clientSelection: Position = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport,\n });\n\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null,\n };\n};\n","// @flow\nimport type { ImpactLocation, DroppableId, DragImpact } from '../../types';\n\nexport default (impact: DragImpact): DroppableId | null => {\n const at: ImpactLocation | null = impact.at;\n\n if (!at) {\n return null;\n }\n\n if (at.type === 'REORDER') {\n return at.destination.droppableId;\n }\n\n return at.combine.droppableId;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type { PublicResult } from './move-in-direction-types';\nimport type {\n DroppableId,\n DraggingState,\n Direction,\n DroppableDimension,\n DraggableDimension,\n DroppableDimensionMap,\n DragImpact,\n} from '../../types';\nimport moveToNextPlace from './move-to-next-place';\nimport moveCrossAxis from './move-cross-axis';\nimport whatIsDraggedOver from '../droppable/what-is-dragged-over';\n\n// Exact\ntype Args = {\n state: DraggingState,\n type: 'MOVE_UP' | 'MOVE_RIGHT' | 'MOVE_DOWN' | 'MOVE_LEFT',\n};\n\nconst getDroppableOver = (\n impact: DragImpact,\n droppables: DroppableDimensionMap,\n): DroppableDimension | null => {\n const id: DroppableId | null = whatIsDraggedOver(impact);\n return id ? droppables[id] : null;\n};\n\nexport default ({ state, type }: Args): PublicResult | null => {\n const isActuallyOver: DroppableDimension | null = getDroppableOver(\n state.impact,\n state.dimensions.droppables,\n );\n const isMainAxisMovementAllowed: boolean = Boolean(isActuallyOver);\n const home: DroppableDimension =\n state.dimensions.droppables[state.critical.droppable.id];\n // use home when not actually over a droppable (can happen when move is disabled)\n const isOver: DroppableDimension = isActuallyOver || home;\n\n const direction: Direction = isOver.axis.direction;\n const isMovingOnMainAxis: boolean =\n (direction === 'vertical' &&\n (type === 'MOVE_UP' || type === 'MOVE_DOWN')) ||\n (direction === 'horizontal' &&\n (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT'));\n\n // This movement is not permitted right now\n if (isMovingOnMainAxis && !isMainAxisMovementAllowed) {\n return null;\n }\n\n const isMovingForward: boolean =\n type === 'MOVE_DOWN' || type === 'MOVE_RIGHT';\n\n const draggable: DraggableDimension =\n state.dimensions.draggables[state.critical.draggable.id];\n const previousPageBorderBoxCenter: Position =\n state.current.page.borderBoxCenter;\n const { draggables, droppables } = state.dimensions;\n\n return isMovingOnMainAxis\n ? moveToNextPlace({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n destination: isOver,\n draggables,\n viewport: state.viewport,\n previousClientSelection: state.current.client.selection,\n previousImpact: state.impact,\n afterCritical: state.afterCritical,\n })\n : moveCrossAxis({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport: state.viewport,\n afterCritical: state.afterCritical,\n });\n};\n","// @flow\nimport type { CollectingState, DraggingState, State } from '../types';\n\nexport default function isMovementAllowed(\n state: State,\n): state is DraggingState | CollectingState {\n return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';\n}\n\n// Using function declaration as arrow function does not play well with the %checks syntax\n// export default function isMovementAllowed(state: State): boolean %checks {\n// return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';\n// }\n","// @flow\nimport { type Position, type Spacing } from 'css-box-model';\nimport isWithin from '../is-within';\n\nexport default function isPositionInFrame(frame: Spacing) {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return function run(point: Position) {\n return isWithinVertical(point.y) && isWithinHorizontal(point.x);\n };\n}\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport type {\n DroppableDimension,\n DroppableDimensionMap,\n DroppableId,\n DraggableDimension,\n Axis,\n} from '../types';\nimport { toDroppableList } from './dimension-structures';\nimport isPositionInFrame from './visibility/is-position-in-frame';\nimport { distance, patch } from './position';\nimport isWithin from './is-within';\n\n// https://stackoverflow.com/questions/306316/determine-if-two-rectangles-overlap-each-other\n// https://silentmatt.com/rectangle-intersection/\nfunction getHasOverlap(first: Rect, second: Rect): boolean {\n return (\n first.left < second.right &&\n first.right > second.left &&\n first.top < second.bottom &&\n first.bottom > second.top\n );\n}\n\n// Exact\ntype Args = {\n pageBorderBox: Rect,\n draggable: DraggableDimension,\n droppables: DroppableDimensionMap,\n};\n\n// Exact\ntype WithDistance = {\n distance: number,\n id: DroppableId,\n};\n\n// Exact\ntype GetFurthestArgs = {\n pageBorderBox: Rect,\n draggable: DraggableDimension,\n candidates: DroppableDimension[],\n};\n\nfunction getFurthestAway({\n pageBorderBox,\n draggable,\n candidates,\n}: GetFurthestArgs): DroppableId | null {\n // We are not comparing the center of the home list with the target list as it would\n // give preference to giant lists\n\n // We are measuring the distance from where the draggable started\n // to where it is *hitting* the candidate\n // Note: The hit point might technically not be in the bounds of the candidate\n\n const startCenter: Position = draggable.page.borderBox.center;\n const sorted: WithDistance[] = candidates\n .map((candidate: DroppableDimension): WithDistance => {\n const axis: Axis = candidate.axis;\n const target: Position = patch(\n candidate.axis.line,\n // use the current center of the dragging item on the main axis\n pageBorderBox.center[axis.line],\n // use the center of the list on the cross axis\n candidate.page.borderBox.center[axis.crossAxisLine],\n );\n\n return {\n id: candidate.descriptor.id,\n distance: distance(startCenter, target),\n };\n })\n // largest value will be first\n .sort((a: WithDistance, b: WithDistance) => b.distance - a.distance);\n\n // just being safe\n return sorted[0] ? sorted[0].id : null;\n}\n\nexport default function getDroppableOver({\n pageBorderBox,\n draggable,\n droppables,\n}: Args): DroppableId | null {\n // We know at this point that some overlap has to exist\n const candidates: DroppableDimension[] = toDroppableList(droppables).filter(\n (item: DroppableDimension): boolean => {\n // Cannot be a candidate when disabled\n if (!item.isEnabled) {\n return false;\n }\n\n // Cannot be a candidate when there is no visible area\n const active: Rect | null = item.subject.active;\n if (!active) {\n return false;\n }\n\n // Cannot be a candidate when dragging item is not over the droppable at all\n if (!getHasOverlap(pageBorderBox, active)) {\n return false;\n }\n\n // 1. Candidate if the center position is over a droppable\n if (isPositionInFrame(active)(pageBorderBox.center)) {\n return true;\n }\n\n // 2. Candidate if an edge is over the cross axis half way point\n // 3. Candidate if dragging item is totally over droppable on cross axis\n\n const axis: Axis = item.axis;\n const childCenter: number = active.center[axis.crossAxisLine];\n const crossAxisStart: number = pageBorderBox[axis.crossAxisStart];\n const crossAxisEnd: number = pageBorderBox[axis.crossAxisEnd];\n\n const isContained = isWithin(\n active[axis.crossAxisStart],\n active[axis.crossAxisEnd],\n );\n\n const isStartContained: boolean = isContained(crossAxisStart);\n const isEndContained: boolean = isContained(crossAxisEnd);\n\n // Dragging item is totally covering the active area\n if (!isStartContained && !isEndContained) {\n return true;\n }\n\n /**\n * edges must go beyond the center line in order to avoid\n * cases were both conditions are satisfied.\n */\n if (isStartContained) {\n return crossAxisStart < childCenter;\n }\n\n return crossAxisEnd > childCenter;\n },\n );\n\n if (!candidates.length) {\n return null;\n }\n\n // Only one candidate - use that!\n if (candidates.length === 1) {\n return candidates[0].descriptor.id;\n }\n\n // Multiple options returned\n // Should only occur with really large items\n // Going to use fallback: distance from home\n return getFurthestAway({\n pageBorderBox,\n draggable,\n candidates,\n });\n}\n","// @flow\nimport { getRect } from 'css-box-model';\nimport type { Rect, Position } from 'css-box-model';\nimport { offsetByPosition } from './spacing';\n\nexport const offsetRectByPosition = (rect: Rect, point: Position): Rect =>\n getRect(offsetByPosition(rect, point));\n","// @flow\nimport { type Rect } from 'css-box-model';\nimport type { Scrollable, DroppableDimension } from '../../types';\nimport { offsetRectByPosition } from '../rect';\n\nexport default (droppable: DroppableDimension, area: Rect): Rect => {\n const frame: Scrollable | null = droppable.frame;\n if (!frame) {\n return area;\n }\n\n return offsetRectByPosition(area, frame.scroll.diff.value);\n};\n","// @flow\nimport type { DisplacementGroups, DraggableId } from '../types';\n\n// Exact\ntype Args = {\n displaced: DisplacementGroups,\n id: DraggableId,\n};\n\nexport default function getIsDisplaced({ displaced, id }: Args): boolean {\n return Boolean(displaced.visible[id] || displaced.invisible[id]);\n}\n","// @flow\nimport { type Rect } from 'css-box-model';\nimport type {\n DraggableId,\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n Axis,\n DisplacementGroups,\n Viewport,\n DisplacedBy,\n LiftEffect,\n} from '../../types';\nimport getDisplacedBy from '../get-displaced-by';\nimport removeDraggableFromList from '../remove-draggable-from-list';\nimport isHomeOf from '../droppable/is-home-of';\nimport { find } from '../../native-with-fallback';\nimport getDidStartAfterCritical from '../did-start-after-critical';\nimport calculateReorderImpact from '../calculate-drag-impact/calculate-reorder-impact';\nimport getIsDisplaced from '../get-is-displaced';\n\n// Exact\ntype Args = {\n pageBorderBoxWithDroppableScroll: Rect,\n draggable: DraggableDimension,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n last: DisplacementGroups,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\n// Exact\ntype AtIndexArgs = {\n draggable: DraggableDimension,\n closest?: DraggableDimension | null,\n inHomeList: boolean,\n};\n\nfunction atIndex({ draggable, closest, inHomeList }: AtIndexArgs): number | null {\n if (!closest) {\n return null;\n }\n\n if (!inHomeList) {\n return closest.descriptor.index;\n }\n\n if (closest.descriptor.index > draggable.descriptor.index) {\n return closest.descriptor.index - 1;\n }\n\n return closest.descriptor.index;\n}\n\nexport default ({\n pageBorderBoxWithDroppableScroll: targetRect,\n draggable,\n destination,\n insideDestination,\n last,\n viewport,\n afterCritical,\n}: Args): DragImpact => {\n const axis: Axis = destination.axis;\n const displacedBy: DisplacedBy = getDisplacedBy(\n destination.axis,\n draggable.displaceBy,\n );\n const displacement: number = displacedBy.value;\n\n const targetStart: number = targetRect[axis.start];\n const targetEnd: number = targetRect[axis.end];\n\n const withoutDragging: DraggableDimension[] = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n const closest: DraggableDimension | null | undefined = find(\n withoutDragging,\n (child: DraggableDimension): boolean => {\n const id: DraggableId = child.descriptor.id;\n const childCenter: number = child.page.borderBox.center[axis.line];\n\n const didStartAfterCritical: boolean = getDidStartAfterCritical(\n id,\n afterCritical,\n );\n\n const isDisplaced: boolean = getIsDisplaced({ displaced: last, id });\n\n /*\n Note: we change things when moving *past* the child center - not when it hits the center\n If we make it when we *hit* the child center then there can be\n a hit on the next update causing a flicker.\n\n - Update 1: targetBottom hits center => displace backwards\n - Update 2: targetStart is now hitting the displaced center => displace forwards\n - Update 3: goto 1 (boom)\n */\n\n if (didStartAfterCritical) {\n // Continue to displace while targetEnd before the childCenter\n // Move once we *move forward past* the childCenter\n if (isDisplaced) {\n return targetEnd <= childCenter;\n }\n\n // Has been moved backwards from where it started\n // Displace forwards when targetStart *moves backwards past* the displaced childCenter\n return targetStart < childCenter - displacement;\n }\n\n // Item has been shifted forward.\n // Remove displacement when targetEnd moves forward past the displaced center\n if (isDisplaced) {\n return targetEnd <= childCenter + displacement;\n }\n\n // Item is behind the dragging item\n // We want to displace it if the targetStart goes *backwards past* the childCenter\n return targetStart < childCenter;\n },\n );\n\n const newIndex: number | null = atIndex({\n draggable,\n closest,\n inHomeList: isHomeOf(draggable, destination),\n });\n\n // TODO: index cannot be null?\n // otherwise return null from there and return empty impact\n // that was calculate reorder impact does not need to account for a null index\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last,\n displacedBy,\n index: newIndex,\n });\n};\n","// @flow\nimport type { Rect } from 'css-box-model';\nimport type {\n DraggableId,\n Axis,\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n LiftEffect,\n DisplacedBy,\n} from '../../types';\nimport { find } from '../../native-with-fallback';\nimport getDidStartAfterCritical from '../did-start-after-critical';\nimport getDisplacedBy from '../get-displaced-by';\nimport getIsDisplaced from '../get-is-displaced';\nimport removeDraggableFromList from '../remove-draggable-from-list';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n pageBorderBoxWithDroppableScroll: Rect,\n previousImpact: DragImpact,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n afterCritical: LiftEffect,\n};\n\n// exported for testing\nexport const combineThresholdDivisor: number = 4;\n\nexport default ({\n draggable,\n pageBorderBoxWithDroppableScroll: targetRect,\n previousImpact,\n destination,\n insideDestination,\n afterCritical,\n}: Args): DragImpact | null => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const axis: Axis = destination.axis;\n const displacedBy: DisplacedBy = getDisplacedBy(\n destination.axis,\n draggable.displaceBy,\n );\n const displacement: number = displacedBy.value;\n\n const targetStart: number = targetRect[axis.start];\n const targetEnd: number = targetRect[axis.end];\n\n const withoutDragging: DraggableDimension[] = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n const combineWith: DraggableDimension | null | undefined = find(\n withoutDragging,\n (child: DraggableDimension): boolean => {\n const id: DraggableId = child.descriptor.id;\n const childRect: Rect = child.page.borderBox;\n const childSize: number = childRect[axis.size];\n const threshold: number = childSize / combineThresholdDivisor;\n\n const didStartAfterCritical: boolean = getDidStartAfterCritical(\n id,\n afterCritical,\n );\n\n const isDisplaced: boolean = getIsDisplaced({\n displaced: previousImpact.displaced,\n id,\n });\n\n /*\n Only combining when in the combine region\n As soon as a boundary is hit then no longer combining\n */\n\n if (didStartAfterCritical) {\n // In original position\n // Will combine with item when inside a band\n if (isDisplaced) {\n return (\n targetEnd > childRect[axis.start] + threshold &&\n targetEnd < childRect[axis.end] - threshold\n );\n }\n\n // child is now 'displaced' backwards from where it started\n // want to combine when we move backwards onto it\n return (\n targetStart > childRect[axis.start] - displacement + threshold &&\n targetStart < childRect[axis.end] - displacement - threshold\n );\n }\n\n // item has moved forwards\n if (isDisplaced) {\n return (\n targetEnd > childRect[axis.start] + displacement + threshold &&\n targetEnd < childRect[axis.end] + displacement - threshold\n );\n }\n\n // is in resting position - being moved backwards on to\n return (\n targetStart > childRect[axis.start] + threshold &&\n targetStart < childRect[axis.end] - threshold\n );\n },\n );\n\n if (!combineWith) {\n return null;\n }\n\n const impact: DragImpact = {\n // no change to displacement when combining\n displacedBy,\n displaced: previousImpact.displaced,\n at: {\n type: 'COMBINE',\n combine: {\n draggableId: combineWith.descriptor.id,\n droppableId: destination.descriptor.id,\n },\n },\n };\n return impact;\n};\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport type {\n DroppableId,\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DroppableDimensionMap,\n DragImpact,\n Viewport,\n LiftEffect,\n} from '../../types';\nimport getDroppableOver from '../get-droppable-over';\nimport getDraggablesInsideDroppable from '../get-draggables-inside-droppable';\nimport withDroppableScroll from '../with-scroll-change/with-droppable-scroll';\nimport getReorderImpact from './get-reorder-impact';\nimport getCombineImpact from './get-combine-impact';\nimport noImpact from '../no-impact';\nimport { offsetRectByPosition } from '../rect';\n\n// Exact\ntype Args = {\n pageOffset: Position,\n draggable: DraggableDimension,\n // all dimensions in system\n draggables: DraggableDimensionMap,\n droppables: DroppableDimensionMap,\n previousImpact: DragImpact,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n pageOffset,\n draggable,\n draggables,\n droppables,\n previousImpact,\n viewport,\n afterCritical,\n}: Args): DragImpact => {\n const pageBorderBox: Rect = offsetRectByPosition(\n draggable.page.borderBox,\n pageOffset,\n );\n\n const destinationId: DroppableId | null = getDroppableOver({\n pageBorderBox,\n draggable,\n droppables,\n });\n\n // not dragging over anything\n\n if (!destinationId) {\n // A big design decision was made here to collapse the home list\n // when not over any list. This yielded the most consistently beautiful experience.\n return noImpact;\n }\n\n const destination: DroppableDimension = droppables[destinationId];\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n destination.descriptor.id,\n draggables,\n );\n\n // Where the element actually is now.\n // Need to take into account the change of scroll in the droppable\n const pageBorderBoxWithDroppableScroll: Rect = withDroppableScroll(\n destination,\n pageBorderBox,\n );\n\n // checking combine first so we combine before any reordering\n return (\n getCombineImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n previousImpact,\n destination,\n insideDestination,\n afterCritical,\n }) ||\n getReorderImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n destination,\n insideDestination,\n last: previousImpact.displaced,\n viewport,\n afterCritical,\n })\n );\n};\n","// @flow\nimport type { DroppableDimension, DroppableDimensionMap } from '../types';\n\nexport default (\n droppables: DroppableDimensionMap,\n updated: DroppableDimension,\n): DroppableDimensionMap => ({\n ...droppables,\n [updated.descriptor.id]: updated,\n});\n","// @flow\nimport {\n addPlaceholder,\n removePlaceholder,\n} from './droppable/with-placeholder';\nimport whatIsDraggedOver from './droppable/what-is-dragged-over';\nimport type {\n DroppableDimension,\n DraggableDimensionMap,\n DroppableDimensionMap,\n DraggableDimension,\n DragImpact,\n DroppableId,\n} from '../types';\nimport patchDroppableMap from './patch-droppable-map';\nimport isHomeOf from './droppable/is-home-of';\n\n// Exact\ntype ClearArgs = {\n previousImpact: DragImpact,\n impact: DragImpact,\n droppables: DroppableDimensionMap,\n};\n\nconst clearUnusedPlaceholder = ({\n previousImpact,\n impact,\n droppables,\n}: ClearArgs): DroppableDimensionMap => {\n const last: DroppableId | null = whatIsDraggedOver(previousImpact);\n const now: DroppableId | null = whatIsDraggedOver(impact);\n\n if (!last) {\n return droppables;\n }\n\n // no change - can keep the last state\n if (last === now) {\n return droppables;\n }\n\n const lastDroppable: DroppableDimension = droppables[last];\n\n // nothing to clear\n if (!lastDroppable.subject.withPlaceholder) {\n return droppables;\n }\n\n const updated: DroppableDimension = removePlaceholder(lastDroppable);\n return patchDroppableMap(droppables, updated);\n};\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n droppables: DroppableDimensionMap,\n impact: DragImpact,\n previousImpact: DragImpact,\n};\n\nexport default ({\n draggable,\n draggables,\n droppables,\n previousImpact,\n impact,\n}: Args): DroppableDimensionMap => {\n const cleaned: DroppableDimensionMap = clearUnusedPlaceholder({\n previousImpact,\n impact,\n droppables,\n });\n\n const isOver: DroppableId | null = whatIsDraggedOver(impact);\n\n if (!isOver) {\n return cleaned;\n }\n\n const droppable: DroppableDimension = droppables[isOver];\n\n // no need to add additional space to home droppable\n if (isHomeOf(draggable, droppable)) {\n return cleaned;\n }\n\n // already have a placeholder - nothing to do here!\n if (droppable.subject.withPlaceholder) {\n return cleaned;\n }\n\n // Need to patch the existing droppable\n const patched: DroppableDimension = addPlaceholder(\n droppable,\n draggable,\n draggables,\n );\n\n return patchDroppableMap(cleaned, patched);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DraggableDimension,\n DraggingState,\n ClientPositions,\n PagePositions,\n DragPositions,\n DragImpact,\n Viewport,\n DimensionMap,\n StateWhenUpdatesAllowed,\n DroppableDimensionMap,\n} from '../../../types';\nimport getDragImpact from '../../get-drag-impact';\nimport { add, subtract } from '../../position';\nimport recomputePlaceholders from '../../recompute-placeholders';\n\n// Exact\ntype Args = {\n state: StateWhenUpdatesAllowed,\n clientSelection?: Position,\n dimensions?: DimensionMap,\n viewport?: Viewport,\n // force a custom drag impact\n impact?: DragImpact | null,\n // provide a scroll jump request (optionally provided - and can be null)\n scrollJumpRequest?: Position | null,\n};\n\nexport default ({\n state,\n clientSelection: forcedClientSelection,\n dimensions: forcedDimensions,\n viewport: forcedViewport,\n impact: forcedImpact,\n scrollJumpRequest,\n}: Args): StateWhenUpdatesAllowed => {\n // DRAGGING: can update position and impact\n // COLLECTING: can update position but cannot update impact\n\n const viewport: Viewport = forcedViewport || state.viewport;\n const dimensions: DimensionMap = forcedDimensions || state.dimensions;\n const clientSelection: Position =\n forcedClientSelection || state.current.client.selection;\n\n const offset: Position = subtract(\n clientSelection,\n state.initial.client.selection,\n );\n\n const client: ClientPositions = {\n offset,\n selection: clientSelection,\n borderBoxCenter: add(state.initial.client.borderBoxCenter, offset),\n };\n\n const page: PagePositions = {\n selection: add(client.selection, viewport.scroll.current),\n borderBoxCenter: add(client.borderBoxCenter, viewport.scroll.current),\n offset: add(client.offset, viewport.scroll.diff.value),\n };\n\n const current: DragPositions = {\n client,\n page,\n };\n\n // Not updating impact while bulk collecting\n if (state.phase === 'COLLECTING') {\n return {\n // adding phase to appease flow (even though it will be overwritten by spread)\n // phase: 'COLLECTING',\n ...state,\n dimensions,\n viewport,\n current,\n };\n }\n\n const draggable: DraggableDimension =\n dimensions.draggables[state.critical.draggable.id];\n\n const newImpact: DragImpact =\n forcedImpact ||\n getDragImpact({\n pageOffset: page.offset,\n draggable,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact: state.impact,\n viewport,\n afterCritical: state.afterCritical,\n });\n\n const withUpdatedPlaceholders: DroppableDimensionMap = recomputePlaceholders({\n draggable,\n impact: newImpact,\n previousImpact: state.impact,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n });\n // dragging!\n const result: DraggingState = {\n ...state,\n current,\n dimensions: {\n draggables: dimensions.draggables,\n droppables: withUpdatedPlaceholders,\n },\n impact: newImpact,\n viewport,\n scrollJumpRequest: scrollJumpRequest || null,\n // client updates can be applied as a part of a jump scroll\n // this can be to immediately reverse movement to allow for a nice animation\n // into the final position\n forceShouldAnimate: scrollJumpRequest ? false : null,\n };\n\n return result;\n};\n","// @flow\nimport type {\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DragImpact,\n Viewport,\n DraggableId,\n DisplacementGroups,\n} from '../../types';\nimport getDisplacementGroups from '../get-displacement-groups';\n\n// Exact\ntype RecomputeArgs = {\n impact: DragImpact,\n draggables: DraggableDimensionMap,\n destination: DroppableDimension,\n viewport: Viewport,\n forceShouldAnimate?: boolean,\n};\n\nfunction getDraggables(\n ids: DraggableId[],\n draggables: DraggableDimensionMap,\n): DraggableDimension[] {\n return ids.map((id: DraggableId): DraggableDimension => draggables[id]);\n}\n\nexport default ({\n impact,\n viewport,\n draggables,\n destination,\n forceShouldAnimate,\n}: RecomputeArgs): DragImpact => {\n const last: DisplacementGroups = impact.displaced;\n const afterDragging: DraggableDimension[] = getDraggables(\n last.all,\n draggables,\n );\n\n const displaced: DisplacementGroups = getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n forceShouldAnimate,\n last,\n });\n\n return {\n ...impact,\n displaced,\n };\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n Viewport,\n DragImpact,\n DraggableDimension,\n DraggableDimensionMap,\n LiftEffect,\n} from '../../../types';\nimport getPageBorderBoxCenterFromImpact from '../get-page-border-box-center';\nimport getClientFromPageBorderBoxCenter from './get-client-from-page-border-box-center';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n draggable: DraggableDimension,\n droppable: DroppableDimension,\n draggables: DraggableDimensionMap,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n impact,\n draggable,\n droppable,\n draggables,\n viewport,\n afterCritical,\n}: Args): Position => {\n const pageBorderBoxCenter: Position = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical,\n });\n\n return getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport,\n });\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport type {\n DroppableDimension,\n DraggableDimension,\n StateWhenUpdatesAllowed,\n DroppableId,\n DimensionMap,\n DragImpact,\n Viewport,\n} from '../../../types';\nimport whatIsDraggedOver from '../../droppable/what-is-dragged-over';\nimport recomputeDisplacementVisibility from '../../update-displacement-visibility/recompute';\nimport getClientBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center';\nimport update from './update';\n\n// Exact\ntype Args = {\n state: StateWhenUpdatesAllowed,\n dimensions?: DimensionMap,\n viewport?: Viewport,\n};\n\nexport default ({\n state,\n dimensions: forcedDimensions,\n viewport: forcedViewport,\n}: // when a draggable is changing enabled state, sometimes it needs to force refresh an impact\nArgs): StateWhenUpdatesAllowed => {\n invariant(state.movementMode === 'SNAP');\n\n const needsVisibilityCheck: DragImpact = state.impact;\n const viewport: Viewport = forcedViewport || state.viewport;\n const dimensions: DimensionMap = forcedDimensions || state.dimensions;\n const { draggables, droppables } = dimensions;\n\n const draggable: DraggableDimension = draggables[state.critical.draggable.id];\n const isOver: DroppableId | null = whatIsDraggedOver(needsVisibilityCheck);\n invariant(isOver, 'Must be over a destination in SNAP movement mode');\n const destination: DroppableDimension = droppables[isOver];\n\n const impact: DragImpact = recomputeDisplacementVisibility({\n impact: needsVisibilityCheck,\n viewport,\n destination,\n draggables,\n });\n\n const clientSelection: Position = getClientBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n viewport,\n afterCritical: state.afterCritical,\n });\n\n return update({\n // new\n impact,\n clientSelection,\n // pass through\n state,\n dimensions,\n viewport,\n });\n};\n","// @flow\nimport type { DraggableDescriptor, DraggableLocation } from '../types';\n\nexport default (descriptor: DraggableDescriptor): DraggableLocation => ({\n index: descriptor.index,\n droppableId: descriptor.droppableId,\n});\n","// @flow\nimport { invariant } from '../invariant';\nimport getHomeLocation from './get-home-location';\nimport type {\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DragImpact,\n DisplacedBy,\n Viewport,\n DraggableIdMap,\n DisplacementGroups,\n LiftEffect,\n} from '../types';\nimport getDraggablesInsideDroppable from './get-draggables-inside-droppable';\nimport getDisplacedBy from './get-displaced-by';\nimport getDisplacementGroups from './get-displacement-groups';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n home: DroppableDimension,\n draggables: DraggableDimensionMap,\n viewport: Viewport,\n};\n\n// Exact\ntype Result = {\n afterCritical: LiftEffect,\n impact: DragImpact,\n};\n\nexport default ({ draggable, home, draggables, viewport }: Args): Result => {\n const displacedBy: DisplacedBy = getDisplacedBy(\n home.axis,\n draggable.displaceBy,\n );\n\n const insideHome: DraggableDimension[] = getDraggablesInsideDroppable(\n home.descriptor.id,\n draggables,\n );\n\n // in a list that does not start at 0 the descriptor.index might be different from the index in the list\n // eg a list could be: [2,3,4]. A descriptor.index of '2' would actually be in index '0' of the list\n const rawIndex: number = insideHome.indexOf(draggable);\n invariant(rawIndex !== -1, 'Expected draggable to be inside home list');\n\n const afterDragging: DraggableDimension[] = insideHome.slice(rawIndex + 1);\n const effected: DraggableIdMap = afterDragging.reduce(\n (previous: DraggableIdMap, item: DraggableDimension): DraggableIdMap => {\n previous[item.descriptor.id] = true;\n return previous;\n },\n {},\n );\n const afterCritical: LiftEffect = {\n inVirtualList: home.descriptor.mode === 'virtual',\n displacedBy,\n effected,\n };\n\n const displaced: DisplacementGroups = getDisplacementGroups({\n afterDragging,\n destination: home,\n displacedBy,\n last: null,\n viewport: viewport.frame,\n // originally we do not want any animation as we want\n // everything to be fixed in the same position that\n // it started in\n forceShouldAnimate: false,\n });\n\n const impact: DragImpact = {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: getHomeLocation(draggable.descriptor),\n },\n };\n return { impact, afterCritical };\n};\n","// @flow\nimport type { DimensionMap, DroppableDimension } from '../types';\nimport patchDroppableMap from './patch-droppable-map';\n\nexport default (\n dimensions: DimensionMap,\n updated: DroppableDimension,\n): DimensionMap => ({\n draggables: dimensions.draggables,\n droppables: patchDroppableMap(dimensions.droppables, updated),\n});\n","// @flow\ntype Records = {\n [key: string]: number,\n};\n\nconst records: Records = {};\nlet isEnabled: boolean = false;\n\nconst isTimingsEnabled = (): boolean => isEnabled;\n\nexport const forceEnable = () => {\n isEnabled = true;\n};\n\n// Debug: uncomment to enable\n// forceEnable();\n\nexport const start = (key: string) => {\n // we want to strip all the code out for production builds\n // draw back: can only do timings in dev env (which seems to be fine for now)\n if (process.env.NODE_ENV !== 'production') {\n if (!isTimingsEnabled()) {\n return;\n }\n const now: number = performance.now();\n\n records[key] = now;\n }\n};\n\n// Exact\ntype Style = {\n textColor: string,\n symbol: string,\n};\n\nexport const finish = (key: string) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!isTimingsEnabled()) {\n return;\n }\n const now: number = performance.now();\n\n const previous: number | null = records[key];\n\n if (!previous) {\n // eslint-disable-next-line no-console\n console.warn('cannot finish timing as no previous time found', key);\n return;\n }\n\n const result: number = now - previous;\n const rounded: string = result.toFixed(2);\n\n const style: Style = (() => {\n if (result < 12) {\n return {\n textColor: 'green',\n symbol: '✅',\n };\n }\n if (result < 40) {\n return {\n textColor: 'orange',\n symbol: '⚠️',\n };\n }\n return {\n textColor: 'red',\n symbol: '❌',\n };\n })();\n\n // eslint-disable-next-line no-console\n console.log(\n `${style.symbol} %cTiming %c${rounded} %cms %c${key}`,\n // title\n 'color: blue; font-weight: bold;',\n // result\n `color: ${style.textColor}; font-size: 1.1em;`,\n // ms\n 'color: grey;',\n // key\n 'color: purple; font-weight: bold;',\n );\n }\n};\n","// @flow\nimport {\n withScroll,\n offset as offsetBox,\n type Position,\n type BoxModel,\n} from 'css-box-model';\nimport type { DraggableDimension } from '../../types';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n offset: Position,\n initialWindowScroll: Position,\n};\n\nexport default ({\n draggable,\n offset,\n initialWindowScroll,\n}: Args): DraggableDimension => {\n const client: BoxModel = offsetBox(draggable.client, offset);\n const page: BoxModel = withScroll(client, initialWindowScroll);\n\n const moved: DraggableDimension = {\n ...draggable,\n placeholder: {\n ...draggable.placeholder,\n client,\n },\n client,\n page,\n };\n\n return moved;\n};\n","// @flow\nimport { invariant } from '../invariant';\n\nimport type { DroppableDimension, Scrollable } from '../types';\n\nexport default (droppable: DroppableDimension): Scrollable => {\n const frame: Scrollable | null = droppable.frame;\n invariant(frame, 'Expected Droppable to have a frame');\n return frame;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type {\n Viewport,\n DraggableDimension,\n DroppableDimension,\n Scrollable,\n DroppableDimensionMap,\n DroppableId,\n} from '../../types';\nimport { add } from '../position';\nimport offsetDraggable from './offset-draggable';\nimport getFrame from '../get-frame';\n\n// Exact\ntype Args = {\n additions: DraggableDimension[],\n updatedDroppables: DroppableDimensionMap,\n viewport: Viewport,\n};\n\nexport default ({\n additions,\n updatedDroppables,\n viewport,\n}: Args): DraggableDimension[] => {\n // We need to adjust collected draggables so that they\n // match the model we had when the drag started.\n // When a draggable is dynamically collected it does not have\n // the same relative client position. We need to unwind\n // any changes in window scroll and droppable scroll so that\n // the newly collected draggables fit in with our other draggables\n // and give the same dimensions that would have had if they were\n // collected at the start of the drag.\n\n // Need to undo the displacement caused by window scroll changes\n const windowScrollChange: Position = viewport.scroll.diff.value;\n // These modified droppables have already had their scroll changes correctly updated\n\n return additions.map((draggable: DraggableDimension): DraggableDimension => {\n const droppableId: DroppableId = draggable.descriptor.droppableId;\n const modified: DroppableDimension = updatedDroppables[droppableId];\n const frame: Scrollable = getFrame(modified);\n const droppableScrollChange: Position = frame.scroll.diff.value;\n\n const totalChange: Position = add(\n windowScrollChange,\n droppableScrollChange,\n );\n\n const moved: DraggableDimension = offsetDraggable({\n draggable,\n offset: totalChange,\n initialWindowScroll: viewport.scroll.initial,\n });\n\n return moved;\n });\n};\n","// @flow\nimport type {\n DimensionMap,\n DraggingState,\n CollectingState,\n DropPendingState,\n Published,\n DraggableId,\n DraggableDimension,\n DroppableDimensionMap,\n DraggableDimensionMap,\n DroppableDimension,\n DragImpact,\n DroppablePublish,\n DroppableId,\n} from '../../types';\nimport * as timings from '../../debug/timings';\nimport getDragImpact from '../get-drag-impact';\nimport adjustAdditionsForScrollChanges from './adjust-additions-for-scroll-changes';\nimport { toDraggableMap, toDroppableMap } from '../dimension-structures';\nimport getLiftEffect from '../get-lift-effect';\nimport scrollDroppable from '../droppable/scroll-droppable';\nimport whatIsDraggedOver from '../droppable/what-is-dragged-over';\n\n// Exact\ntype Args = {\n state: CollectingState | DropPendingState,\n published: Published,\n};\n\nconst timingsKey: string = 'Processing dynamic changes';\n\nexport default ({\n state,\n published,\n}: Args): DraggingState | DropPendingState => {\n timings.start(timingsKey);\n\n // TODO: update window scroll (needs to be a part of the published object)\n // TODO: validate.\n // - Check that all additions / removals have a droppable\n // - Check that all droppables are virtual\n\n // The scroll might be different to what is currently in the state\n // We want to ensure the new draggables are in step with the state\n const withScrollChange: DroppableDimension[] = published.modified.map(\n (update: DroppablePublish): DroppableDimension => {\n const existing: DroppableDimension =\n state.dimensions.droppables[update.droppableId];\n\n const scrolled: DroppableDimension = scrollDroppable(\n existing,\n update.scroll,\n );\n return scrolled;\n },\n );\n\n const droppables: DroppableDimensionMap = {\n ...state.dimensions.droppables,\n ...toDroppableMap(withScrollChange),\n };\n\n const updatedAdditions: DraggableDimensionMap = toDraggableMap(\n adjustAdditionsForScrollChanges({\n additions: published.additions,\n updatedDroppables: droppables,\n viewport: state.viewport,\n }),\n );\n\n const draggables: DraggableDimensionMap = {\n ...state.dimensions.draggables,\n ...updatedAdditions,\n };\n\n // remove all the old ones (except for the critical)\n // we do this so that list operations remain fast\n // TODO: need to test the impact of this like crazy\n published.removals.forEach((id: DraggableId) => {\n delete draggables[id];\n });\n\n const dimensions: DimensionMap = {\n droppables,\n draggables,\n };\n\n const wasOverId: DroppableId | null = whatIsDraggedOver(state.impact);\n const wasOver: DroppableDimension | null = wasOverId\n ? dimensions.droppables[wasOverId]\n : null;\n\n const draggable: DraggableDimension =\n dimensions.draggables[state.critical.draggable.id];\n const home: DroppableDimension =\n dimensions.droppables[state.critical.droppable.id];\n\n const { impact: onLiftImpact, afterCritical } = getLiftEffect({\n draggable,\n home,\n draggables,\n viewport: state.viewport,\n });\n\n const previousImpact: DragImpact =\n wasOver && wasOver.isCombineEnabled\n ? // Cheating here\n // TODO: pursue a more robust approach\n state.impact\n : onLiftImpact;\n\n const impact: DragImpact = getDragImpact({\n pageOffset: state.current.page.offset,\n draggable: dimensions.draggables[state.critical.draggable.id],\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact,\n viewport: state.viewport,\n afterCritical,\n });\n\n timings.finish(timingsKey);\n\n const draggingState: DraggingState = {\n // appeasing flow\n // phase: 'DRAGGING',\n ...state,\n // eslint-disable-next-line\n phase: 'DRAGGING',\n impact,\n onLiftImpact,\n dimensions,\n afterCritical,\n // not animating this movement\n forceShouldAnimate: false,\n };\n\n if (state.phase === 'COLLECTING') {\n return draggingState;\n }\n\n // There was a DROP_PENDING\n // Staying in the DROP_PENDING phase\n // setting isWaiting for false\n\n const dropPending: DropPendingState = {\n // appeasing flow\n // phase: 'DROP_PENDING',\n ...draggingState,\n // eslint-disable-next-line\n phase: 'DROP_PENDING',\n // No longer waiting\n reason: state.reason,\n isWaiting: false,\n };\n\n return dropPending;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { invariant } from '../invariant';\nimport type {\n DimensionMap,\n State,\n StateWhenUpdatesAllowed,\n DraggableDimension,\n DroppableDimension,\n IdleState,\n DraggingState,\n DragPositions,\n ClientPositions,\n CollectingState,\n DropAnimatingState,\n DropPendingState,\n Viewport,\n DropReason,\n} from '../types';\nimport type { Action } from './store-types';\nimport type { PublicResult as MoveInDirectionResult } from './move-in-direction/move-in-direction-types';\nimport scrollDroppable from './droppable/scroll-droppable';\nimport moveInDirection from './move-in-direction';\nimport { add, isEqual, origin } from './position';\nimport scrollViewport from './scroll-viewport';\nimport isMovementAllowed from './is-movement-allowed';\nimport { toDroppableList } from './dimension-structures';\nimport update from './post-reducer/when-moving/update';\nimport refreshSnap from './post-reducer/when-moving/refresh-snap';\nimport getLiftEffect from './get-lift-effect';\nimport patchDimensionMap from './patch-dimension-map';\nimport publishWhileDraggingInVirtual from './publish-while-dragging-in-virtual';\n\nconst isSnapping = (state: StateWhenUpdatesAllowed): boolean =>\n state.movementMode === 'SNAP';\n\nconst postDroppableChange = (\n state: StateWhenUpdatesAllowed,\n updated: DroppableDimension,\n isEnabledChanging: boolean,\n): StateWhenUpdatesAllowed => {\n const dimensions: DimensionMap = patchDimensionMap(state.dimensions, updated);\n\n // if the enabled state is changing, we need to force a update\n if (!isSnapping(state) || isEnabledChanging) {\n return update({\n state,\n dimensions,\n });\n }\n\n return refreshSnap({\n state,\n dimensions,\n });\n};\n\nexport function isDragging(\n state: State,\n): state is DraggingState | CollectingState | DropPendingState {\n return (\n state.phase === 'DRAGGING' ||\n state.phase === 'COLLECTING' ||\n state.phase === 'DROP_PENDING'\n );\n}\n\nfunction removeScrollJumpRequest(state: State): State {\n if (isDragging(state) && state.movementMode === 'SNAP') {\n return {\n // will be overwritten by spread\n // needed for flow\n // phase: 'DRAGGING',\n ...state,\n scrollJumpRequest: null\n };\n }\n return state;\n}\n\nconst idle: IdleState = { phase: 'IDLE', completed: null, shouldFlush: false };\n\nexport default (state: State = idle, action: Action): State => {\n if (action.type === 'FLUSH') {\n return {\n ...idle,\n shouldFlush: true,\n };\n }\n\n if (action.type === 'INITIAL_PUBLISH') {\n invariant(\n state.phase === 'IDLE',\n 'INITIAL_PUBLISH must come after a IDLE phase',\n );\n const {\n critical,\n clientSelection,\n viewport,\n dimensions,\n movementMode,\n } = action.payload;\n\n const draggable: DraggableDimension =\n dimensions.draggables[critical.draggable.id];\n const home: DroppableDimension =\n dimensions.droppables[critical.droppable.id];\n\n const client: ClientPositions = {\n selection: clientSelection,\n borderBoxCenter: draggable.client.borderBox.center,\n offset: origin,\n };\n\n const initial: DragPositions = {\n client,\n page: {\n selection: add(client.selection, viewport.scroll.initial),\n borderBoxCenter: add(client.selection, viewport.scroll.initial),\n offset: add(client.selection, viewport.scroll.diff.value),\n },\n };\n\n // Can only auto scroll the window if every list is not fixed on the page\n const isWindowScrollAllowed: boolean = toDroppableList(\n dimensions.droppables,\n ).every((item: DroppableDimension) => !item.isFixedOnPage);\n\n const { impact, afterCritical } = getLiftEffect({\n draggable,\n home,\n draggables: dimensions.draggables,\n viewport,\n });\n\n const result: DraggingState = {\n phase: 'DRAGGING',\n isDragging: true,\n critical,\n movementMode,\n dimensions,\n initial,\n current: initial,\n isWindowScrollAllowed,\n impact,\n afterCritical,\n onLiftImpact: impact,\n viewport,\n scrollJumpRequest: null,\n forceShouldAnimate: null,\n };\n\n return result;\n }\n\n if (action.type === 'COLLECTION_STARTING') {\n // A collection might have restarted. We do not care as we are already in the right phase\n // TODO: remove?\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n state.phase === 'DRAGGING',\n `Collection cannot start from phase ${state.phase}`,\n );\n\n const result: CollectingState = {\n // putting phase first to appease flow\n // phase: 'COLLECTING',\n ...state,\n // eslint-disable-next-line\n phase: 'COLLECTING',\n };\n\n return result;\n }\n\n if (action.type === 'PUBLISH_WHILE_DRAGGING') {\n // Unexpected bulk publish\n invariant(\n state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING',\n `Unexpected ${action.type} received in phase ${state.phase}`,\n );\n\n return publishWhileDraggingInVirtual({\n state,\n published: action.payload,\n });\n }\n\n if (action.type === 'MOVE') {\n // Not allowing any more movements\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `${action.type} not permitted in phase ${state.phase}`,\n );\n\n const { client: clientSelection } = action.payload;\n\n // nothing needs to be done\n if (isEqual(clientSelection, state.current.client.selection)) {\n return state;\n }\n\n return update({\n state,\n clientSelection,\n // If we are snap moving - manual movements should not update the impact\n impact: isSnapping(state) ? state.impact : null,\n });\n }\n\n if (action.type === 'UPDATE_DROPPABLE_SCROLL') {\n // Not allowing changes while a drop is pending\n // Cannot get this during a DROP_ANIMATING as the dimension\n // marshal will cancel any pending scroll updates\n if (state.phase === 'DROP_PENDING') {\n return removeScrollJumpRequest(state);\n }\n\n // We will be updating the scroll in response to dynamic changes\n // manually on the droppable so we can ignore this change\n if (state.phase === 'COLLECTING') {\n return removeScrollJumpRequest(state);\n }\n\n invariant(\n isMovementAllowed(state),\n `${action.type} not permitted in phase ${state.phase}`,\n );\n\n const { id, newScroll } = action.payload;\n const target: DroppableDimension | null = state.dimensions.droppables[id];\n\n // This is possible if a droppable has been asked to watch scroll but\n // the dimension has not been published yet\n if (!target) {\n return state;\n }\n\n const scrolled: DroppableDimension = scrollDroppable(target, newScroll);\n return postDroppableChange(state, scrolled, false);\n }\n\n if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') {\n // Things are locked at this point\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `Attempting to move in an unsupported phase ${state.phase}`,\n );\n\n const { id, isEnabled } = action.payload;\n const target: DroppableDimension | null = state.dimensions.droppables[id];\n\n invariant(\n target,\n `Cannot find Droppable[id: ${id}] to toggle its enabled state`,\n );\n\n invariant(\n target.isEnabled !== isEnabled,\n `Trying to set droppable isEnabled to ${String(isEnabled)}\n but it is already ${String(target.isEnabled)}`,\n );\n\n const updated: DroppableDimension = {\n ...target,\n isEnabled,\n };\n\n return postDroppableChange(state, updated, true);\n }\n\n if (action.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') {\n // Things are locked at this point\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `Attempting to move in an unsupported phase ${state.phase}`,\n );\n\n const { id, isCombineEnabled } = action.payload;\n const target: DroppableDimension | null = state.dimensions.droppables[id];\n\n invariant(\n target,\n `Cannot find Droppable[id: ${id}] to toggle its isCombineEnabled state`,\n );\n\n invariant(\n target.isCombineEnabled !== isCombineEnabled,\n `Trying to set droppable isCombineEnabled to ${String(isCombineEnabled)}\n but it is already ${String(target.isCombineEnabled)}`,\n );\n\n const updated: DroppableDimension = {\n ...target,\n isCombineEnabled,\n };\n\n return postDroppableChange(state, updated, true);\n }\n\n if (action.type === 'MOVE_BY_WINDOW_SCROLL') {\n // No longer accepting changes\n if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `Cannot move by window in phase ${state.phase}`,\n );\n\n invariant(\n state.isWindowScrollAllowed,\n 'Window scrolling is currently not supported for fixed lists',\n );\n\n const newScroll: Position = action.payload.newScroll;\n\n // nothing needs to be done\n if (isEqual(state.viewport.scroll.current, newScroll)) {\n return removeScrollJumpRequest(state);\n }\n\n const viewport: Viewport = scrollViewport(state.viewport, newScroll);\n\n if (isSnapping(state)) {\n return refreshSnap({\n state,\n viewport,\n });\n }\n\n return update({\n state,\n viewport,\n });\n }\n\n if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {\n // Could occur if a transitionEnd occurs after a drag ends\n if (!isMovementAllowed(state)) {\n return state;\n }\n\n const maxScroll: Position = action.payload.maxScroll;\n\n if (isEqual(maxScroll, state.viewport.scroll.max)) {\n return state;\n }\n\n const withMaxScroll: Viewport = {\n ...state.viewport,\n scroll: {\n ...state.viewport.scroll,\n max: maxScroll,\n },\n };\n\n // don't need to recalc any updates\n return {\n // phase will be overridden - appeasing flow\n // phase: 'DRAGGING',\n ...state,\n viewport: withMaxScroll,\n };\n }\n if (\n action.type === 'MOVE_UP' ||\n action.type === 'MOVE_DOWN' ||\n action.type === 'MOVE_LEFT' ||\n action.type === 'MOVE_RIGHT'\n ) {\n // Not doing keyboard movements during these phases\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n state.phase === 'DRAGGING',\n `${action.type} received while not in DRAGGING phase`,\n );\n\n const result: MoveInDirectionResult | null = moveInDirection({\n state,\n type: action.type,\n });\n\n // cannot move in that direction\n if (!result) {\n return state;\n }\n\n return update({\n state,\n impact: result.impact,\n clientSelection: result.clientSelection,\n scrollJumpRequest: result.scrollJumpRequest,\n });\n }\n\n if (action.type === 'DROP_PENDING') {\n const reason: DropReason = action.payload.reason;\n invariant(\n state.phase === 'COLLECTING',\n 'Can only move into the DROP_PENDING phase from the COLLECTING phase',\n );\n\n const newState: DropPendingState = {\n // appeasing flow\n // phase: 'DROP_PENDING',\n ...state,\n // eslint-disable-next-line\n phase: 'DROP_PENDING',\n isWaiting: true,\n reason,\n };\n return newState;\n }\n\n if (action.type === 'DROP_ANIMATE') {\n const { completed, dropDuration, newHomeClientOffset } = action.payload;\n invariant(\n state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING',\n `Cannot animate drop from phase ${state.phase}`,\n );\n\n // Moving into a new phase\n const result: DropAnimatingState = {\n phase: 'DROP_ANIMATING',\n completed,\n dropDuration,\n newHomeClientOffset,\n dimensions: state.dimensions,\n };\n\n return result;\n }\n\n // Action will be used by responders to call consumers\n // We can simply return to the idle state\n if (action.type === 'DROP_COMPLETE') {\n const { completed } = action.payload;\n\n return {\n phase: 'IDLE',\n completed,\n shouldFlush: false,\n };\n }\n\n return state;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n Critical,\n DraggableId,\n DroppableId,\n CompletedDrag,\n MovementMode,\n Viewport,\n DimensionMap,\n DropReason,\n Published,\n} from '../types';\n\n// Exact\nexport type BeforeInitialCaptureArgs = {\n draggableId: DraggableId,\n movementMode: MovementMode,\n};\n\n// Exact\nexport type BeforeInitialCaptureAction = {\n type: 'BEFORE_INITIAL_CAPTURE',\n payload: BeforeInitialCaptureArgs,\n};\n\nexport const beforeInitialCapture = (\n args: BeforeInitialCaptureArgs,\n): BeforeInitialCaptureAction => ({\n type: 'BEFORE_INITIAL_CAPTURE',\n payload: args,\n});\n\n// Exact\nexport type LiftArgs = {\n // lifting with DraggableId rather than descriptor\n // as the descriptor might change after a drop is flushed\n id: DraggableId,\n clientSelection: Position,\n movementMode: MovementMode,\n};\n\n// Exact\nexport type LiftAction = {\n type: 'LIFT',\n payload: LiftArgs,\n};\n\nexport const lift = (args: LiftArgs): LiftAction => ({\n type: 'LIFT',\n payload: args,\n});\n\n// Exact\nexport type InitialPublishArgs = {\n critical: Critical,\n dimensions: DimensionMap,\n clientSelection: Position,\n viewport: Viewport,\n movementMode: MovementMode,\n};\n\n// Exact\nexport type InitialPublishAction = {\n type: 'INITIAL_PUBLISH',\n payload: InitialPublishArgs,\n};\n\nexport const initialPublish = (\n args: InitialPublishArgs,\n): InitialPublishAction => ({\n type: 'INITIAL_PUBLISH',\n payload: args,\n});\n\n// Exact\nexport type WhileDraggingPublishAction = {\n type: 'PUBLISH_WHILE_DRAGGING',\n payload: Published,\n};\n\nexport const publishWhileDragging = (\n args: Published,\n): WhileDraggingPublishAction => ({\n type: 'PUBLISH_WHILE_DRAGGING',\n payload: args,\n});\n\n// Exact\nexport type CollectionStartingAction = {\n type: 'COLLECTION_STARTING',\n payload: null,\n};\n\nexport const collectionStarting = (): CollectionStartingAction => ({\n type: 'COLLECTION_STARTING',\n payload: null,\n});\n\nexport type UpdateDroppableScrollArgs = {\n id: DroppableId,\n newScroll: Position,\n};\n\n// Exact\nexport type UpdateDroppableScrollAction = {\n type: 'UPDATE_DROPPABLE_SCROLL',\n payload: UpdateDroppableScrollArgs,\n};\n\nexport const updateDroppableScroll = (\n args: UpdateDroppableScrollArgs,\n): UpdateDroppableScrollAction => ({\n type: 'UPDATE_DROPPABLE_SCROLL',\n payload: args,\n});\n\n// Exact\nexport type UpdateDroppableIsEnabledArgs = {\n id: DroppableId,\n isEnabled: boolean,\n};\n\n// Exact\nexport type UpdateDroppableIsEnabledAction = {\n type: 'UPDATE_DROPPABLE_IS_ENABLED',\n payload: UpdateDroppableIsEnabledArgs,\n};\n\nexport const updateDroppableIsEnabled = (\n args: UpdateDroppableIsEnabledArgs,\n): UpdateDroppableIsEnabledAction => ({\n type: 'UPDATE_DROPPABLE_IS_ENABLED',\n payload: args,\n});\n\n// Exact\nexport type UpdateDroppableIsCombineEnabledArgs = {\n id: DroppableId,\n isCombineEnabled: boolean,\n};\n\n// Exact\nexport type UpdateDroppableIsCombineEnabledAction = {\n type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',\n payload: UpdateDroppableIsCombineEnabledArgs,\n};\n\nexport const updateDroppableIsCombineEnabled = (\n args: UpdateDroppableIsCombineEnabledArgs,\n): UpdateDroppableIsCombineEnabledAction => ({\n type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',\n payload: args,\n});\n\n// Exact\nexport type MoveArgs = {\n client: Position,\n};\n\n// Exact\nexport type MoveAction = {\n type: 'MOVE',\n payload: MoveArgs,\n};\n\nexport const move = (args: MoveArgs): MoveAction => ({\n type: 'MOVE',\n payload: args,\n});\n\n// Exact\ntype MoveByWindowScrollArgs = {\n newScroll: Position,\n};\n\n// Exact\nexport type MoveByWindowScrollAction = {\n type: 'MOVE_BY_WINDOW_SCROLL',\n payload: MoveByWindowScrollArgs,\n};\n\nexport const moveByWindowScroll = (\n args: MoveByWindowScrollArgs,\n): MoveByWindowScrollAction => ({\n type: 'MOVE_BY_WINDOW_SCROLL',\n payload: args,\n});\n\n// Exact\nexport type UpdateViewportMaxScrollArgs = {\n maxScroll: Position,\n};\n\n// Exact\ntype UpdateViewportMaxScrollAction = {\n type: 'UPDATE_VIEWPORT_MAX_SCROLL',\n payload: UpdateViewportMaxScrollArgs,\n};\n\nexport const updateViewportMaxScroll = (\n args: UpdateViewportMaxScrollArgs,\n): UpdateViewportMaxScrollAction => ({\n type: 'UPDATE_VIEWPORT_MAX_SCROLL',\n payload: args,\n});\n\n// Exact\nexport type MoveUpAction = {\n type: 'MOVE_UP',\n payload: null,\n};\n\nexport const moveUp = (): MoveUpAction => ({\n type: 'MOVE_UP',\n payload: null,\n});\n\n// Exact\nexport type MoveDownAction = {\n type: 'MOVE_DOWN',\n payload: null,\n};\n\nexport const moveDown = (): MoveDownAction => ({\n type: 'MOVE_DOWN',\n payload: null,\n});\n\n// Exact\nexport type MoveRightAction = {\n type: 'MOVE_RIGHT',\n payload: null,\n};\n\nexport const moveRight = (): MoveRightAction => ({\n type: 'MOVE_RIGHT',\n payload: null,\n});\n\n// Exact\nexport type MoveLeftAction = {\n type: 'MOVE_LEFT',\n payload: null,\n};\n\nexport const moveLeft = (): MoveLeftAction => ({\n type: 'MOVE_LEFT',\n payload: null,\n});\n\n// Exact\ntype FlushAction = {\n type: 'FLUSH',\n payload: null,\n};\n\nexport const flush = (): FlushAction => ({\n type: 'FLUSH',\n payload: null,\n});\n\n// Exact\nexport type AnimateDropArgs = {\n completed: CompletedDrag,\n newHomeClientOffset: Position,\n dropDuration: number,\n};\n\nexport type DropAnimateAction = {\n type: 'DROP_ANIMATE',\n payload: AnimateDropArgs,\n};\n\nexport const animateDrop = (args: AnimateDropArgs): DropAnimateAction => ({\n type: 'DROP_ANIMATE',\n payload: args,\n});\n\n// Exact\nexport type DropCompleteArgs = {\n completed: CompletedDrag,\n};\n\nexport type DropCompleteAction = {\n type: 'DROP_COMPLETE',\n payload: DropCompleteArgs,\n};\n\nexport const completeDrop = (args: DropCompleteArgs): DropCompleteAction => ({\n type: 'DROP_COMPLETE',\n payload: args,\n});\n\n// Exact\ntype DropArgs = {\n reason: DropReason,\n};\n\n// Exact\nexport type DropAction = {\n type: 'DROP',\n payload: DropArgs,\n};\n\nexport const drop = (args: DropArgs): DropAction => ({\n type: 'DROP',\n payload: args,\n});\n\nexport const cancel = () => drop({ reason: 'CANCEL' });\n\n// Exact\nexport type DropPendingAction = {\n type: 'DROP_PENDING',\n payload: DropArgs,\n};\n\nexport const dropPending = (args: DropArgs): DropPendingAction => ({\n type: 'DROP_PENDING',\n payload: args,\n});\n\n// Exact\nexport type DropAnimationFinishedAction = {\n type: 'DROP_ANIMATION_FINISHED',\n payload: null,\n};\n\nexport const dropAnimationFinished = (): DropAnimationFinishedAction => ({\n type: 'DROP_ANIMATION_FINISHED',\n payload: null,\n});\n\nexport type Action =\n | BeforeInitialCaptureAction\n | LiftAction\n | InitialPublishAction\n | WhileDraggingPublishAction\n | CollectionStartingAction\n | UpdateDroppableScrollAction\n | UpdateDroppableIsEnabledAction\n | UpdateDroppableIsCombineEnabledAction\n | MoveByWindowScrollAction\n | UpdateViewportMaxScrollAction\n // | PostJumpScrollAction\n // | PostSnapDestinationChangeAction\n | MoveAction\n | MoveUpAction\n | MoveDownAction\n | MoveRightAction\n | MoveLeftAction\n | DropPendingAction\n | DropAction\n | DropAnimateAction\n | DropAnimationFinishedAction\n | DropCompleteAction\n | FlushAction;\n","// @flow\nimport type {\n Critical,\n DimensionMap,\n DraggableDimension,\n} from '../../../types';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport { warning } from '../../../dev-warning';\n\ntype ErrorMap = {\n [index: number]: true,\n};\n\nfunction checkIndexes(insideDestination: DraggableDimension[]) {\n // no point running if there are 1 or less items\n if (insideDestination.length <= 1) {\n return;\n }\n\n const indexes: number[] = insideDestination.map(\n (d: DraggableDimension): number => d.descriptor.index,\n );\n\n const errors: ErrorMap = {};\n\n for (let i = 1; i < indexes.length; i++) {\n const current: number = indexes[i];\n const previous: number = indexes[i - 1];\n\n // this will be an error if:\n // 1. index is not consecutive\n // 2. index is duplicated (which is true if #1 is not passed)\n if (current !== previous + 1) {\n errors[current] = true;\n }\n }\n\n if (!Object.keys(errors).length) {\n return;\n }\n\n const formatted: string = indexes\n .map((index: number): string => {\n const hasError: boolean = Boolean(errors[index]);\n\n return hasError ? `[🔥${index}]` : `${index}`;\n })\n .join(', ');\n\n warning(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${formatted}\n `);\n}\n\nexport default function validateDimensions(\n critical: Critical,\n dimensions: DimensionMap,\n): void {\n // wrapping entire block for better minification\n if (process.env.NODE_ENV !== 'production') {\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n critical.droppable.id,\n dimensions.draggables,\n );\n checkIndexes(insideDestination);\n }\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { DimensionMarshal } from '../dimension-marshal/dimension-marshal-types';\nimport type { State, ScrollOptions, LiftRequest } from '../../types';\nimport type { MiddlewareStore, Action, Dispatch } from '../store-types';\nimport {\n completeDrop,\n initialPublish,\n flush,\n beforeInitialCapture,\n} from '../action-creators';\nimport validateDimensions from './util/validate-dimensions';\n\nexport default (marshal: DimensionMarshal) => ({\n getState,\n dispatch,\n}: MiddlewareStore) => (next: Dispatch) => (action: Action): any => {\n if (action.type !== 'LIFT') {\n next(action);\n return;\n }\n const { id, clientSelection, movementMode } = action.payload;\n const initial: State = getState();\n\n // flush dropping animation if needed\n // this can change the descriptor of the dragging item\n // Will call the onDragEnd responders\n\n if (initial.phase === 'DROP_ANIMATING') {\n dispatch(completeDrop({ completed: initial.completed }));\n }\n\n invariant(getState().phase === 'IDLE', 'Unexpected phase to start a drag');\n\n // Removing any placeholders before we capture any starting dimensions\n dispatch(flush());\n\n // Let consumers know we are just about to publish\n // We are only publishing a small amount of information as\n // things might change as a result of the onBeforeCapture callback\n dispatch(beforeInitialCapture({ draggableId: id, movementMode }));\n\n // will communicate with the marshal to start requesting dimensions\n const scrollOptions: ScrollOptions = {\n shouldPublishImmediately: movementMode === 'SNAP',\n };\n const request: LiftRequest = {\n draggableId: id,\n scrollOptions,\n };\n // Let's get the marshal started!\n const { critical, dimensions, viewport } = marshal.startPublishing(request);\n\n validateDimensions(critical, dimensions);\n\n // Okay, we are good to start dragging now\n dispatch(\n initialPublish({\n critical,\n dimensions,\n clientSelection,\n movementMode,\n viewport,\n }),\n );\n};\n","// @flow\nimport type { Action, Dispatch } from '../store-types';\nimport type { StyleMarshal } from '../../view/use-style-marshal/style-marshal-types';\n\nexport default (marshal: StyleMarshal) => () => (next: Dispatch) => (\n action: Action,\n): any => {\n if (action.type === 'INITIAL_PUBLISH') {\n marshal.dragging();\n }\n\n if (action.type === 'DROP_ANIMATE') {\n marshal.dropping(action.payload.completed.result.reason);\n }\n\n // this will clear any styles immediately before a reorder\n if (action.type === 'FLUSH' || action.type === 'DROP_COMPLETE') {\n marshal.resting();\n }\n\n next(action);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { isEqual, origin } from './state/position';\n\nexport const curves = {\n outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)',\n drop: 'cubic-bezier(.2,1,.1,1)',\n};\n\nexport const combine = {\n opacity: {\n // while dropping: fade out totally\n drop: 0,\n // while dragging: fade out partially\n combining: 0.7,\n },\n scale: {\n drop: 0.75,\n },\n};\n\nexport const timings = {\n outOfTheWay: 0.2,\n // greater than the out of the way time\n // so that when the drop ends everything will\n // have to be out of the way\n minDropTime: 0.33,\n maxDropTime: 0.55,\n};\n\n// slow timings\n// uncomment to use\n// export const timings = {\n// outOfTheWay: 2,\n// // greater than the out of the way time\n// // so that when the drop ends everything will\n// // have to be out of the way\n// minDropTime: 3,\n// maxDropTime: 4,\n// };\n\nconst outOfTheWayTiming: string = `${timings.outOfTheWay}s ${curves.outOfTheWay}`;\nexport const placeholderTransitionDelayTime: number = 0.1;\n\nexport const transitions = {\n fluid: `opacity ${outOfTheWayTiming}`,\n snap: `transform ${outOfTheWayTiming}, opacity ${outOfTheWayTiming}`,\n drop: (duration: number): string => {\n const timing: string = `${duration}s ${curves.drop}`;\n return `transform ${timing}, opacity ${timing}`;\n },\n outOfTheWay: `transform ${outOfTheWayTiming}`,\n placeholder: `height ${outOfTheWayTiming}, width ${outOfTheWayTiming}, margin ${outOfTheWayTiming}`,\n};\n\nconst moveTo = (offset: Position): string | null =>\n isEqual(offset, origin) ? null : `translate(${offset.x}px, ${offset.y}px)`;\n\nexport const transforms = {\n moveTo,\n drop: (offset: Position, isCombining: boolean) => {\n const translate: string | null = moveTo(offset);\n if (!translate) {\n return null;\n }\n\n // only transforming the translate\n if (!isCombining) {\n return translate;\n }\n\n // when dropping while combining we also update the scale\n return `${translate} scale(${combine.scale.drop})`;\n },\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { distance as getDistance } from '../../position';\nimport { timings } from '../../../animation';\nimport type { DropReason } from '../../../types';\n\n// Exact\ntype GetDropDurationArgs = {\n current: Position,\n destination: Position,\n reason: DropReason,\n};\n\nconst { minDropTime, maxDropTime } = timings;\nconst dropTimeRange: number = maxDropTime - minDropTime;\nconst maxDropTimeAtDistance: number = 1500;\n// will bring a time lower - which makes it faster\nconst cancelDropModifier: number = 0.6;\n\nexport default ({\n current,\n destination,\n reason,\n}: GetDropDurationArgs): number => {\n const distance: number = getDistance(current, destination);\n // even if there is no distance to travel, we might still need to animate opacity\n if (distance <= 0) {\n return minDropTime;\n }\n\n if (distance >= maxDropTimeAtDistance) {\n return maxDropTime;\n }\n\n // * range from:\n // 0px = 0.33s\n // 1500px and over = 0.55s\n // * If reason === 'CANCEL' then speeding up the animation\n // * round to 2 decimal points\n\n const percentage: number = distance / maxDropTimeAtDistance;\n const duration: number = minDropTime + dropTimeRange * percentage;\n\n const withDuration: number =\n reason === 'CANCEL' ? duration * cancelDropModifier : duration;\n // To two decimal points by converting to string and back\n return Number(withDuration.toFixed(2));\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n Viewport,\n DragImpact,\n DimensionMap,\n DraggableDimension,\n DroppableId,\n LiftEffect,\n} from '../../../types';\nimport whatIsDraggedOver from '../../droppable/what-is-dragged-over';\nimport { subtract } from '../../position';\nimport getClientBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n draggable: DraggableDimension,\n dimensions: DimensionMap,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n impact,\n draggable,\n dimensions,\n viewport,\n afterCritical,\n}: Args): Position => {\n const { draggables, droppables } = dimensions;\n const droppableId: DroppableId | null = whatIsDraggedOver(impact);\n const destination: DroppableDimension | null = droppableId\n ? droppables[droppableId]\n : null;\n const home: DroppableDimension = droppables[draggable.descriptor.droppableId];\n\n const newClientCenter: Position = getClientBorderBoxCenter({\n impact,\n draggable,\n draggables,\n // if there is no destination, then we will be dropping back into the home\n afterCritical,\n droppable: destination || home,\n viewport,\n });\n\n const offset: Position = subtract(\n newClientCenter,\n draggable.client.borderBox.center,\n );\n\n return offset;\n};\n","// @flow\nimport type {\n DropReason,\n DragImpact,\n Viewport,\n DroppableDimension,\n DraggableDimensionMap,\n LiftEffect,\n} from '../../../types';\nimport recompute from '../../update-displacement-visibility/recompute';\nimport { emptyGroups } from '../../no-impact';\n\n// Exact\ntype Args = {\n draggables: DraggableDimensionMap,\n home: DroppableDimension,\n reason: DropReason,\n lastImpact: DragImpact,\n onLiftImpact: DragImpact,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\n// Exact\nexport type Result = {\n impact: DragImpact,\n didDropInsideDroppable: boolean,\n};\n\nexport default ({\n draggables,\n reason,\n lastImpact,\n home,\n viewport,\n onLiftImpact,\n}: Args): Result => {\n if (!lastImpact.at || reason !== 'DROP') {\n // Dropping outside of a list or the drag was cancelled\n\n // Going to use the on lift impact\n // Need to recompute the visibility of the original impact\n // What is visible can be different to when the drag started\n\n const recomputedHomeImpact: DragImpact = recompute({\n draggables,\n impact: onLiftImpact,\n destination: home,\n viewport,\n // We need the draggables to animate back to their positions\n forceShouldAnimate: true,\n });\n\n return {\n impact: recomputedHomeImpact,\n didDropInsideDroppable: false,\n };\n }\n\n // use the existing impact\n if (lastImpact.at.type === 'REORDER') {\n return {\n impact: lastImpact,\n didDropInsideDroppable: true,\n };\n }\n\n // When merging we remove the movement so that everything\n // will animate closed\n const withoutMovement: DragImpact = {\n ...lastImpact,\n displaced: emptyGroups,\n };\n\n return {\n impact: withoutMovement,\n didDropInsideDroppable: true,\n };\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport type {\n State,\n DropReason,\n Critical,\n DraggableLocation,\n DropResult,\n CompletedDrag,\n Combine,\n DimensionMap,\n DraggableDimension,\n} from '../../../types';\nimport type { MiddlewareStore, Dispatch, Action } from '../../store-types';\nimport {\n animateDrop,\n completeDrop,\n dropPending,\n type AnimateDropArgs,\n} from '../../action-creators';\nimport { isEqual } from '../../position';\nimport getDropDuration from './get-drop-duration';\nimport getNewHomeClientOffset from './get-new-home-client-offset';\nimport getDropImpact, { type Result } from './get-drop-impact';\nimport { tryGetCombine, tryGetDestination } from '../../get-impact-location';\n\nexport default ({ getState, dispatch }: MiddlewareStore) => (\n next: Dispatch,\n) => (action: Action): unknown => {\n if (action.type !== 'DROP') {\n next(action);\n return;\n }\n\n const state: State = getState();\n const reason: DropReason = action.payload.reason;\n\n // Still waiting for a bulk collection to publish\n // We are now shifting the application into the 'DROP_PENDING' phase\n if (state.phase === 'COLLECTING') {\n dispatch(dropPending({ reason }));\n return;\n }\n\n // Could have occurred in response to an error\n if (state.phase === 'IDLE') {\n return;\n }\n\n // Still waiting for our drop pending to end\n // TODO: should this throw?\n const isWaitingForDrop: boolean =\n state.phase === 'DROP_PENDING' && state.isWaiting;\n invariant(\n !isWaitingForDrop,\n 'A DROP action occurred while DROP_PENDING and still waiting',\n );\n\n invariant(\n state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING',\n `Cannot drop in phase: ${state.phase}`,\n );\n // We are now in the DRAGGING or DROP_PENDING phase\n\n const critical: Critical = state.critical;\n const dimensions: DimensionMap = state.dimensions;\n const draggable: DraggableDimension =\n dimensions.draggables[state.critical.draggable.id];\n // Only keeping impact when doing a user drop - otherwise we are cancelling\n\n const { impact, didDropInsideDroppable }: Result = getDropImpact({\n reason,\n lastImpact: state.impact,\n afterCritical: state.afterCritical,\n onLiftImpact: state.onLiftImpact,\n home: state.dimensions.droppables[state.critical.droppable.id],\n viewport: state.viewport,\n draggables: state.dimensions.draggables,\n });\n\n // only populating destination / combine if 'didDropInsideDroppable' is true\n const destination: DraggableLocation | null = didDropInsideDroppable\n ? tryGetDestination(impact)\n : null;\n const combine: Combine | null = didDropInsideDroppable\n ? tryGetCombine(impact)\n : null;\n\n const source: DraggableLocation = {\n index: critical.draggable.index,\n droppableId: critical.droppable.id,\n };\n\n const result: DropResult = {\n draggableId: draggable.descriptor.id,\n type: draggable.descriptor.type,\n source,\n reason,\n mode: state.movementMode,\n // destination / combine will be null if didDropInsideDroppable is true\n destination,\n combine,\n };\n\n const newHomeClientOffset: Position = getNewHomeClientOffset({\n impact,\n draggable,\n dimensions,\n viewport: state.viewport,\n afterCritical: state.afterCritical,\n });\n\n const completed: CompletedDrag = {\n critical: state.critical,\n afterCritical: state.afterCritical,\n result,\n impact,\n };\n\n const isAnimationRequired: boolean =\n // 1. not already in the right spot\n !isEqual(state.current.client.offset, newHomeClientOffset) ||\n // 2. doing a combine (we still want to animate the scale and opacity fade)\n // looking at the result and not the impact as the combine impact is cleared\n Boolean(result.combine);\n\n if (!isAnimationRequired) {\n dispatch(completeDrop({ completed }));\n return;\n }\n\n const dropDuration: number = getDropDuration({\n current: state.current.client.offset,\n destination: newHomeClientOffset,\n reason,\n });\n\n const args: AnimateDropArgs = {\n newHomeClientOffset,\n dropDuration,\n completed,\n };\n\n dispatch(animateDrop(args));\n};\n","var rafSchd = function rafSchd(fn) {\n var lastArgs = [];\n var frameId = null;\n\n var wrapperFn = function wrapperFn() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n lastArgs = args;\n\n if (frameId) {\n return;\n }\n\n frameId = requestAnimationFrame(function () {\n frameId = null;\n fn.apply(void 0, lastArgs);\n });\n };\n\n wrapperFn.cancel = function () {\n if (!frameId) {\n return;\n }\n\n cancelAnimationFrame(frameId);\n frameId = null;\n };\n\n return wrapperFn;\n};\n\nexport default rafSchd;\n","// @flow\nimport { type Position } from 'css-box-model';\n\n// The browsers update document.documentElement.scrollTop and window.pageYOffset\n// differently as the window scrolls.\n\n// Webkit\n// documentElement.scrollTop: no update. Stays at 0\n// window.pageYOffset: updates to whole number\n\n// Chrome\n// documentElement.scrollTop: update with fractional value\n// window.pageYOffset: update with fractional value\n\n// FireFox\n// documentElement.scrollTop: updates to whole number\n// window.pageYOffset: updates to whole number\n\n// IE11 (same as firefox)\n// documentElement.scrollTop: updates to whole number\n// window.pageYOffset: updates to whole number\n\n// Edge (same as webkit)\n// documentElement.scrollTop: no update. Stays at 0\n// window.pageYOffset: updates to whole number\n\nexport default (): Position => ({\n x: window.pageXOffset,\n y: window.pageYOffset,\n});\n","// @flow\nimport type { Position } from 'css-box-model';\nimport rafSchd from 'raf-schd';\nimport { invariant } from '../invariant';\nimport bindEvents from './event-bindings/bind-events';\nimport type { EventBinding } from './event-bindings/event-types';\nimport getWindowScroll from './window/get-window-scroll';\nimport { noop } from '../empty';\n\ntype OnWindowScroll = (newScroll: Position) => void;\n\n// Exact\ntype Args = {\n onWindowScroll: OnWindowScroll,\n};\n\n// Exact\ntype Result = {\n start: () => void,\n stop: () => void,\n isActive: () => boolean,\n};\n\nfunction getWindowScrollBinding(update: () => void): EventBinding {\n return {\n eventName: 'scroll',\n // ## Passive: true\n // Eventual consistency is fine because we use position: fixed on the item\n // ## Capture: false\n // Scroll events on elements do not bubble, but they go through the capture phase\n // https://twitter.com/alexandereardon/status/985994224867819520\n // Using capture: false here as we want to avoid intercepting droppable scroll requests\n options: { passive: true, capture: false },\n fn: (event: UIEvent) => {\n // IE11 fix\n // All scrollable events still bubble up and are caught by this handler in ie11.\n // On a window scroll the event.target should be the window or the document.\n // If this is not the case then it is not a 'window' scroll event and can be ignored\n if (event.target !== window && event.target !== window.document) {\n return;\n }\n\n update();\n },\n };\n}\n\nexport default function getScrollListener({ onWindowScroll }: Args): Result {\n function updateScroll() {\n // letting the update function read the latest scroll when called\n onWindowScroll(getWindowScroll());\n }\n\n const scheduled = rafSchd(updateScroll);\n const binding: EventBinding = getWindowScrollBinding(scheduled);\n let unbind: () => void = noop;\n\n function isActive(): boolean {\n return unbind !== noop;\n }\n\n function start() {\n invariant(!isActive(), 'Cannot start scroll listener when already active');\n unbind = bindEvents(window, [binding], {});\n }\n function stop() {\n invariant(isActive(), 'Cannot stop scroll listener when not active');\n scheduled.cancel();\n unbind();\n unbind = noop;\n }\n\n return { start, stop, isActive };\n}\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { moveByWindowScroll } from '../action-creators';\nimport type { MiddlewareStore, Action, Dispatch } from '../store-types';\nimport getScrollListener from '../../view/scroll-listener';\n\n// TODO: this is taken from auto-scroll. Let's make it a util\nconst shouldEnd = (action: Action): boolean =>\n action.type === 'DROP_COMPLETE' ||\n action.type === 'DROP_ANIMATE' ||\n action.type === 'FLUSH';\n\nexport default (store: MiddlewareStore) => {\n const listener = getScrollListener({\n onWindowScroll: (newScroll: Position) => {\n store.dispatch(moveByWindowScroll({ newScroll }));\n },\n });\n\n return (next: Dispatch) => (action: Action): any => {\n if (!listener.isActive() && action.type === 'INITIAL_PUBLISH') {\n listener.start();\n }\n\n if (listener.isActive() && shouldEnd(action)) {\n listener.stop();\n }\n\n next(action);\n };\n};\n","// @flow\nimport type { Announce, TimeoutID } from '../../../types';\nimport { warning } from '../../../dev-warning';\n\nexport type ExpiringAnnounce = Announce & {\n wasCalled: () => boolean,\n};\n\nexport default (announce: Announce): ExpiringAnnounce => {\n let wasCalled: boolean = false;\n let isExpired: boolean = false;\n\n // not allowing async announcements\n const timeoutId: TimeoutID = setTimeout(() => {\n isExpired = true;\n });\n\n const result = (message: string): void => {\n if (wasCalled) {\n warning('Announcement already made. Not making a second announcement');\n\n return;\n }\n\n if (isExpired) {\n warning(`\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n `);\n return;\n }\n\n wasCalled = true;\n announce(message);\n clearTimeout(timeoutId);\n };\n\n // getter for isExpired\n // using this technique so that a consumer cannot\n // set the isExpired or wasCalled flags\n result.wasCalled = (): boolean => wasCalled;\n\n return result;\n};\n","// @flow\nimport { invariant } from '../../../invariant';\nimport { findIndex } from '../../../native-with-fallback';\nimport { TimeoutID } from '../../../types';\n\n// Exact\ntype Entry = {\n timerId: TimeoutID,\n callback: Function,\n};\n\n// Exact\nexport type AsyncMarshal = {\n add: (fn: Function) => void,\n flush: () => void,\n};\n\nexport default () => {\n const entries: Entry[] = [];\n\n const execute = (timerId: TimeoutID) => {\n const index: number = findIndex(\n entries,\n (item: Entry): boolean => item.timerId === timerId,\n );\n invariant(index !== -1, 'Could not find timer');\n // delete in place\n const [entry] = entries.splice(index, 1);\n entry.callback();\n };\n\n const add = (fn: Function) => {\n const timerId: TimeoutID = setTimeout(() => execute(timerId));\n const entry: Entry = {\n timerId,\n callback: fn,\n };\n entries.push(entry);\n };\n\n const flush = () => {\n // nothing to flush\n if (!entries.length) {\n return;\n }\n\n const shallow: Entry[] = [...entries];\n // clearing entries in case a callback adds some more callbacks\n entries.length = 0;\n\n shallow.forEach((entry: Entry) => {\n clearTimeout(entry.timerId);\n entry.callback();\n });\n };\n\n return { add, flush };\n};\n","// @flow\nimport type { Critical, DraggableLocation, Combine } from '../../../types';\n\nexport const areLocationsEqual = (\n first: DraggableLocation | null,\n second: DraggableLocation | null,\n): boolean => {\n // if both are null - we are equal\n if (first == null && second == null) {\n return true;\n }\n\n // if one is null - then they are not equal\n if (first == null || second == null) {\n return false;\n }\n\n // compare their actual values\n return (\n first.droppableId === second.droppableId && first.index === second.index\n );\n};\n\nexport const isCombineEqual = (first: Combine | null, second: Combine | null): boolean => {\n // if both are null - we are equal\n if (first == null && second == null) {\n return true;\n }\n\n // only one is null\n if (first == null || second == null) {\n return false;\n }\n\n return (\n first.draggableId === second.draggableId &&\n first.droppableId === second.droppableId\n );\n};\n\nexport const isCriticalEqual = (first: Critical, second: Critical): boolean => {\n if (first === second) {\n return true;\n }\n\n const isDraggableEqual: boolean =\n first.draggable.id === second.draggable.id &&\n first.draggable.droppableId === second.draggable.droppableId &&\n first.draggable.type === second.draggable.type &&\n first.draggable.index === second.draggable.index;\n\n const isDroppableEqual: boolean =\n first.droppable.id === second.droppable.id &&\n first.droppable.type === second.droppable.type;\n\n return isDraggableEqual && isDroppableEqual;\n};\n","// @flow\nimport { invariant } from '../../../invariant';\nimport messagePreset from '../../../screen-reader-message-preset';\nimport * as timings from '../../../debug/timings';\nimport getExpiringAnnounce, {\n type ExpiringAnnounce,\n} from './expiring-announce';\nimport getAsyncMarshal, { type AsyncMarshal } from './async-marshal';\nimport type {\n DropResult,\n Responders,\n ResponderProvided,\n Critical,\n BeforeCapture,\n DragImpact,\n DraggableLocation,\n Combine,\n DragStart,\n Announce,\n DragUpdate,\n MovementMode,\n DraggableId,\n OnBeforeCaptureResponder,\n OnBeforeDragStartResponder,\n OnDragStartResponder,\n OnDragUpdateResponder,\n OnDragEndResponder,\n} from '../../../types';\nimport { isCombineEqual, isCriticalEqual, areLocationsEqual } from './is-equal';\nimport { tryGetDestination, tryGetCombine } from '../../get-impact-location';\n\nconst withTimings = (key: string, fn: Function) => {\n timings.start(key);\n fn();\n timings.finish(key);\n};\n\nconst getDragStart = (critical: Critical, mode: MovementMode): DragStart => ({\n draggableId: critical.draggable.id,\n type: critical.droppable.type,\n source: {\n droppableId: critical.droppable.id,\n index: critical.draggable.index,\n },\n mode,\n});\n\ntype AnyPrimaryResponderFn =\n | OnDragStartResponder\n | OnDragUpdateResponder\n | OnDragEndResponder;\n\ntype AnyResponderData = DragStart | DragUpdate | DropResult;\n\nconst execute = (\n responder: AnyPrimaryResponderFn | null,\n data: AnyResponderData,\n announce: Announce,\n getDefaultMessage: (data: any) => string,\n) => {\n if (!responder) {\n announce(getDefaultMessage(data));\n return;\n }\n\n const willExpire: ExpiringAnnounce = getExpiringAnnounce(announce);\n const provided: ResponderProvided = {\n announce: willExpire,\n };\n\n // Casting because we are not validating which data type is going into which responder\n responder(data as any, provided); // Casted to any\n\n if (!willExpire.wasCalled()) {\n announce(getDefaultMessage(data));\n }\n};\n\n// Exact\nexport type WhileDragging = {\n mode: MovementMode\n lastCritical: Critical,\n lastCombine: Combine | null,\n lastLocation: DraggableLocation | null,\n};\n\nexport default (getResponders: () => Responders, announce: Announce) => {\n const asyncMarshal: AsyncMarshal = getAsyncMarshal();\n let dragging: WhileDragging | null = null;\n\n const beforeCapture = (draggableId: DraggableId, mode: MovementMode) => {\n invariant(\n !dragging,\n 'Cannot fire onBeforeCapture as a drag start has already been published',\n );\n withTimings('onBeforeCapture', () => {\n // No use of screen reader for this responder\n const fn: OnBeforeCaptureResponder | null | undefined = getResponders().onBeforeCapture;\n if (fn) {\n const before: BeforeCapture = {\n draggableId,\n mode,\n };\n fn(before);\n }\n });\n };\n\n const beforeStart = (critical: Critical, mode: MovementMode) => {\n invariant(\n !dragging,\n 'Cannot fire onBeforeDragStart as a drag start has already been published',\n );\n withTimings('onBeforeDragStart', () => {\n // No use of screen reader for this responder\n const fn: OnBeforeDragStartResponder | null | undefined = getResponders().onBeforeDragStart;\n if (fn) {\n fn(getDragStart(critical, mode));\n }\n });\n };\n\n const start = (critical: Critical, mode: MovementMode) => {\n invariant(\n !dragging,\n 'Cannot fire onBeforeDragStart as a drag start has already been published',\n );\n const data: DragStart = getDragStart(critical, mode);\n dragging = {\n mode,\n lastCritical: critical,\n lastLocation: data.source,\n lastCombine: null,\n };\n\n // we will flush this frame if we receive any responder updates\n asyncMarshal.add(() => {\n withTimings('onDragStart', () =>\n execute(\n getResponders().onDragStart ?? null,\n data,\n announce,\n messagePreset.onDragStart,\n ),\n );\n });\n };\n\n // Passing in the critical location again as it can change during a drag\n const update = (critical: Critical, impact: DragImpact) => {\n const location: DraggableLocation | null = tryGetDestination(impact);\n const combine: Combine | null = tryGetCombine(impact);\n\n invariant(\n dragging,\n 'Cannot fire onDragMove when onDragStart has not been called',\n );\n\n // Has the critical changed? Will result in a source change\n const hasCriticalChanged: boolean = !isCriticalEqual(\n critical,\n dragging.lastCritical,\n );\n if (hasCriticalChanged) {\n dragging.lastCritical = critical;\n }\n\n // Has the location changed? Will result in a destination change\n const hasLocationChanged: boolean = !areLocationsEqual(\n dragging.lastLocation,\n location,\n );\n if (hasLocationChanged) {\n dragging.lastLocation = location;\n }\n const hasGroupingChanged: boolean = !isCombineEqual(\n dragging.lastCombine,\n combine,\n );\n if (hasGroupingChanged) {\n dragging.lastCombine = combine;\n }\n\n // Nothing has changed - no update needed\n if (!hasCriticalChanged && !hasLocationChanged && !hasGroupingChanged) {\n return;\n }\n\n const data: DragUpdate = {\n ...getDragStart(critical, dragging.mode),\n combine,\n destination: location,\n };\n\n asyncMarshal.add(() => {\n withTimings('onDragUpdate', () =>\n execute(\n getResponders().onDragUpdate ?? null,\n data,\n announce,\n messagePreset.onDragUpdate,\n ),\n );\n });\n };\n\n const flush = () => {\n invariant(dragging, 'Can only flush responders while dragging');\n asyncMarshal.flush();\n };\n\n const drop = (result: DropResult) => {\n invariant(\n dragging,\n 'Cannot fire onDragEnd when there is no matching onDragStart',\n );\n dragging = null;\n // not adding to frame marshal - we want this to be done in the same render pass\n // we also want the consumers reorder logic to be in the same render pass\n withTimings('onDragEnd', () =>\n execute(\n getResponders().onDragEnd,\n result,\n announce,\n messagePreset.onDragEnd,\n ),\n );\n };\n\n // A non user initiated cancel\n const abort = () => {\n // aborting can happen defensively\n if (!dragging) {\n return;\n }\n\n const result: DropResult = {\n ...getDragStart(dragging.lastCritical, dragging.mode),\n combine: null,\n destination: null,\n reason: 'CANCEL',\n };\n drop(result);\n };\n\n return {\n beforeCapture,\n beforeStart,\n start,\n update,\n flush,\n drop,\n abort,\n };\n};\n","// @flow\nimport getPublisher from './publisher';\n\nimport type {\n State,\n DropResult,\n Responders,\n Critical,\n Announce,\n} from '../../../types';\n\nimport type {\n Action,\n // Middleware,\n MiddlewareStore,\n Dispatch,\n} from '../../store-types';\n\nexport default (\n getResponders: () => Responders,\n announce: Announce,\n) => { // Middleware\n const publisher = getPublisher(\n getResponders,\n announce,\n );\n\n return (store: MiddlewareStore) => (next: Dispatch) => (\n action: Action,\n ): any => {\n\n if (action.type === 'BEFORE_INITIAL_CAPTURE') {\n publisher.beforeCapture(\n action.payload.draggableId,\n action.payload.movementMode,\n );\n return;\n }\n\n if (action.type === 'INITIAL_PUBLISH') {\n const critical: Critical = action.payload.critical;\n publisher.beforeStart(critical, action.payload.movementMode);\n next(action);\n publisher.start(critical, action.payload.movementMode);\n return;\n }\n\n // Drag end\n if (action.type === 'DROP_COMPLETE') {\n // it is important that we use the result and not the last impact\n // the last impact might be different to the result for visual reasons\n const result: DropResult = action.payload.completed.result;\n // flushing all pending responders before snapshots are updated\n publisher.flush();\n next(action);\n publisher.drop(result);\n return;\n }\n\n // All other responders can fire after we have updated our connected components\n next(action);\n\n // Drag state resetting - need to check if\n // we should fire a onDragEnd responder\n if (action.type === 'FLUSH') {\n publisher.abort();\n return;\n }\n\n // ## Perform drag updates\n // impact of action has already been reduced\n\n const state: State = store.getState();\n\n if (state.phase === 'DRAGGING') {\n publisher.update(state.critical, state.impact);\n return;\n }\n\n };\n};\n","// @flow\nimport { invariant } from '../../../invariant';\nimport { completeDrop } from '../../action-creators';\nimport type { State } from '../../../types';\nimport type { MiddlewareStore, Action, Dispatch } from '../../store-types';\n\nexport default (store: MiddlewareStore) => (next: Dispatch) => (\n action: Action,\n): any => {\n if (action.type !== 'DROP_ANIMATION_FINISHED') {\n next(action);\n return;\n }\n\n const state: State = store.getState();\n invariant(\n state.phase === 'DROP_ANIMATING',\n 'Cannot finish a drop animating when no drop is occurring',\n );\n store.dispatch(completeDrop({ completed: state.completed }));\n};\n","// @flow\nimport { dropAnimationFinished } from '../../action-creators';\nimport type { AnimationFrameID, State } from '../../../types';\nimport type { MiddlewareStore, Action, Dispatch } from '../../store-types';\nimport type { EventBinding } from '../../../view/event-bindings/event-types';\nimport bindEvents from '../../../view/event-bindings/bind-events';\n\nexport default (store: MiddlewareStore) => {\n let unbind: (() => void) | null;\n let frameId: AnimationFrameID | null= null;\n\n function clear() {\n if (frameId) {\n cancelAnimationFrame(frameId);\n frameId = null;\n }\n\n if (unbind) {\n unbind();\n unbind = null;\n }\n }\n\n return (next: Dispatch) => (action: Action): any => {\n if (\n action.type === 'FLUSH' ||\n action.type === 'DROP_COMPLETE' ||\n action.type === 'DROP_ANIMATION_FINISHED'\n ) {\n clear();\n }\n\n next(action);\n\n if (action.type !== 'DROP_ANIMATE') {\n return;\n }\n\n const binding: EventBinding = {\n eventName: 'scroll',\n // capture: true will catch all scroll events, event from scroll containers\n // once: just in case, we only want to ever fire one\n options: { capture: true, passive: false, once: true },\n fn: function flushDropAnimation() {\n const state: State = store.getState();\n if (state.phase === 'DROP_ANIMATING') {\n store.dispatch(dropAnimationFinished());\n }\n },\n };\n\n // The browser can batch a few scroll events in a single frame\n // including the one that ended the drag.\n // Binding after a requestAnimationFrame ensures that any scrolls caused\n // by the auto scroller are finished\n // TODO: why is a second window scroll being fired?\n // It leads to funny drop positions :(\n frameId = requestAnimationFrame(() => {\n frameId = null;\n unbind = bindEvents(window, [binding], {});\n });\n };\n};\n","// @flow\nimport type { Action, Dispatch } from '../store-types';\nimport type { DimensionMarshal } from '../dimension-marshal/dimension-marshal-types';\n\nexport default (marshal: DimensionMarshal) => () => (next: Dispatch) => (\n action: Action,\n): any => {\n // Not stopping a collection on a 'DROP' as we want a collection to continue\n if (\n // drag is finished\n action.type === 'DROP_COMPLETE' ||\n action.type === 'FLUSH' ||\n // no longer accepting changes once the drop has started\n action.type === 'DROP_ANIMATE'\n ) {\n marshal.stopPublishing();\n }\n\n next(action);\n};\n","// @flow\nimport type { DropResult } from '../../types';\nimport type { Action, Dispatch } from '../store-types';\nimport type { FocusMarshal } from '../../view/use-focus-marshal/focus-marshal-types';\n\nexport default (marshal: FocusMarshal) => {\n let isWatching: boolean = false;\n\n return () => (next: Dispatch) => (action: Action): any => {\n if (action.type === 'INITIAL_PUBLISH') {\n isWatching = true;\n\n marshal.tryRecordFocus(action.payload.critical.draggable.id);\n next(action);\n marshal.tryRestoreFocusRecorded();\n return;\n }\n\n next(action);\n\n if (!isWatching) {\n return;\n }\n\n if (action.type === 'FLUSH') {\n isWatching = false;\n marshal.tryRestoreFocusRecorded();\n return;\n }\n\n if (action.type === 'DROP_COMPLETE') {\n isWatching = false;\n const result: DropResult = action.payload.completed.result;\n\n // give focus to the combine target when combining\n if (result.combine) {\n marshal.tryShiftRecord(result.draggableId, result.combine.draggableId);\n }\n marshal.tryRestoreFocusRecorded();\n }\n };\n};\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { AutoScroller } from '../auto-scroller/auto-scroller-types';\nimport type { Action, Dispatch, MiddlewareStore } from '../store-types';\nimport type { State } from '../../types';\n\nconst shouldStop = (action: Action): boolean =>\n action.type === 'DROP_COMPLETE' ||\n action.type === 'DROP_ANIMATE' ||\n action.type === 'FLUSH';\n\nexport default (autoScroller: AutoScroller) => (store: MiddlewareStore) => (\n next: Dispatch,\n) => (action: Action): any => {\n if (shouldStop(action)) {\n autoScroller.stop();\n next(action);\n return;\n }\n\n if (action.type === 'INITIAL_PUBLISH') {\n // letting the action go first to hydrate the state\n next(action);\n const state: State = store.getState();\n invariant(\n state.phase === 'DRAGGING',\n 'Expected phase to be DRAGGING after INITIAL_PUBLISH',\n );\n autoScroller.start(state);\n return;\n }\n\n // auto scroll happens in response to state changes\n // releasing all actions to the reducer first\n next(action);\n\n autoScroller.scroll(store.getState());\n};\n","// @flow\nimport { drop } from '../action-creators';\nimport type { State } from '../../types';\nimport type { MiddlewareStore, Dispatch, Action } from '../store-types';\n\nexport default (store: MiddlewareStore) => (next: Dispatch) => (\n action: Action,\n): any => {\n // Always let the action go through first\n next(action);\n\n if (action.type !== 'PUBLISH_WHILE_DRAGGING') {\n return;\n }\n\n // A bulk replace occurred - check if\n // 1. there is a pending drop\n // 2. that the pending drop is no longer waiting\n\n const postActionState: State = store.getState();\n\n // no pending drop after the publish\n if (postActionState.phase !== 'DROP_PENDING') {\n return;\n }\n\n // the pending drop is still waiting for completion\n if (postActionState.isWaiting) {\n return;\n }\n\n store.dispatch(\n drop({\n reason: postActionState.reason,\n }),\n );\n};\n","// @flow\n/* eslint-disable no-underscore-dangle */\nimport { applyMiddleware, createStore, compose } from 'redux';\nimport reducer from './reducer';\nimport lift from './middleware/lift';\nimport style from './middleware/style';\nimport drop from './middleware/drop/drop-middleware';\nimport scrollListener from './middleware/scroll-listener';\nimport responders from './middleware/responders/responders-middleware';\nimport dropAnimationFinish from './middleware/drop/drop-animation-finish-middleware';\nimport dropAnimationFlushOnScroll from './middleware/drop/drop-animation-flush-on-scroll-middleware';\nimport dimensionMarshalStopper from './middleware/dimension-marshal-stopper';\nimport focus from './middleware/focus';\nimport autoScroll from './middleware/auto-scroll';\nimport pendingDrop from './middleware/pending-drop';\nimport type { DimensionMarshal } from './dimension-marshal/dimension-marshal-types';\nimport type { FocusMarshal } from '../view/use-focus-marshal/focus-marshal-types';\nimport type { StyleMarshal } from '../view/use-style-marshal/style-marshal-types';\nimport type { AutoScroller } from './auto-scroller/auto-scroller-types';\nimport type { Responders, Announce } from '../types';\nimport type { Store } from './store-types';\n\n// We are checking if window is available before using it.\n// This is needed for universal apps that render the component server side.\n// Details: https://github.com/zalmoxisus/redux-devtools-extension#12-advanced-store-setup\nconst composeEnhancers =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n name: 'draggable',\n })\n : compose;\n\n// Exact\ntype Args = {\n dimensionMarshal: DimensionMarshal,\n focusMarshal: FocusMarshal,\n styleMarshal: StyleMarshal,\n getResponders: () => Responders,\n announce: Announce,\n autoScroller: AutoScroller,\n};\n\nexport default ({\n dimensionMarshal,\n focusMarshal,\n styleMarshal,\n getResponders,\n announce,\n autoScroller,\n}: Args): Store =>\n createStore(\n reducer,\n composeEnhancers(\n applyMiddleware(\n // ## Debug middleware\n\n // > uncomment to use\n // debugging logger\n // require('../debug/middleware/log').default('light'),\n // // user timing api\n // require('../debug/middleware/user-timing').default,\n // debugging timer\n // require('../debug/middleware/action-timing').default,\n // average action timer\n // require('../debug/middleware/action-timing-average').default(200),\n\n // ## Application middleware\n\n // Style updates do not cause more actions. It is important to update styles\n // before responders are called: specifically the onDragEnd responder. We need to clear\n // the transition styles off the elements before a reorder to prevent strange\n // post drag animations in firefox. Even though we clear the transition off\n // a Draggable - if it is done after a reorder firefox will still apply the\n // transition.\n // Must be called before dimension marshal for lifting to apply collecting styles\n style(styleMarshal),\n // Stop the dimension marshal collecting anything\n // when moving into a phase where collection is no longer needed.\n // We need to stop the marshal before responders fire as responders can cause\n // dimension registration changes in response to reordering\n dimensionMarshalStopper(dimensionMarshal),\n // Fire application responders in response to drag changes\n lift(dimensionMarshal),\n drop,\n // When a drop animation finishes - fire a drop complete\n dropAnimationFinish,\n dropAnimationFlushOnScroll,\n pendingDrop,\n autoScroll(autoScroller),\n scrollListener,\n focus(focusMarshal),\n // Fire responders for consumers (after update to store)\n responders(getResponders, announce),\n ),\n ),\n );\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DraggableId,\n DroppableId,\n DraggableDescriptor,\n Published,\n DraggableDimension,\n DroppablePublish,\n DroppableIdMap,\n DraggableIdMap,\n} from '../../types';\nimport type {\n DroppableEntry,\n Registry,\n DraggableEntry,\n DraggableEntryMap,\n} from '../registry/registry-types';\nimport * as timings from '../../debug/timings';\nimport { origin } from '../position';\n\nexport type WhileDraggingPublisher = {\n add: (entry: DraggableEntry) => void,\n remove: (entry: DraggableEntry) => void,\n stop: () => void,\n};\n\ntype Staging = {\n additions: DraggableEntryMap,\n removals: DraggableIdMap,\n modified: DroppableIdMap,\n};\n\ntype Callbacks = {\n publish: (args: Published) => unknown,\n collectionStarting: () => unknown,\n};\n\ntype Args = {\n registry: Registry,\n callbacks: Callbacks,\n};\n\nconst clean = (): Staging => ({\n additions: {},\n removals: {},\n modified: {},\n});\n\nconst timingKey: string = 'Publish collection from DOM';\n\nexport default function createPublisher({\n registry,\n callbacks,\n}: Args): WhileDraggingPublisher {\n let staging: Staging = clean();\n let frameId: any = null; // AnimationFrameID\n\n const collect = () => {\n if (frameId) {\n return;\n }\n\n callbacks.collectionStarting();\n frameId = requestAnimationFrame(() => {\n frameId = null;\n timings.start(timingKey);\n\n const { additions, removals, modified } = staging;\n\n const added: DraggableDimension[] = Object.keys(additions)\n .map(\n // Using the origin as the window scroll. This will be adjusted when processing the published values\n (id: DraggableId): DraggableDimension =>\n registry.draggable.getById(id).getDimension(origin),\n )\n // Dimensions are not guarenteed to be ordered in the same order as keys\n // So we need to sort them so they are in the correct order\n .sort(\n (a: DraggableDimension, b: DraggableDimension): number =>\n a.descriptor.index - b.descriptor.index,\n );\n\n const updated: DroppablePublish[] = Object.keys(modified).map(\n (id: DroppableId) => {\n const entry: DroppableEntry = registry.droppable.getById(id);\n\n const scroll: Position = entry.callbacks.getScrollWhileDragging();\n return {\n droppableId: id,\n scroll,\n };\n },\n );\n\n const result: Published = {\n additions: added,\n removals: Object.keys(removals),\n modified: updated,\n };\n\n staging = clean();\n\n timings.finish(timingKey);\n callbacks.publish(result);\n });\n };\n\n const add = (entry: DraggableEntry) => {\n const id: DraggableId = entry.descriptor.id;\n staging.additions[id] = entry;\n staging.modified[entry.descriptor.droppableId] = true;\n\n if (staging.removals[id]) {\n delete staging.removals[id];\n }\n collect();\n };\n\n const remove = (entry: DraggableEntry) => {\n const descriptor: DraggableDescriptor = entry.descriptor;\n staging.removals[descriptor.id] = true;\n staging.modified[descriptor.droppableId] = true;\n\n if (staging.additions[descriptor.id]) {\n delete staging.additions[descriptor.id];\n }\n collect();\n };\n\n const stop = () => {\n if (!frameId) {\n return;\n }\n\n cancelAnimationFrame(frameId);\n frameId = null;\n staging = clean();\n };\n\n return {\n add,\n remove,\n stop,\n };\n}\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { subtract } from './position';\n\n// Exact\ntype Args = {\n scrollHeight: number,\n scrollWidth: number,\n height: number,\n width: number,\n};\n\nexport default ({\n scrollHeight,\n scrollWidth,\n height,\n width,\n}: Args): Position => {\n const maxScroll: Position = subtract(\n // full size\n { x: scrollWidth, y: scrollHeight },\n // viewport size\n { x: width, y: height },\n );\n\n const adjustedMaxScroll: Position = {\n x: Math.max(0, maxScroll.x),\n y: Math.max(0, maxScroll.y),\n };\n\n return adjustedMaxScroll;\n};\n","// @flow\nimport { invariant } from '../invariant';\n\nexport default (): HTMLElement => {\n const doc: HTMLElement | null = document.documentElement;\n invariant(doc, 'Cannot find document.documentElement');\n return doc;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport getMaxScroll from '../../state/get-max-scroll';\nimport getDocumentElement from '../get-document-element';\n\nexport default (): Position => {\n const doc: HTMLElement = getDocumentElement();\n\n const maxScroll: Position = getMaxScroll({\n // unclipped padding box, with scrollbar\n scrollHeight: doc.scrollHeight,\n scrollWidth: doc.scrollWidth,\n // clipped padding box, without scrollbar\n width: doc.clientWidth,\n height: doc.clientHeight,\n });\n\n return maxScroll;\n};\n","// @flow\nimport { getRect, type Rect, type Position } from 'css-box-model';\nimport type { Viewport } from '../../types';\nimport { origin } from '../../state/position';\nimport getWindowScroll from './get-window-scroll';\nimport getMaxWindowScroll from './get-max-window-scroll';\nimport getDocumentElement from '../get-document-element';\n\nexport default (): Viewport => {\n const scroll: Position = getWindowScroll();\n const maxScroll: Position = getMaxWindowScroll();\n\n const top: number = scroll.y;\n const left: number = scroll.x;\n\n // window.innerHeight: includes scrollbars (not what we want)\n // document.clientHeight gives us the correct value when using the html5 doctype\n const doc: HTMLElement = getDocumentElement();\n // Using these values as they do not consider scrollbars\n // padding box, without scrollbar\n const width: number = doc.clientWidth;\n const height: number = doc.clientHeight;\n\n // Computed\n const right: number = left + width;\n const bottom: number = top + height;\n\n const frame: Rect = getRect({\n top,\n left,\n right,\n bottom,\n });\n\n const viewport: Viewport = {\n frame,\n scroll: {\n initial: scroll,\n current: scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin,\n },\n },\n };\n\n return viewport;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport * as timings from '../../debug/timings';\nimport type { StartPublishingResult } from './dimension-marshal-types';\nimport type {\n Registry,\n DraggableEntry,\n DroppableEntry,\n} from '../registry/registry-types';\nimport { toDraggableMap, toDroppableMap } from '../dimension-structures';\nimport type {\n DroppableDescriptor,\n DroppableDimension,\n DraggableDimension,\n DimensionMap,\n ScrollOptions,\n Critical,\n Viewport,\n} from '../../types';\nimport getViewport from '../../view/window/get-viewport';\n\ntype Args = {\n critical: Critical,\n scrollOptions: ScrollOptions,\n registry: Registry,\n};\n\nexport default ({\n critical,\n scrollOptions,\n registry,\n}: Args): StartPublishingResult => {\n const timingKey: string = 'Initial collection from DOM';\n timings.start(timingKey);\n const viewport: Viewport = getViewport();\n const windowScroll: Position = viewport.scroll.current;\n\n const home: DroppableDescriptor = critical.droppable;\n\n const droppables: DroppableDimension[] = registry.droppable\n .getAllByType(home.type)\n .map((entry: DroppableEntry): DroppableDimension =>\n entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions),\n );\n\n const draggables: DraggableDimension[] = registry.draggable\n .getAllByType(critical.draggable.type)\n .map((entry: DraggableEntry): DraggableDimension =>\n entry.getDimension(windowScroll),\n );\n\n const dimensions: DimensionMap = {\n draggables: toDraggableMap(draggables),\n droppables: toDroppableMap(droppables),\n };\n\n timings.finish(timingKey);\n\n const result: StartPublishingResult = {\n dimensions,\n critical,\n viewport,\n };\n\n return result;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport type {\n DimensionMarshal,\n Callbacks,\n StartPublishingResult,\n} from './dimension-marshal-types';\nimport createPublisher, {\n type WhileDraggingPublisher,\n} from './while-dragging-publisher';\nimport getInitialPublish from './get-initial-publish';\nimport type {\n Registry,\n DroppableEntry,\n DraggableEntry,\n Subscriber,\n Unsubscribe,\n RegistryEvent,\n} from '../registry/registry-types';\nimport type {\n DroppableId,\n DroppableDescriptor,\n LiftRequest,\n Critical,\n DraggableDescriptor,\n} from '../../types';\nimport { warning } from '../../dev-warning';\n\n// Exact\ntype Collection = {\n critical: Critical,\n unsubscribe: Unsubscribe,\n};\n\nfunction shouldPublishUpdate(\n registry: Registry,\n dragging: DraggableDescriptor,\n entry: DraggableEntry,\n): boolean {\n // do not publish updates for the critical draggable\n if (entry.descriptor.id === dragging.id) {\n return false;\n }\n // do not publish updates for draggables that are not of a type that we care about\n if (entry.descriptor.type !== dragging.type) {\n return false;\n }\n\n const home: DroppableEntry = registry.droppable.getById(\n entry.descriptor.droppableId,\n );\n\n if (home.descriptor.mode !== 'virtual') {\n warning(`\n You are attempting to add or remove a Draggable [id: ${entry.descriptor.id}]\n while a drag is occurring. This is only supported for virtual lists.\n\n See https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/patterns/virtual-lists.md\n `);\n return false;\n }\n\n return true;\n}\n\nexport default (registry: Registry, callbacks: Callbacks) => {\n let collection: Collection | null | undefined = null;\n\n const publisher: WhileDraggingPublisher = createPublisher({\n callbacks: {\n publish: callbacks.publishWhileDragging,\n collectionStarting: callbacks.collectionStarting,\n },\n registry,\n });\n\n const updateDroppableIsEnabled = (id: DroppableId, isEnabled: boolean) => {\n invariant(\n registry.droppable.exists(id),\n `Cannot update is enabled flag of Droppable ${id} as it is not registered`,\n );\n\n // no need to update the application state if a collection is not occurring\n if (!collection) {\n return;\n }\n\n // At this point a non primary droppable dimension might not yet be published\n // but may have its enabled state changed. For now we still publish this change\n // and let the reducer exit early if it cannot find the dimension in the state.\n callbacks.updateDroppableIsEnabled({ id, isEnabled });\n };\n\n const updateDroppableIsCombineEnabled = (\n id: DroppableId,\n isCombineEnabled: boolean,\n ) => {\n // no need to update\n if (!collection) {\n return;\n }\n\n invariant(\n registry.droppable.exists(id),\n `Cannot update isCombineEnabled flag of Droppable ${id} as it is not registered`,\n );\n\n callbacks.updateDroppableIsCombineEnabled({ id, isCombineEnabled });\n };\n\n const updateDroppableScroll = (id: DroppableId, newScroll: Position) => {\n // no need to update the application state if a collection is not occurring\n if (!collection) {\n return;\n }\n\n invariant(\n registry.droppable.exists(id),\n `Cannot update the scroll on Droppable ${id} as it is not registered`,\n );\n\n callbacks.updateDroppableScroll({ id, newScroll });\n };\n\n const scrollDroppable = (id: DroppableId, change: Position) => {\n if (!collection) {\n return;\n }\n registry.droppable.getById(id).callbacks.scroll(change);\n };\n\n const stopPublishing = () => {\n // This function can be called defensively\n if (!collection) {\n return;\n }\n // Stop any pending dom collections or publish\n publisher.stop();\n\n // Tell all droppables to stop watching scroll\n // all good if they where not already listening\n const home: DroppableDescriptor = collection.critical.droppable;\n registry.droppable\n .getAllByType(home.type)\n .forEach((entry: DroppableEntry) => entry.callbacks.dragStopped());\n\n // Unsubscribe from registry updates\n collection.unsubscribe();\n // Finally - clear our collection\n collection = null;\n };\n\n const subscriber: Subscriber = (event: RegistryEvent) => {\n invariant(\n collection,\n 'Should only be subscribed when a collection is occurring',\n );\n // The dragging item can be add and removed when using a clone\n // We do not publish updates for the critical item\n const dragging: DraggableDescriptor = collection.critical.draggable;\n\n if (event.type === 'ADDITION') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.add(event.value);\n }\n }\n if (event.type === 'REMOVAL') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.remove(event.value);\n }\n }\n };\n\n const startPublishing = (request: LiftRequest): StartPublishingResult => {\n invariant(\n !collection,\n 'Cannot start capturing critical dimensions as there is already a collection',\n );\n const entry: DraggableEntry = registry.draggable.getById(\n request.draggableId,\n );\n const home: DroppableEntry = registry.droppable.getById(\n entry.descriptor.droppableId,\n );\n\n const critical: Critical = {\n draggable: entry.descriptor,\n droppable: home.descriptor,\n };\n\n const unsubscribe = registry.subscribe(subscriber);\n\n collection = {\n critical,\n unsubscribe,\n };\n\n return getInitialPublish({\n critical,\n registry,\n scrollOptions: request.scrollOptions,\n });\n };\n\n const marshal: DimensionMarshal = {\n // Droppable changes\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n scrollDroppable,\n updateDroppableScroll,\n\n // Entry\n startPublishing,\n stopPublishing,\n };\n\n return marshal;\n};\n","// @flow\nimport type { State, DraggableId } from '../types';\n\nexport default (state: State, id: DraggableId): boolean => {\n // Ready to go!\n if (state.phase === 'IDLE') {\n return true;\n }\n\n // Can lift depending on the type of drop animation\n if (state.phase !== 'DROP_ANIMATING') {\n return false;\n }\n\n // - For a user drop we allow the user to drag other Draggables\n // immediately as items are most likely already in their home\n // - For a cancel items will be moving back to their original position\n // as such it is a cleaner experience to block them from dragging until\n // the drop animation is complete. Otherwise they will be grabbing\n // items not in their original position which can lead to bad visuals\n // Not allowing dragging of the dropping draggable\n if (state.completed.result.draggableId === id) {\n return false;\n }\n\n // if dropping - allow lifting\n // if cancelling - disallow lifting\n return state.completed.result.reason === 'DROP';\n};\n","// @flow\nimport { type Position } from 'css-box-model';\n\n// Not guarenteed to scroll by the entire amount\nexport default (change: Position): void => {\n window.scrollBy(change.x, change.y);\n};\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { type Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n DroppableDimensionMap,\n DroppableId,\n} from '../../../types';\nimport { invariant } from '../../../invariant';\nimport isPositionInFrame from '../../visibility/is-position-in-frame';\nimport { toDroppableList } from '../../dimension-structures';\nimport { find } from '../../../native-with-fallback';\n\nconst getScrollableDroppables = memoizeOne(\n (droppables: DroppableDimensionMap): DroppableDimension[] =>\n toDroppableList(droppables).filter(\n (droppable: DroppableDimension): boolean => {\n // exclude disabled droppables\n if (!droppable.isEnabled) {\n return false;\n }\n\n // only want droppables that are scrollable\n if (!droppable.frame) {\n return false;\n }\n\n return true;\n },\n ),\n);\n\nconst getScrollableDroppableOver = (\n target: Position,\n droppables: DroppableDimensionMap,\n): DroppableDimension | undefined => {\n const maybe: DroppableDimension | undefined = find(\n getScrollableDroppables(droppables),\n (droppable: DroppableDimension): boolean => {\n invariant(droppable.frame, 'Invalid result');\n return isPositionInFrame(droppable.frame.pageMarginBox)(target);\n },\n );\n\n return maybe;\n};\n\ntype Api = {\n center: Position,\n destination: DroppableId | null,\n droppables: DroppableDimensionMap,\n};\n\nexport default ({\n center,\n destination,\n droppables,\n}: Api): DroppableDimension | null | undefined => {\n // We need to scroll the best droppable frame we can so that the\n // placeholder buffer logic works correctly\n\n if (destination) {\n const dimension: DroppableDimension = droppables[destination];\n if (!dimension.frame) {\n return null;\n }\n return dimension;\n }\n\n // 2. If we are not over a droppable - are we over a droppable frame?\n const dimension: DroppableDimension | undefined = getScrollableDroppableOver(\n center,\n droppables,\n );\n\n return dimension;\n};\n","// @flow\n\n// Values used to control how the fluid auto scroll feels\nconst config = {\n // percentage distance from edge of container:\n startFromPercentage: 0.25,\n maxScrollAtPercentage: 0.05,\n // pixels per frame\n maxPixelScroll: 28,\n\n // A function used to ease a percentage value\n // A simple linear function would be: (percentage) => percentage;\n // percentage is between 0 and 1\n // result must be between 0 and 1\n ease: (percentage: number): number => Math.pow(percentage, 2),\n\n durationDampening: {\n // ms: how long to dampen the speed of an auto scroll from the start of a drag\n stopDampeningAt: 1200,\n // ms: when to start accelerating the reduction of duration dampening\n accelerateAt: 360,\n },\n};\n\nexport default config;\n","// @flow\nimport type { Rect } from 'css-box-model';\nimport config from '../../config';\nimport type { Axis } from '../../../../../types';\n\n// all in pixels\nexport type DistanceThresholds = {\n startScrollingFrom: number\n maxScrollValueAt: number\n};\n\n// converts the percentages in the config into actual pixel values\nexport default (container: Rect, axis: Axis): DistanceThresholds => {\n const startScrollingFrom: number =\n container[axis.size] * config.startFromPercentage;\n const maxScrollValueAt: number =\n container[axis.size] * config.maxScrollAtPercentage;\n\n const thresholds: DistanceThresholds = {\n startScrollingFrom,\n maxScrollValueAt,\n };\n\n return thresholds;\n};\n","// @flow\nimport { warning } from '../../../dev-warning';\n\ntype Args = {\n startOfRange: number,\n endOfRange: number,\n current: number,\n};\n\nexport default ({ startOfRange, endOfRange, current }: Args): number => {\n const range: number = endOfRange - startOfRange;\n\n if (range === 0) {\n warning(`\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n `);\n return 0;\n }\n\n const currentInRange: number = current - startOfRange;\n const percentage: number = currentInRange / range;\n return percentage;\n};\n","// @flow\n\n// A scroll event will only be triggered when there is a value of at least 1px change\nexport default 1;\n","// @flow\nimport { type DistanceThresholds } from './get-distance-thresholds';\nimport getPercentage from '../../get-percentage';\nimport config from '../../config';\nimport minScroll from './min-scroll';\n\nexport default (\n distanceToEdge: number,\n thresholds: DistanceThresholds,\n): number => {\n /*\n // This function only looks at the distance to one edge\n // Example: looking at bottom edge\n |----------------------------------|\n | |\n | |\n | |\n | |\n | | => no scroll in this range\n | |\n | |\n | startScrollingFrom (eg 100px) |\n | |\n | | => increased scroll value the closer to maxScrollValueAt\n | maxScrollValueAt (eg 10px) |\n | | => max scroll value in this range\n |----------------------------------|\n */\n\n // too far away to auto scroll\n if (distanceToEdge > thresholds.startScrollingFrom) {\n return 0;\n }\n\n // use max speed when on or over boundary\n if (distanceToEdge <= thresholds.maxScrollValueAt) {\n return config.maxPixelScroll;\n }\n\n // when just going on the boundary return the minimum integer\n if (distanceToEdge === thresholds.startScrollingFrom) {\n return minScroll;\n }\n\n // to get the % past startScrollingFrom we will calculate\n // the % the value is from maxScrollValueAt and then invert it\n const percentageFromMaxScrollValueAt: number = getPercentage({\n startOfRange: thresholds.maxScrollValueAt,\n endOfRange: thresholds.startScrollingFrom,\n current: distanceToEdge,\n });\n\n const percentageFromStartScrollingFrom: number =\n 1 - percentageFromMaxScrollValueAt;\n\n const scroll: number =\n config.maxPixelScroll * config.ease(percentageFromStartScrollingFrom);\n\n // scroll will always be a positive integer\n return Math.ceil(scroll);\n};\n","// @flow\nimport getPercentage from '../../get-percentage';\nimport config from '../../config';\nimport minScroll from './min-scroll';\n\nconst accelerateAt: number = config.durationDampening.accelerateAt;\nconst stopAt: number = config.durationDampening.stopDampeningAt;\n\nexport default (proposedScroll: number, dragStartTime: number): number => {\n const startOfRange: number = dragStartTime;\n const endOfRange: number = stopAt;\n const now: number = Date.now();\n const runTime: number = now - startOfRange;\n\n // we have finished the time dampening period\n if (runTime >= stopAt) {\n return proposedScroll;\n }\n\n // Up to this point we know there is a proposed scroll\n // but we have not reached our accelerate point\n // Return the minimum amount of scroll\n if (runTime < accelerateAt) {\n return minScroll;\n }\n\n const betweenAccelerateAtAndStopAtPercentage: number = getPercentage({\n startOfRange: accelerateAt,\n endOfRange,\n current: runTime,\n });\n\n const scroll: number =\n proposedScroll * config.ease(betweenAccelerateAtAndStopAtPercentage);\n\n return Math.ceil(scroll);\n};\n","// @flow\nimport { type DistanceThresholds } from './get-distance-thresholds';\nimport getValueFromDistance from './get-value-from-distance';\nimport dampenValueByTime from './dampen-value-by-time';\nimport minScroll from './min-scroll';\n\ntype Args = {\n distanceToEdge: number,\n thresholds: DistanceThresholds,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n distanceToEdge,\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n}: Args): number => {\n const scroll: number = getValueFromDistance(distanceToEdge, thresholds);\n\n // not enough distance to trigger a minimum scroll\n // we can bail here\n if (scroll === 0) {\n return 0;\n }\n\n // Dampen an auto scroll speed based on duration of drag\n\n if (!shouldUseTimeDampening) {\n return scroll;\n }\n\n // Once we know an auto scroll should occur based on distance,\n // we must let at least 1px through to trigger a scroll event an\n // another auto scroll call\n\n return Math.max(dampenValueByTime(scroll, dragStartTime), minScroll);\n};\n","// @flow\nimport type { Rect, Spacing } from 'css-box-model';\nimport getDistanceThresholds, {\n type DistanceThresholds,\n} from './get-distance-thresholds';\nimport type { Axis } from '../../../../../types';\nimport getValue from './get-value';\n\ntype GetOnAxisArgs = {\n container: Rect,\n distanceToEdges: Spacing,\n dragStartTime: number,\n axis: Axis,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n container,\n distanceToEdges,\n dragStartTime,\n axis,\n shouldUseTimeDampening,\n}: GetOnAxisArgs): number => {\n const thresholds: DistanceThresholds = getDistanceThresholds(container, axis);\n const isCloserToEnd: boolean =\n distanceToEdges[axis.end] < distanceToEdges[axis.start];\n\n if (isCloserToEnd) {\n return getValue({\n distanceToEdge: distanceToEdges[axis.end],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n });\n }\n\n return (\n -1 *\n getValue({\n distanceToEdge: distanceToEdges[axis.start],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n })\n );\n};\n","// @flow\nimport type { Rect, Position } from 'css-box-model';\n\ntype Args = {\n container: Rect,\n subject: Rect,\n proposedScroll: Position,\n};\n\nexport default ({ container, subject, proposedScroll }: Args): Position | null | undefined => {\n const isTooBigVertically: boolean = subject.height > container.height;\n const isTooBigHorizontally: boolean = subject.width > container.width;\n\n // not too big on any axis\n if (!isTooBigHorizontally && !isTooBigVertically) {\n return proposedScroll;\n }\n\n // too big on both axis\n if (isTooBigHorizontally && isTooBigVertically) {\n return null;\n }\n\n // Only too big on one axis\n // Exclude the axis that we cannot scroll on\n return {\n x: isTooBigHorizontally ? 0 : proposedScroll.x,\n y: isTooBigVertically ? 0 : proposedScroll.y,\n };\n};\n","// @flow\nimport type { Position, Rect, Spacing } from 'css-box-model';\nimport { apply, isEqual, origin } from '../../../position';\nimport getScrollOnAxis from './get-scroll-on-axis';\nimport adjustForSizeLimits from './adjust-for-size-limits';\nimport { horizontal, vertical } from '../../../axis';\n\n// will replace -0 and replace with +0\nconst clean = apply((value: number) => (value === 0 ? 0 : value));\n\ntype Args = {\n dragStartTime: number,\n container: Rect,\n subject: Rect,\n center: Position,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n dragStartTime,\n container,\n subject,\n center,\n shouldUseTimeDampening,\n}: Args): Position | null => {\n // get distance to each edge\n const distanceToEdges: Spacing = {\n top: center.y - container.top,\n right: container.right - center.x,\n bottom: container.bottom - center.y,\n left: center.x - container.left,\n };\n\n // 1. Figure out which x,y values are the best target\n // 2. Can the container scroll in that direction at all?\n // If no for both directions, then return null\n // 3. Is the center close enough to a edge to start a drag?\n // 4. Based on the distance, calculate the speed at which a scroll should occur\n // The lower distance value the faster the scroll should be.\n // Maximum speed value should be hit before the distance is 0\n // Negative values to not continue to increase the speed\n const y: number = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: vertical,\n shouldUseTimeDampening,\n });\n const x: number = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: horizontal,\n shouldUseTimeDampening,\n });\n\n const required: Position = clean({ x, y });\n\n // nothing required\n if (isEqual(required, origin)) {\n return null;\n }\n\n // need to not scroll in a direction that we are too big to scroll in\n const limited: Position | null | undefined = adjustForSizeLimits({\n container,\n subject,\n proposedScroll: required,\n });\n\n if (!limited) {\n return null;\n }\n\n return isEqual(limited, origin) ? null : limited;\n};\n","\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n Viewport,\n Scrollable,\n} from '../../types';\n\nimport { add, apply, isEqual, origin } from '../position';\n\ntype CanPartiallyScrollArgs = {\n max: Position;\n current: Position;\n change: Position;\n};\n\nconst smallestSigned = apply((value: number) => {\n if (value === 0) {\n return 0;\n }\n return value > 0 ? 1 : -1;\n});\n\ntype GetRemainderArgs = {\n current: Position;\n max: Position;\n change: Position;\n};\n\n// We need to figure out how much of the movement\n// cannot be done with a scroll\nexport const getOverlap = (() => {\n const getRemainder = (target: number, max: number): number => {\n if (target < 0) {\n return target;\n }\n if (target > max) {\n return target - max;\n }\n return 0;\n };\n\n return ({ current, max, change }: GetRemainderArgs): Position | null => {\n const targetScroll: Position = add(current, change);\n\n const overlap: Position = {\n x: getRemainder(targetScroll.x, max.x),\n y: getRemainder(targetScroll.y, max.y),\n };\n\n if (isEqual(overlap, origin)) {\n return null;\n }\n\n return overlap;\n };\n})();\n\nexport const canPartiallyScroll = ({\n max: rawMax,\n current,\n change,\n}: CanPartiallyScrollArgs): boolean => {\n const max: Position = {\n x: Math.max(current.x, rawMax.x),\n y: Math.max(current.y, rawMax.y),\n };\n\n const smallestChange: Position = smallestSigned(change);\n\n const overlap: Position | null = getOverlap({\n max,\n current,\n change: smallestChange,\n });\n\n if (!overlap) {\n return true;\n }\n\n if (smallestChange.x !== 0 && overlap.x === 0) {\n return true;\n }\n\n if (smallestChange.y !== 0 && overlap.y === 0) {\n return true;\n }\n\n return false;\n};\n\nexport const canScrollWindow = (\n viewport: Viewport,\n change: Position,\n): boolean =>\n canPartiallyScroll({\n current: viewport.scroll.current,\n max: viewport.scroll.max,\n change,\n });\n\nexport const getWindowOverlap = (\n viewport: Viewport,\n change: Position,\n): Position | null => {\n if (!canScrollWindow(viewport, change)) {\n return null;\n }\n\n const max: Position = viewport.scroll.max;\n const current: Position = viewport.scroll.current;\n\n return getOverlap({\n current,\n max,\n change,\n });\n};\n\nexport const canScrollDroppable = (\n droppable: DroppableDimension,\n change: Position,\n): boolean => {\n\n const frame: Scrollable | null = droppable.frame;\n\n if (!frame) {\n return false;\n }\n\n return canPartiallyScroll({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change,\n });\n};\n\nexport const getDroppableOverlap = (\n droppable: DroppableDimension,\n change: Position,\n): Position | null => {\n\n const frame: Scrollable | null = droppable.frame;\n\n if (!frame) {\n return null;\n }\n\n if (!canScrollDroppable(droppable, change)) {\n return null;\n }\n\n return getOverlap({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change,\n });\n};\n\n\n// // @flow\n// import { type Position } from 'css-box-model';\n// import { add, apply, isEqual, origin } from '../position';\n// import type { DroppableDimension, Viewport, Scrollable } from '../../types';\n\n// type CanPartiallyScrollArgs = {|\n// max: Position,\n// current: Position,\n// change: Position,\n// |};\n\n// const smallestSigned = apply((value: number) => {\n// if (value === 0) {\n// return 0;\n// }\n// return value > 0 ? 1 : -1;\n// });\n\n// type GetRemainderArgs = {|\n// current: Position,\n// max: Position,\n// change: Position,\n// |};\n\n// // We need to figure out how much of the movement\n// // cannot be done with a scroll\n// export const getOverlap = (() => {\n// const getRemainder = (target: number, max: number): number => {\n// if (target < 0) {\n// return target;\n// }\n// if (target > max) {\n// return target - max;\n// }\n// return 0;\n// };\n\n// return ({ current, max, change }: GetRemainderArgs): ?Position => {\n// const targetScroll: Position = add(current, change);\n\n// const overlap: Position = {\n// x: getRemainder(targetScroll.x, max.x),\n// y: getRemainder(targetScroll.y, max.y),\n// };\n\n// if (isEqual(overlap, origin)) {\n// return null;\n// }\n\n// return overlap;\n// };\n// })();\n\n// export const canPartiallyScroll = ({\n// max: rawMax,\n// current,\n// change,\n// }: CanPartiallyScrollArgs): boolean => {\n// // It is possible for the max scroll to be greater than the current scroll\n// // when there are scrollbars on the cross axis. We adjust for this by\n// // increasing the max scroll point if needed\n// // This will allow movements backwards even if the current scroll is greater than the max scroll\n// const max: Position = {\n// x: Math.max(current.x, rawMax.x),\n// y: Math.max(current.y, rawMax.y),\n// };\n\n// // Only need to be able to move the smallest amount in the desired direction\n// const smallestChange: Position = smallestSigned(change);\n\n// const overlap: ?Position = getOverlap({\n// max,\n// current,\n// change: smallestChange,\n// });\n\n// // no overlap at all - we can move there!\n// if (!overlap) {\n// return true;\n// }\n\n// // if there was an x value, but there is no x overlap - then we can scroll on the x!\n// if (smallestChange.x !== 0 && overlap.x === 0) {\n// return true;\n// }\n\n// // if there was an y value, but there is no y overlap - then we can scroll on the y!\n// if (smallestChange.y !== 0 && overlap.y === 0) {\n// return true;\n// }\n\n// return false;\n// };\n\n// export const canScrollWindow = (\n// viewport: Viewport,\n// change: Position,\n// ): boolean =>\n// canPartiallyScroll({\n// current: viewport.scroll.current,\n// max: viewport.scroll.max,\n// change,\n// });\n\n// export const getWindowOverlap = (\n// viewport: Viewport,\n// change: Position,\n// ): ?Position => {\n// if (!canScrollWindow(viewport, change)) {\n// return null;\n// }\n\n// const max: Position = viewport.scroll.max;\n// const current: Position = viewport.scroll.current;\n\n// return getOverlap({\n// current,\n// max,\n// change,\n// });\n// };\n\n// export const canScrollDroppable = (\n// droppable: DroppableDimension,\n// change: Position,\n// ): boolean => {\n// const frame: ?Scrollable = droppable.frame;\n\n// // Cannot scroll when there is no scrollable\n// if (!frame) {\n// return false;\n// }\n\n// return canPartiallyScroll({\n// current: frame.scroll.current,\n// max: frame.scroll.max,\n// change,\n// });\n// };\n\n// export const getDroppableOverlap = (\n// droppable: DroppableDimension,\n// change: Position,\n// ): ?Position => {\n// const frame: ?Scrollable = droppable.frame;\n\n// if (!frame) {\n// return null;\n// }\n\n// if (!canScrollDroppable(droppable, change)) {\n// return null;\n// }\n\n// return getOverlap({\n// current: frame.scroll.current,\n// max: frame.scroll.max,\n// change,\n// });\n// };\n","// @flow\nimport type { Position, Rect } from 'css-box-model';\nimport type { Viewport } from '../../../types';\nimport getScroll from './get-scroll';\nimport { canScrollWindow } from '../can-scroll';\n\ntype Args = {\n viewport: Viewport,\n subject: Rect,\n center: Position,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n viewport,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n}: Args): Position | null => {\n const scroll: Position | null = getScroll({\n dragStartTime,\n container: viewport.frame,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n return scroll && canScrollWindow(viewport, scroll) ? scroll : null;\n};\n","// @flow\nimport type { Position, Rect } from 'css-box-model';\nimport type { Scrollable, DroppableDimension } from '../../../types';\nimport getScroll from './get-scroll';\nimport { canScrollDroppable } from '../can-scroll';\n\ntype Args = {\n droppable: DroppableDimension,\n subject: Rect,\n center: Position,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n droppable,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n}: Args): Position | null => {\n // We know this has a closestScrollable\n const frame: Scrollable | null = droppable.frame;\n\n // this should never happen - just being safe\n if (!frame) {\n return null;\n }\n\n const scroll: Position | null = getScroll({\n dragStartTime,\n container: frame.pageMarginBox,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n return scroll && canScrollDroppable(droppable, scroll) ? scroll : null;\n};\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport type {\n DraggingState,\n DroppableId,\n DraggableDimension,\n DroppableDimension,\n Viewport,\n} from '../../../types';\nimport getBestScrollableDroppable from './get-best-scrollable-droppable';\nimport whatIsDraggedOver from '../../droppable/what-is-dragged-over';\nimport getWindowScrollChange from './get-window-scroll-change';\nimport getDroppableScrollChange from './get-droppable-scroll-change';\n\ntype Args = {\n state: DraggingState,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n scrollWindow: (scroll: Position) => void,\n scrollDroppable: (id: DroppableId, scroll: Position) => void,\n};\n\nexport default ({\n state,\n dragStartTime,\n shouldUseTimeDampening,\n scrollWindow,\n scrollDroppable,\n}: Args): void => {\n const center: Position = state.current.page.borderBoxCenter;\n const draggable: DraggableDimension =\n state.dimensions.draggables[state.critical.draggable.id];\n const subject: Rect = draggable.page.marginBox;\n // 1. Can we scroll the viewport?\n if (state.isWindowScrollAllowed) {\n const viewport: Viewport = state.viewport;\n const change: Position | null = getWindowScrollChange({\n dragStartTime,\n viewport,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n if (change) {\n scrollWindow(change);\n return;\n }\n }\n\n const droppable: DroppableDimension | null | undefined = getBestScrollableDroppable({\n center,\n destination: whatIsDraggedOver(state.impact),\n droppables: state.dimensions.droppables,\n });\n\n if (!droppable) {\n return;\n }\n\n const change: Position | null = getDroppableScrollChange({\n dragStartTime,\n droppable,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n if (change) {\n scrollDroppable(droppable.descriptor.id, change);\n }\n};\n","// @flow\nimport rafSchd from 'raf-schd';\nimport { type Position } from 'css-box-model';\nimport type { DraggingState, DroppableId } from '../../../types';\nimport scroll from './scroll';\nimport { invariant } from '../../../invariant';\nimport * as timings from '../../../debug/timings';\n\nexport type PublicArgs = {\n scrollWindow: (change: Position) => void,\n scrollDroppable: (id: DroppableId, change: Position) => void,\n};\n\nexport type FluidScroller = {\n scroll: (state: DraggingState) => void,\n start: (state: DraggingState) => void,\n stop: () => void,\n};\n\ntype WhileDragging = {\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n scrollWindow,\n scrollDroppable,\n}: PublicArgs): FluidScroller => {\n const scheduleWindowScroll = rafSchd(scrollWindow);\n const scheduleDroppableScroll = rafSchd(scrollDroppable);\n let dragging: WhileDragging | null = null;\n\n const tryScroll = (state: DraggingState): void => {\n invariant(dragging, 'Cannot fluid scroll if not dragging');\n\n const { shouldUseTimeDampening, dragStartTime } = dragging!; // not null\n\n scroll({\n state,\n scrollWindow: scheduleWindowScroll,\n scrollDroppable: scheduleDroppableScroll,\n dragStartTime,\n shouldUseTimeDampening,\n });\n };\n\n const start = (state: DraggingState) => {\n timings.start('starting fluid scroller');\n invariant(!dragging, 'Cannot start auto scrolling when already started');\n const dragStartTime: number = Date.now();\n\n let wasScrollNeeded: boolean = false;\n const fakeScrollCallback = () => {\n wasScrollNeeded = true;\n };\n scroll({\n state,\n dragStartTime: 0,\n shouldUseTimeDampening: false,\n scrollWindow: fakeScrollCallback,\n scrollDroppable: fakeScrollCallback,\n });\n\n dragging = {\n dragStartTime,\n shouldUseTimeDampening: wasScrollNeeded,\n };\n timings.finish('starting fluid scroller');\n\n // we know an auto scroll is needed - let's do it!\n if (wasScrollNeeded) {\n tryScroll(state);\n }\n };\n\n const stop = () => {\n // can be called defensively\n if (!dragging) {\n return;\n }\n scheduleWindowScroll.cancel();\n scheduleDroppableScroll.cancel();\n dragging = null;\n };\n\n return {\n start,\n stop,\n scroll: tryScroll,\n };\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport { add, subtract } from '../position';\nimport {\n canScrollWindow,\n canScrollDroppable,\n getWindowOverlap,\n getDroppableOverlap,\n} from './can-scroll';\nimport whatIsDraggedOver from '../droppable/what-is-dragged-over';\nimport { type MoveArgs } from '../action-creators';\nimport type {\n DroppableDimension,\n Viewport,\n DraggingState,\n DroppableId,\n} from '../../types';\n\ntype Args = {\n scrollDroppable: (id: DroppableId, change: Position) => void,\n scrollWindow: (offset: Position) => void,\n move: (args: MoveArgs) => unknown,\n};\n\nexport type JumpScroller = (state: DraggingState) => void;\n\ntype Remainder = Position;\n\nexport default ({\n move,\n scrollDroppable,\n scrollWindow,\n}: Args): JumpScroller => {\n const moveByOffset = (state: DraggingState, offset: Position) => {\n const client: Position = add(state.current.client.selection, offset);\n move({ client });\n };\n\n const scrollDroppableAsMuchAsItCan = (\n droppable: DroppableDimension,\n change: Position,\n ): Remainder | null => {\n // Droppable cannot absorb any of the scroll\n if (!canScrollDroppable(droppable, change)) {\n return change;\n }\n\n // Position | null\n const overlap: Position | null = getDroppableOverlap(droppable, change);\n\n // Droppable can absorb the entire change\n if (!overlap) {\n scrollDroppable(droppable.descriptor.id, change);\n return null;\n }\n\n // Droppable can only absorb a part of the change\n const whatTheDroppableCanScroll: Position = subtract(change, overlap);\n scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll);\n\n const remainder: Position = subtract(change, whatTheDroppableCanScroll);\n return remainder;\n };\n\n const scrollWindowAsMuchAsItCan = (\n isWindowScrollAllowed: boolean,\n viewport: Viewport,\n change: Position,\n ): Position | null => {\n if (!isWindowScrollAllowed) {\n return change;\n }\n\n if (!canScrollWindow(viewport, change)) {\n // window cannot absorb any of the scroll\n return change;\n }\n\n const overlap: Position | null = getWindowOverlap(viewport, change);\n\n // window can absorb entire scroll\n if (!overlap) {\n scrollWindow(change);\n return null;\n }\n\n // window can only absorb a part of the scroll\n const whatTheWindowCanScroll: Position = subtract(change, overlap);\n scrollWindow(whatTheWindowCanScroll);\n\n const remainder: Position = subtract(change, whatTheWindowCanScroll);\n return remainder;\n };\n\n const jumpScroller: JumpScroller = (state: DraggingState) => {\n const request: Position | null = state.scrollJumpRequest;\n\n if (!request) {\n return;\n }\n\n const destination: DroppableId | null = whatIsDraggedOver(state.impact);\n invariant(\n destination,\n 'Cannot perform a jump scroll when there is no destination',\n );\n\n // 1. We scroll the droppable first if we can to avoid the draggable\n // leaving the list\n\n const droppableRemainder: Position | null = scrollDroppableAsMuchAsItCan(\n state.dimensions.droppables[destination],\n request,\n );\n\n // droppable absorbed the entire scroll\n if (!droppableRemainder) {\n return;\n }\n\n const viewport: Viewport = state.viewport;\n const windowRemainder: Position | null = scrollWindowAsMuchAsItCan(\n state.isWindowScrollAllowed,\n viewport,\n droppableRemainder,\n );\n\n // window could absorb all the droppable remainder\n if (!windowRemainder) {\n return;\n }\n\n // The entire scroll could not be absorbed by the droppable and window\n // so we manually move whatever is left\n moveByOffset(state, windowRemainder);\n };\n\n return jumpScroller;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport createFluidScroller, { type FluidScroller } from './fluid-scroller';\nimport createJumpScroller, { type JumpScroller } from './jump-scroller';\nimport type { AutoScroller } from './auto-scroller-types';\nimport type { DroppableId, State } from '../../types';\nimport type { MoveArgs } from '../action-creators';\n\nexport type Args = {\n scrollWindow: (offset: Position) => void,\n scrollDroppable: (id: DroppableId, change: Position) => void,\n move: (args: MoveArgs) => unknown,\n};\n\nexport default ({\n scrollDroppable,\n scrollWindow,\n move,\n}: Args): AutoScroller => {\n const fluidScroller: FluidScroller = createFluidScroller({\n scrollWindow,\n scrollDroppable,\n });\n\n const jumpScroll: JumpScroller = createJumpScroller({\n move,\n scrollWindow,\n scrollDroppable,\n });\n\n const scroll = (state: State) => {\n // Only allowing auto scrolling in the DRAGGING phase\n if (state.phase !== 'DRAGGING') {\n return;\n }\n\n if (state.movementMode === 'FLUID') {\n fluidScroller.scroll(state);\n return;\n }\n\n if (!state.scrollJumpRequest) {\n return;\n }\n\n jumpScroll(state);\n };\n\n const scroller: AutoScroller = {\n scroll,\n start: fluidScroller.start,\n stop: fluidScroller.stop,\n };\n\n return scroller;\n};\n","// @flow\nexport const prefix: string = 'data-rbd';\nexport const dragHandle = (() => {\n const base = `${prefix}-drag-handle`;\n\n return {\n base,\n draggableId: `${base}-draggable-id`,\n contextId: `${base}-context-id`,\n };\n})();\n\nexport const draggable = (() => {\n const base: string = `${prefix}-draggable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`,\n };\n})();\n\nexport const droppable = (() => {\n const base: string = `${prefix}-droppable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`,\n };\n})();\n\nexport const placeholder = {\n contextId: `${prefix}-placeholder-context-id`,\n};\n\nexport const scrollContainer = {\n contextId: `${prefix}-scroll-container-context-id`,\n};\n","// @flow\nimport type { ContextId } from '../../types';\nimport { transitions } from '../../animation';\nimport * as attributes from '../data-attributes';\n\n// Exact\nexport type Styles = {\n always: string,\n dragging: string,\n resting: string,\n dropAnimating: string,\n userCancel: string,\n};\n\n// Exact\ntype Rule = {\n selector: string\n styles: Partial<Styles>\n};\n\ntype DragState =\n | 'always'\n | 'resting'\n | 'dragging'\n | 'dropAnimating'\n | 'userCancel';\n\nconst makeGetSelector = (context: string) => (attribute: string) =>\n `[${attribute}=\"${context}\"]`;\n\nconst getStyles = (rules: Rule[], property: DragState): string =>\n rules\n .map((rule: Rule): string => {\n const value: string | undefined = rule.styles[property];\n if (!value) {\n return '';\n }\n\n return `${rule.selector} { ${value} }`;\n })\n .join(' ');\n\nconst noPointerEvents: string = 'pointer-events: none;';\n\nexport default (contextId: ContextId): Styles => {\n const getSelector = makeGetSelector(contextId);\n\n // ## Drag handle styles\n\n // -webkit-touch-callout\n // A long press on anchors usually pops a content menu that has options for\n // the link such as 'Open in new tab'. Because long press is used to start\n // a drag we need to opt out of this behavior\n\n // -webkit-tap-highlight-color\n // Webkit based browsers add a grey overlay to anchors when they are active.\n // We remove this tap overlay as it is confusing for users\n // https://css-tricks.com/snippets/css/remove-gray-highlight-when-tapping-links-in-mobile-safari/\n\n // touch-action: manipulation\n // Avoid the *pull to refresh action* and *delayed anchor focus* on Android Chrome\n\n // cursor: grab\n // We apply this by default for an improved user experience. It is such a common default that we\n // bake it right in. Consumers can opt out of this by adding a selector with higher specificity\n // The cursor will not apply when pointer-events is set to none\n\n // pointer-events: none\n // this is used to prevent pointer events firing on draggables during a drag\n // Reasons:\n // 1. performance: it stops the other draggables from processing mouse events\n // 2. scrolling: it allows the user to scroll through the current draggable\n // to scroll the list behind\n // 3.* function: it blocks other draggables from starting. This is not relied on though as there\n // is a function on the context (canLift) which is a more robust way of controlling this\n\n const dragHandle: Rule = (() => {\n const grabCursor = `\n cursor: -webkit-grab;\n cursor: grab;\n `;\n return {\n selector: getSelector(attributes.dragHandle.contextId),\n styles: {\n always: `\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n `,\n resting: grabCursor,\n dragging: noPointerEvents,\n // it is fine for users to start dragging another item when a drop animation is occurring\n dropAnimating: grabCursor,\n // Not applying grab cursor during a user cancel as it is not possible for users to reorder\n // items during a cancel\n },\n };\n })();\n\n // ## Draggable styles\n\n // transition: transform\n // This controls the animation of draggables that are moving out of the way\n // The main draggable is controlled by react-motion.\n\n const draggable: Rule = (() => {\n const transition: string = `\n transition: ${transitions.outOfTheWay};\n `;\n return {\n selector: getSelector(attributes.draggable.contextId),\n styles: {\n dragging: transition,\n dropAnimating: transition,\n userCancel: transition,\n },\n };\n })();\n\n // ## Droppable styles\n\n // overflow-anchor: none;\n // Opting out of the browser feature which tries to maintain\n // the scroll position when the DOM changes above the fold.\n // This does not work well with reordering DOM nodes.\n // When we drop a Draggable it already has the correct scroll applied.\n\n const droppable: Rule = {\n selector: getSelector(attributes.droppable.contextId),\n styles: {\n always: `overflow-anchor: none;`,\n // need pointer events on the droppable to allow manual scrolling\n },\n };\n\n // ## Body styles\n\n // cursor: grab\n // We apply this by default for an improved user experience. It is such a common default that we\n // bake it right in. Consumers can opt out of this by adding a selector with higher specificity\n\n // user-select: none\n // This prevents the user from selecting text on the page while dragging\n\n // overflow-anchor: none\n // We are in control and aware of all of the window scrolls that occur\n // we do not want the browser to have behaviors we do not expect\n\n const body: Rule = {\n selector: 'body',\n styles: {\n dragging: `\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n `,\n },\n };\n\n const rules: Rule[] = [draggable, dragHandle, droppable, body];\n\n return {\n always: getStyles(rules, 'always'),\n resting: getStyles(rules, 'resting'),\n dragging: getStyles(rules, 'dragging'),\n dropAnimating: getStyles(rules, 'dropAnimating'),\n userCancel: getStyles(rules, 'userCancel'),\n };\n};\n","// @flow\n// eslint-disable-next-line no-restricted-imports\nimport { useLayoutEffect, useEffect } from 'react';\n\n// https://github.com/reduxjs/react-redux/blob/v7-beta/src/components/connectAdvanced.js#L35\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect because we want\n// `connect` to perform sync updates to a ref to save the latest props after\n// a render is actually committed to the DOM.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined'\n ? useLayoutEffect\n : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n","// @flow\nimport { useRef } from \"react\";\nimport memoizeOne from \"memoize-one\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { invariant } from \"../../invariant\";\nimport type { StyleMarshal } from \"./style-marshal-types\";\nimport type { ContextId, DropReason } from \"../../types\";\nimport getStyles, { type Styles } from \"./get-styles\";\nimport { prefix } from \"../data-attributes\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\n\nconst getHead = (): HTMLHeadElement => {\n const head: HTMLHeadElement | null = document.querySelector(\"head\");\n invariant(head, \"Cannot find the head to append a style to\");\n return head;\n};\n\nconst createStyleEl = (nonce?: string): HTMLStyleElement => {\n const el: HTMLStyleElement = document.createElement(\"style\");\n if (nonce) {\n el.setAttribute(\"nonce\", nonce);\n }\n el.type = \"text/css\";\n return el;\n};\n\nexport default function useStyleMarshal(contextId: ContextId, nonce?: string) {\n const styles: Styles = useMemo(() => getStyles(contextId), [contextId]);\n const alwaysRef = useRef<HTMLStyleElement | null>(null);\n const dynamicRef = useRef<HTMLStyleElement | null>(null);\n\n const setDynamicStyle = useCallback(\n // Using memoizeOne to prevent frequent updates to textContext\n memoizeOne((proposed: string) => {\n const el: HTMLStyleElement | null = dynamicRef.current;\n invariant(el, \"Cannot set dynamic style element if it is not set\");\n el.textContent = proposed;\n }),\n [],\n );\n\n const setAlwaysStyle = useCallback((proposed: string) => {\n const el: HTMLStyleElement | null = alwaysRef.current;\n invariant(el, \"Cannot set dynamic style element if it is not set\");\n el.textContent = proposed;\n }, []);\n\n // using layout effect as programatic dragging might start straight away (such as for cypress)\n useLayoutEffect(() => {\n invariant(\n !alwaysRef.current && !dynamicRef.current,\n \"style elements already mounted\",\n );\n\n const always: HTMLStyleElement = createStyleEl(nonce);\n const dynamic: HTMLStyleElement = createStyleEl(nonce);\n\n // store their refs\n alwaysRef.current = always;\n dynamicRef.current = dynamic;\n\n // for easy identification\n always.setAttribute(`${prefix}-always`, contextId);\n dynamic.setAttribute(`${prefix}-dynamic`, contextId);\n\n // add style tags to head\n getHead().appendChild(always);\n getHead().appendChild(dynamic);\n\n // set initial style\n setAlwaysStyle(styles.always);\n setDynamicStyle(styles.resting);\n\n return () => {\n const remove = (ref: any) => {\n const current: HTMLStyleElement | null = ref.current;\n invariant(current, \"Cannot unmount ref as it is not set\");\n getHead().removeChild(current);\n ref.current = null;\n };\n\n remove(alwaysRef);\n remove(dynamicRef);\n };\n }, [\n nonce,\n setAlwaysStyle,\n setDynamicStyle,\n styles.always,\n styles.resting,\n contextId,\n ]);\n\n const dragging = useCallback(\n () => setDynamicStyle(styles.dragging),\n [setDynamicStyle, styles.dragging],\n );\n const dropping = useCallback(\n (reason: DropReason) => {\n if (reason === \"DROP\") {\n setDynamicStyle(styles.dropAnimating);\n return;\n }\n setDynamicStyle(styles.userCancel);\n },\n [setDynamicStyle, styles.dropAnimating, styles.userCancel],\n );\n const resting = useCallback(() => {\n // Can be called defensively\n if (!dynamicRef.current) {\n return;\n }\n setDynamicStyle(styles.resting);\n }, [setDynamicStyle, styles.resting]);\n\n const marshal: StyleMarshal = useMemo(\n () => ({\n dragging,\n dropping,\n resting,\n }),\n [dragging, dropping, resting],\n );\n\n return marshal;\n}\n","// @flow\nexport default (el: Element | null): typeof window => {\n if (el && el.ownerDocument?.defaultView) {\n return el.ownerDocument.defaultView;\n }\n\n return window;\n};\n\n\n// export default (el: Element | null): typeof window =>\n// el && el.ownerDocument ? el.ownerDocument.defaultView : window;\n","// @flow\nimport getWindowFromEl from '../window/get-window-from-el';\n\nexport default function isHtmlElement(el: Element): el is HTMLElement {\n return el instanceof getWindowFromEl(el).HTMLElement;\n}\n\n// export default function isHtmlElement(el: Object): boolean %checks {\n// return el instanceof getWindowFromEl(el).HTMLElement;\n// }\n","// @flow\nimport type { DraggableId, ContextId } from '../../types';\nimport { dragHandle as dragHandleAttr } from '../data-attributes';\nimport { warning } from '../../dev-warning';\nimport { find, toArray } from '../../native-with-fallback';\nimport isHtmlElement from '../is-type-of-element/is-html-element';\n\nexport default function findDragHandle(\n contextId: ContextId,\n draggableId: DraggableId,\n): HTMLElement | null {\n // cannot create a selector with the draggable id as it might not be a valid attribute selector\n const selector: string = `[${dragHandleAttr.contextId}=\"${contextId}\"]`;\n const possible: Element[] = toArray(document.querySelectorAll(selector));\n\n if (!possible.length) {\n warning(`Unable to find any drag handles in the context \"${contextId}\"`);\n return null;\n }\n\n const handle: Element | undefined = find(possible, (el: Element): boolean => {\n return el.getAttribute(dragHandleAttr.draggableId) === draggableId;\n });\n\n if (!handle) {\n warning(\n `Unable to find drag handle with id \"${draggableId}\" as no handle with a matching id was found`,\n );\n return null;\n }\n\n if (!isHtmlElement(handle)) {\n warning('drag handle needs to be a HTMLElement');\n return null;\n }\n\n return handle as HTMLElement;\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport type { DraggableId, ContextId, AnimationFrameID } from \"../../types\";\nimport type { FocusMarshal, Unregister } from \"./focus-marshal-types\";\nimport { dragHandle as dragHandleAttr } from \"../data-attributes\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport findDragHandle from \"../get-elements/find-drag-handle\";\n\n// Exact\ntype Entry = {\n id: DraggableId,\n focus: () => void,\n};\n\ntype EntryMap = {\n [id: DraggableId]: Entry,\n};\n\nexport default function useFocusMarshal(contextId: ContextId): FocusMarshal {\n const entriesRef = useRef<EntryMap>({});\n const recordRef = useRef<DraggableId | null>(null);\n const restoreFocusFrameRef = useRef<AnimationFrameID | null>(null);\n const isMountedRef = useRef<boolean>(false);\n\n const register = useCallback(function register(\n id: DraggableId,\n focus: () => void,\n ): Unregister {\n const entry: Entry = { id, focus };\n entriesRef.current[id] = entry;\n\n return function unregister() {\n const entries: EntryMap = entriesRef.current;\n const current: Entry = entries[id];\n // entry might have been overrided by another registration\n if (current !== entry) {\n delete entries[id];\n }\n };\n }, []);\n\n const tryGiveFocus = useCallback(\n function tryGiveFocus(tryGiveFocusTo: DraggableId) {\n const handle: HTMLElement | null = findDragHandle(contextId, tryGiveFocusTo);\n\n if (handle && handle !== document.activeElement) {\n handle.focus();\n }\n },\n [contextId],\n );\n\n const tryShiftRecord = useCallback(function tryShiftRecord(\n previous: DraggableId,\n redirectTo: DraggableId,\n ) {\n if (recordRef.current === previous) {\n recordRef.current = redirectTo;\n }\n }, []);\n\n const tryRestoreFocusRecorded = useCallback(\n function tryRestoreFocusRecorded() {\n // frame already queued\n if (restoreFocusFrameRef.current) {\n return;\n }\n\n // cannot give focus if unmounted\n // this code path is generally not hit expect for some hot-reloading flows\n if (!isMountedRef.current) {\n return;\n }\n\n restoreFocusFrameRef.current = requestAnimationFrame(() => {\n restoreFocusFrameRef.current = null;\n const record: DraggableId | null = recordRef.current;\n if (record) {\n tryGiveFocus(record);\n }\n });\n },\n [tryGiveFocus],\n );\n\n const tryRecordFocus = useCallback(function tryRecordFocus(id: DraggableId) {\n // clear any existing record\n recordRef.current = null;\n\n const focused: Element | null = document.activeElement;\n\n // no item focused so it cannot be our item\n if (!focused) {\n return;\n }\n\n // focused element is not a drag handle or does not have the right id\n if (focused.getAttribute(dragHandleAttr.draggableId) !== id) {\n return;\n }\n\n recordRef.current = id;\n }, []);\n\n useLayoutEffect(() => {\n isMountedRef.current = true;\n return function clearFrameOnUnmount() {\n isMountedRef.current = false;\n const frameId: AnimationFrameID | null = restoreFocusFrameRef.current;\n if (frameId) {\n cancelAnimationFrame(frameId);\n }\n };\n }, []);\n\n const marshal: FocusMarshal = useMemo(\n () => ({\n register,\n tryRecordFocus,\n tryRestoreFocusRecorded,\n tryShiftRecord,\n }),\n [register, tryRecordFocus, tryRestoreFocusRecorded, tryShiftRecord],\n );\n\n return marshal;\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { TypeId, DraggableId, DroppableId } from '../../types';\nimport type {\n Registry,\n DraggableAPI,\n DroppableAPI,\n DraggableEntry,\n DroppableEntry,\n RegistryEvent,\n Subscriber,\n Unsubscribe,\n DraggableEntryMap,\n DroppableEntryMap,\n} from './registry-types';\nimport { values } from '../../native-with-fallback';\n\ntype EntryMap = {\n draggables: DraggableEntryMap,\n droppables: DroppableEntryMap,\n};\n\nexport default function createRegistry(): Registry {\n const entries: EntryMap = {\n draggables: {},\n droppables: {},\n };\n\n const subscribers: Subscriber[] = [];\n\n function subscribe(cb: Subscriber): Unsubscribe {\n subscribers.push(cb);\n\n return function unsubscribe(): void {\n const index: number = subscribers.indexOf(cb);\n\n // might have been removed by a clean\n if (index === -1) {\n return;\n }\n\n subscribers.splice(index, 1);\n };\n }\n\n function notify(event: RegistryEvent) {\n if (subscribers.length) {\n subscribers.forEach((cb) => cb(event));\n }\n }\n\n function findDraggableById(id: DraggableId): DraggableEntry | null {\n return entries.draggables[id] || null;\n }\n\n function getDraggableById(id: DraggableId): DraggableEntry {\n const entry: DraggableEntry | null = findDraggableById(id);\n invariant(entry, `Cannot find draggable entry with id [${id}]`);\n return entry;\n }\n\n const draggableAPI: DraggableAPI = {\n register: (entry: DraggableEntry) => {\n entries.draggables[entry.descriptor.id] = entry;\n notify({ type: 'ADDITION', value: entry });\n },\n update: (entry: DraggableEntry, last: DraggableEntry) => {\n const current: DraggableEntry | null = entries.draggables[last.descriptor.id];\n\n // item already removed\n if (!current) {\n return;\n }\n\n // id already used for another mount\n if (current.uniqueId !== entry.uniqueId) {\n return;\n }\n\n // We are safe to delete the old entry and add a new one\n delete entries.draggables[last.descriptor.id];\n entries.draggables[entry.descriptor.id] = entry;\n },\n unregister: (entry: DraggableEntry) => {\n const draggableId: DraggableId = entry.descriptor.id;\n const current: DraggableEntry | null = findDraggableById(draggableId);\n\n // can occur if cleaned before unregistration\n if (!current) {\n return;\n }\n\n // outdated uniqueId\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n\n delete entries.draggables[draggableId];\n notify({ type: 'REMOVAL', value: entry });\n },\n getById: getDraggableById,\n findById: findDraggableById,\n exists: (id: DraggableId): boolean => Boolean(findDraggableById(id)),\n getAllByType: (type: TypeId): DraggableEntry[] =>\n values(entries.draggables).filter(\n (entry: DraggableEntry): boolean => entry.descriptor.type === type,\n ),\n };\n\n function findDroppableById(id: DroppableId): DroppableEntry | null {\n return entries.droppables[id] || null;\n }\n\n function getDroppableById(id: DroppableId): DroppableEntry {\n const entry: DroppableEntry | null = findDroppableById(id);\n invariant(entry, `Cannot find droppable entry with id [${id}]`);\n return entry;\n }\n\n const droppableAPI: DroppableAPI = {\n register: (entry: DroppableEntry) => {\n entries.droppables[entry.descriptor.id] = entry;\n },\n unregister: (entry: DroppableEntry) => {\n const current: DroppableEntry | null = findDroppableById(entry.descriptor.id);\n\n // can occur if cleaned before an unregistry\n if (!current) {\n return;\n }\n\n // already changed\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n\n delete entries.droppables[entry.descriptor.id];\n },\n getById: getDroppableById,\n findById: findDroppableById,\n exists: (id: DroppableId): boolean => Boolean(findDroppableById(id)),\n getAllByType: (type: TypeId): DroppableEntry[] =>\n values(entries.droppables).filter(\n (entry: DroppableEntry): boolean => entry.descriptor.type === type,\n ),\n };\n\n function clean(): void {\n // kill entries\n entries.draggables = {};\n entries.droppables = {};\n // remove all subscribers\n subscribers.length = 0;\n }\n\n return {\n draggable: draggableAPI,\n droppable: droppableAPI,\n subscribe,\n clean,\n };\n}\n","// @flow\nimport { useEffect } from \"react\";\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { Registry } from \"./registry-types\";\nimport createRegistry from \"./create-registry\";\n\nexport default function useRegistry(): Registry {\n const registry: Registry = useMemo(createRegistry, []);\n\n useEffect(() => {\n return function unmount() {\n // clean up the registry to avoid any leaks\n // doing it after an animation frame so that other things unmounting\n // can continue to interact with the registry\n requestAnimationFrame(registry.clean);\n };\n }, [registry]);\n\n return registry;\n}\n","// @flow\nimport React from 'react';\n// import type { Store } from '../../state/store-types';\nimport type { ReactReduxContextValue } from 'react-redux';\nimport type { State, Action } from '../../state/store-types';\n\n// export default React.createContext<Store | null>(null);\nexport default React.createContext<ReactReduxContextValue<State, Action> | null>(null);\n","// @flow\nimport { invariant } from '../invariant';\n\nexport default (): HTMLElement => {\n const body: HTMLElement | null = document.body;\n invariant(body, 'Cannot find document.body');\n return body;\n};\n","// @flow\n// https://allyjs.io/tutorials/hiding-elements.html\n// Element is visually hidden but is readable by screen readers\nconst visuallyHidden: Object = {\n position: 'absolute',\n width: '1px',\n height: '1px',\n margin: '-1px',\n border: '0',\n padding: '0',\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n 'clip-path': 'inset(100%)',\n};\n\nexport default visuallyHidden;\n","// @flow\nimport { useRef, useEffect } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport type { Announce, ContextId } from \"../../types\";\nimport { warning } from \"../../dev-warning\";\nimport getBodyElement from \"../get-body-element\";\nimport visuallyHidden from \"../visually-hidden-style\";\n\nexport const getId = (contextId: ContextId): string =>\n `rbd-announcement-${contextId}`;\n\nexport default function useAnnouncer(contextId: ContextId): Announce {\n const id: string = useMemo(() => getId(contextId), [contextId]);\n const ref = useRef<HTMLElement | null>(null);\n\n useEffect(\n function setup() {\n const el: HTMLElement = document.createElement(\"div\");\n // storing reference for usage in announce\n ref.current = el;\n\n // identifier\n el.id = id;\n\n // Aria live region\n\n // will force itself to be read\n el.setAttribute(\"aria-live\", \"assertive\");\n // must read the whole thing every time\n el.setAttribute(\"aria-atomic\", \"true\");\n\n // hide the element visually\n Object.assign(el.style, visuallyHidden);\n\n // Add to body\n getBodyElement().appendChild(el);\n\n return function cleanup() {\n // Not clearing the ref as it might be used by announce before the timeout expires\n\n // unmounting after a timeout to let any announcements\n // during a mount be published\n setTimeout(function remove() {\n // checking if element exists as the body might have been changed by things like 'turbolinks'\n const body: HTMLElement = getBodyElement(); // HTMLBodyElement\n if (body.contains(el)) {\n body.removeChild(el);\n }\n // if el was the current ref - clear it so that\n // we can get a warning if announce is called\n if (el === ref.current) {\n ref.current = null;\n }\n });\n };\n },\n [id],\n );\n\n const announce: Announce = useCallback((message: string): void => {\n const el: HTMLElement | null = ref.current;\n if (el) {\n el.textContent = message;\n return;\n }\n\n warning(`\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your <DragDropContext /> in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n \"${message}\"\n `);\n }, []);\n\n return announce;\n}\n","// @flow\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { Id } from \"../types\";\n\nlet count: number = 0;\n\ntype Options = {\n separator: string,\n};\n\nconst defaults: Options = { separator: \"::\" };\n\nexport function reset() {\n count = 0;\n}\n\nexport default function useUniqueId(\n prefix: string,\n options: Options = defaults,\n): Id {\n return useMemo(\n () => `${prefix}${options.separator}${count++}`,\n [options.separator, prefix],\n );\n}\n","// @flow\nimport { useEffect } from \"react\";\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { ContextId, ElementId } from \"../../types\";\nimport getBodyElement from \"../get-body-element\";\nimport useUniqueId from \"../use-unique-id\";\n\n// Exact\ntype GetIdArgs = {\n contextId: ContextId,\n uniqueId: string,\n};\n\nexport function getElementId({ contextId, uniqueId }: GetIdArgs): ElementId {\n return `rbd-hidden-text-${contextId}-${uniqueId}`;\n}\n\n// Exact\ntype Args = {\n contextId: ContextId,\n text: string,\n};\n\nexport default function useHiddenTextElement({\n contextId,\n text,\n}: Args): ElementId {\n const uniqueId: string = useUniqueId(\"hidden-text\", { separator: \"-\" });\n const id: ElementId = useMemo(\n () => getElementId({ contextId, uniqueId }),\n [uniqueId, contextId],\n );\n\n useEffect(\n function mount() {\n const el: HTMLElement = document.createElement(\"div\");\n\n // identifier\n el.id = id;\n\n // add the description text\n el.textContent = text;\n\n // Using `display: none` prevent screen readers from reading this element in the document flow\n el.style.display = \"none\";\n\n // Add to body\n getBodyElement().appendChild(el);\n\n return function unmount() {\n // checking if element exists as the body might have been changed by things like 'turbolinks'\n const body: HTMLElement = getBodyElement(); // HTMLBodyElement\n if (body.contains(el)) {\n body.removeChild(el);\n }\n };\n },\n [id, text],\n );\n\n return id;\n}\n","// @flow\nimport React from 'react';\nimport type { DraggableId, ContextId, ElementId } from '../../types';\nimport type { DimensionMarshal } from '../../state/dimension-marshal/dimension-marshal-types';\nimport type { FocusMarshal } from '../use-focus-marshal/focus-marshal-types';\nimport type { Registry } from '../../state/registry/registry-types';\n\n// Exact\nexport type AppContextValue = {\n focus: FocusMarshal,\n contextId: ContextId,\n canLift: (id: DraggableId) => boolean,\n isMovementAllowed: () => boolean,\n dragHandleUsageInstructionsId: ElementId,\n marshal: DimensionMarshal,\n registry: Registry,\n};\n\nexport default React.createContext<AppContextValue | null>(null);\n","// @flow\nimport { invariant } from '../../invariant';\nimport { warning } from '../../dev-warning';\n\n// Exact\ntype Version = {\n major: number,\n minor: number,\n patch: number,\n raw: string,\n};\n\n// We can use a simple regex here given that:\n// - the version that react supplies is always full: eg 16.5.2\n// - our peer dependency version is to a full version (eg ^16.3.1)\nconst semver: RegExp = /(\\d+)\\.(\\d+)\\.(\\d+)/;\nconst getVersion = (value: string): Version => {\n const result: (string[]) | null = semver.exec(value);\n\n invariant(result != null, `Unable to parse React version ${value}`);\n\n const major: number = Number(result[1]);\n const minor: number = Number(result[2]);\n const patch: number = Number(result[3]);\n\n return {\n major,\n minor,\n patch,\n raw: value,\n };\n};\n\nconst isSatisfied = (expected: Version, actual: Version): boolean => {\n if (actual.major > expected.major) {\n return true;\n }\n\n if (actual.major < expected.major) {\n return false;\n }\n\n // major is equal, continue on\n\n if (actual.minor > expected.minor) {\n return true;\n }\n\n if (actual.minor < expected.minor) {\n return false;\n }\n\n // minor is equal, continue on\n\n return actual.patch >= expected.patch;\n};\n\nexport default (peerDepValue: string, actualValue: string) => {\n const peerDep: Version = getVersion(peerDepValue);\n const actual: Version = getVersion(actualValue);\n\n if (isSatisfied(peerDep, actual)) {\n return;\n }\n\n warning(`\n React version: [${actual.raw}]\n does not satisfy expected peer dependency version: [${peerDep.raw}]\n\n This can result in run time bugs, and even fatal crashes\n `);\n};\n","// @flow\nimport { warning } from '../../dev-warning';\n\nconst suffix: string = `\n We expect a html5 doctype: <!doctype html>\n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md\n`;\n\nexport default (doc: Document) => {\n const doctype: DocumentType | null = doc.doctype;\n\n if (!doctype) {\n warning(`\n No <!doctype html> found.\n\n ${suffix}\n `);\n return;\n }\n\n if (doctype.name.toLowerCase() !== 'html') {\n warning(`\n Unexpected <!doctype> found: (${doctype.name})\n\n ${suffix}\n `);\n }\n\n if (doctype.publicId !== '') {\n warning(`\n Unexpected <!doctype> publicId found: (${doctype.publicId})\n A html5 doctype does not have a publicId\n\n ${suffix}\n `);\n }\n};\n","// @flow\n\nexport default function useDev(useHook: () => void) {\n // Don't run any validation in production\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useHook();\n }\n}\n","// @flow\nimport { useEffect } from 'react';\nimport { error } from '../dev-warning';\nimport useDev from './use-dev';\n\nexport default function useDevSetupWarning(fn: () => void, inputs?: unknown[]) {\n useDev(() => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n try {\n fn();\n } catch (e) {\n error(`\n A setup problem was encountered.\n\n > ${e.message}\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, inputs);\n });\n}\n","// @flow\nimport React from 'react';\nimport { peerDependencies } from '../../../package.json';\nimport checkReactVersion from './check-react-version';\nimport checkDoctype from './check-doctype';\nimport useDevSetupWarning from '../use-dev-setup-warning';\n\nexport default function useStartupValidation() {\n useDevSetupWarning(() => {\n checkReactVersion(peerDependencies.react, React.version);\n checkDoctype(document);\n }, []);\n}\n","// @flow\nimport { useRef, useEffect } from 'react';\n\n// export default function usePrevious<T>(current: T): {| current: T |} {\n// const ref = useRef<T>(current);\n\n// // will be updated on the next render\n// useEffect(() => {\n// ref.current = current;\n// });\n\n// // return the existing current (pre render)\n// return ref;\n// }\n\nexport default function usePrevious<T>(\n current: T,\n): React.RefObject<T> { // MutableRefObject\n const ref = useRef<T>(current);\n\n useEffect(() => {\n ref.current = current;\n });\n\n return ref;\n}","// @flow\nimport { invariant } from '../../invariant';\n\n// Exact\nexport type Lock = {\n abandon: () => void,\n};\n\n// Exact\nexport type LockAPI = {\n isClaimed: () => boolean,\n isActive: (lock: Lock) => boolean,\n claim: (abandon: () => void) => Lock,\n release: () => void,\n tryAbandon: () => void,\n};\n\nexport default function create(): LockAPI {\n let lock: Lock | null = null;\n\n function isClaimed(): boolean {\n return Boolean(lock);\n }\n\n function isActive(value: Lock): boolean {\n return value === lock;\n }\n\n function claim(abandon: () => void): Lock {\n invariant(!lock, 'Cannot claim lock as it is already claimed');\n const newLock: Lock = { abandon };\n // update singleton\n lock = newLock;\n // return lock\n return newLock;\n }\n function release() {\n invariant(lock, 'Cannot release lock when there is no lock');\n lock = null;\n }\n\n function tryAbandon() {\n if (lock) {\n lock.abandon();\n release();\n }\n }\n\n return { isClaimed, isActive, claim, release, tryAbandon };\n}\n","// @flow\nexport const tab: number = 9;\nexport const enter: number = 13;\nexport const escape: number = 27;\nexport const space: number = 32;\nexport const pageUp: number = 33;\nexport const pageDown: number = 34;\nexport const end: number = 35;\nexport const home: number = 36;\nexport const arrowLeft: number = 37;\nexport const arrowUp: number = 38;\nexport const arrowRight: number = 39;\nexport const arrowDown: number = 40;\n","// @flow\nimport * as keyCodes from '../../../key-codes';\n\ntype KeyMap = {\n [key: number]: true,\n};\n\nconst preventedKeys: KeyMap = {\n // submission\n [keyCodes.enter]: true,\n // tabbing\n [keyCodes.tab]: true,\n};\n\nexport default (event: KeyboardEvent) => {\n if (preventedKeys[event.keyCode]) {\n event.preventDefault();\n }\n};\n","// @flow\nimport { find } from '../../../../native-with-fallback';\n\nconst supportedEventName: string = ((): string => {\n const base: string = 'visibilitychange';\n\n // Server side rendering\n if (typeof document === 'undefined') {\n return base;\n }\n\n // See https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n const candidates: string[] = [\n base,\n `ms${base}`,\n `webkit${base}`,\n `moz${base}`,\n `o${base}`,\n ];\n\n const supported: string | undefined = find(\n candidates,\n (eventName: string): boolean => `on${eventName}` in document,\n );\n\n return supported || base;\n})();\n\nexport default supportedEventName;\n","// @flow\nimport { useRef } from \"react\";\nimport { useCallback, useMemo } from \"@helpdice/memoizer\";\nimport type { Position } from \"css-box-model\";\nimport { invariant } from \"../../../invariant\";\nimport type {\n PreDragActions,\n FluidDragActions,\n DraggableId,\n SensorAPI,\n DraggableOptions,\n} from \"../../../types\";\nimport type {\n EventBinding,\n EventOptions,\n} from \"../../event-bindings/event-types\";\nimport bindEvents from \"../../event-bindings/bind-events\";\nimport * as keyCodes from \"../../key-codes\";\nimport preventStandardKeyEvents from \"./util/prevent-standard-key-events\";\nimport supportedPageVisibilityEventName from \"./util/supported-page-visibility-event-name\";\nimport useLayoutEffect from \"../../use-isomorphic-layout-effect\";\nimport { noop } from \"../../../empty\";\n\n// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\nexport const primaryButton: number = 0;\nexport const sloppyClickThreshold: number = 5;\n\nfunction isSloppyClickThresholdExceeded(\n original: Position,\n current: Position,\n): boolean {\n return (\n Math.abs(current.x - original.x) >= sloppyClickThreshold ||\n Math.abs(current.y - original.y) >= sloppyClickThreshold\n );\n}\n\n// Exact\ntype Idle = {\n type: \"IDLE\",\n};\n\n// Exact\ntype Pending = {\n type: \"PENDING\",\n point: Position,\n actions: PreDragActions,\n};\n\n// Exact\ntype Dragging = {\n type: \"DRAGGING\",\n actions: FluidDragActions,\n};\n\ntype Phase = Idle | Pending | Dragging;\n\nconst idle: Idle = { type: \"IDLE\" };\n\n// Exact\ntype GetCaptureArgs = {\n cancel: () => void,\n completed: () => void,\n getPhase: () => Phase,\n setPhase: (phase: Phase) => void,\n};\n\nfunction getCaptureBindings({\n cancel,\n completed,\n getPhase,\n setPhase,\n}: GetCaptureArgs): EventBinding[] {\n return [\n {\n eventName: \"mousemove\",\n fn: (event: MouseEvent) => {\n const { button, clientX, clientY } = event;\n if (button !== primaryButton) {\n return;\n }\n\n const point: Position = {\n x: clientX,\n y: clientY,\n };\n\n const phase: Phase = getPhase();\n\n // Already dragging\n if (phase.type === \"DRAGGING\") {\n // preventing default as we are using this event\n event.preventDefault();\n phase.actions.move(point);\n return;\n }\n\n // There should be a pending drag at this point\n invariant(phase.type === \"PENDING\", \"Cannot be IDLE\");\n const pending: Position = phase.point;\n\n // threshold not yet exceeded\n if (!isSloppyClickThresholdExceeded(pending, point)) {\n return;\n }\n\n // preventing default as we are using this event\n event.preventDefault();\n\n // Lifting at the current point to prevent the draggable item from\n // jumping by the sloppyClickThreshold\n const actions: FluidDragActions = phase.actions.fluidLift(point);\n\n setPhase({\n type: \"DRAGGING\",\n actions,\n });\n },\n },\n {\n eventName: \"mouseup\",\n fn: (event: MouseEvent) => {\n const phase: Phase = getPhase();\n\n if (phase.type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // preventing default as we are using this event\n event.preventDefault();\n phase.actions.drop({ shouldBlockNextClick: true });\n completed();\n },\n },\n {\n eventName: \"mousedown\",\n fn: (event: MouseEvent) => {\n // this can happen during a drag when the user clicks a button\n // other than the primary mouse button\n if (getPhase().type === \"DRAGGING\") {\n event.preventDefault();\n }\n\n cancel();\n },\n },\n {\n eventName: \"keydown\",\n fn: (event: KeyboardEvent) => {\n const phase: Phase = getPhase();\n // Abort if any keystrokes while a drag is pending\n if (phase.type === \"PENDING\") {\n cancel();\n return;\n }\n\n // cancelling a drag\n if (event.keyCode === keyCodes.escape) {\n event.preventDefault();\n cancel();\n return;\n }\n\n preventStandardKeyEvents(event);\n },\n },\n {\n eventName: \"resize\",\n fn: cancel,\n },\n {\n eventName: \"scroll\",\n // kill a pending drag if there is a window scroll\n options: { passive: true, capture: false },\n fn: () => {\n if (getPhase().type === \"PENDING\") {\n cancel();\n }\n },\n },\n\n // Need to opt out of dragging if the user is a force press\n // Only for safari which has decided to introduce its own custom way of doing things\n // https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html\n {\n eventName: \"webkitmouseforcedown\",\n // it is considered a indirect cancel so we do not\n // prevent default in any situation.\n fn: (event: Event) => {\n const phase: Phase = getPhase();\n invariant(phase.type !== \"IDLE\", \"Unexpected phase\");\n\n if (phase.actions.shouldRespectForcePress()) {\n cancel();\n return;\n }\n\n // This technically doesn't do anything.\n // It won't do anything if `webkitmouseforcewillbegin` is prevented.\n // But it is a good signal that we want to opt out of this\n\n event.preventDefault();\n },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n ];\n}\n\nexport default function useMouseSensor(api: SensorAPI) {\n const phaseRef = useRef<Phase>(idle);\n const unbindEventsRef = useRef<() => void>(noop);\n\n const startCaptureBinding: EventBinding = useMemo(\n () => ({\n eventName: \"mousedown\",\n fn: function onMouseDown(event: MouseEvent) {\n // Event already used\n if (event.defaultPrevented) {\n return;\n }\n // only starting a drag if dragging with the primary mouse button\n if (event.button !== primaryButton) {\n return;\n }\n\n // Do not start a drag if any modifier key is pressed\n if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {\n return;\n }\n\n const draggableId: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!draggableId) {\n return;\n }\n\n const actions: PreDragActions | null = api.tryGetLock(\n draggableId,\n // stop is defined later\n // eslint-disable-next-line no-use-before-define\n stop,\n { sourceEvent: event },\n );\n\n if (!actions) {\n return;\n }\n\n // consuming the event\n event.preventDefault();\n\n const point: Position = {\n x: event.clientX,\n y: event.clientY,\n };\n\n // unbind this listener\n unbindEventsRef.current();\n // using this function before it is defined as their is a circular usage pattern\n // eslint-disable-next-line no-use-before-define\n startPendingDrag(actions, point);\n },\n }),\n // not including startPendingDrag as it is not defined initially\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [api],\n );\n\n const preventForcePressBinding: EventBinding = useMemo(\n () => ({\n eventName: \"webkitmouseforcewillbegin\",\n fn: (event: Event) => {\n if (event.defaultPrevented) {\n return;\n }\n\n const id: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!id) {\n return;\n }\n\n const options: DraggableOptions | null = api.findOptionsForDraggable(id);\n\n if (!options) {\n return;\n }\n\n if (options.shouldRespectForcePress) {\n return;\n }\n\n if (!api.canGetLock(id)) {\n return;\n }\n\n event.preventDefault();\n },\n }),\n [api],\n );\n\n const listenForCapture = useCallback(\n function listenForCapture() {\n const options: EventOptions = {\n passive: false,\n capture: true,\n };\n\n unbindEventsRef.current = bindEvents(\n window,\n [preventForcePressBinding, startCaptureBinding],\n options,\n );\n },\n [preventForcePressBinding, startCaptureBinding],\n );\n\n const stop = useCallback(() => {\n const current: Phase = phaseRef.current;\n if (current.type === \"IDLE\") {\n return;\n }\n\n phaseRef.current = idle;\n unbindEventsRef.current();\n\n listenForCapture();\n }, [listenForCapture]);\n\n const cancel = useCallback(() => {\n const phase: Phase = phaseRef.current;\n stop();\n if (phase.type === \"DRAGGING\" && phase.actions.cancel) {\n phase.actions.cancel({ shouldBlockNextClick: true });\n }\n if (phase.type === \"PENDING\") {\n phase.actions.abort();\n }\n }, [stop]);\n\n const bindCapturingEvents = useCallback(\n function bindCapturingEvents() {\n const options = { capture: true, passive: false };\n const bindings: EventBinding[] = getCaptureBindings({\n cancel,\n completed: stop,\n getPhase: () => phaseRef.current,\n setPhase: (phase: Phase) => {\n phaseRef.current = phase;\n },\n });\n\n unbindEventsRef.current = bindEvents(window, bindings, options);\n },\n [cancel, stop],\n );\n\n const startPendingDrag = useCallback(\n function startPendingDrag(actions: PreDragActions, point: Position) {\n invariant(\n phaseRef.current.type === \"IDLE\",\n \"Expected to move from IDLE to PENDING drag\",\n );\n phaseRef.current = {\n type: \"PENDING\",\n point,\n actions,\n };\n bindCapturingEvents();\n },\n [bindCapturingEvents],\n );\n\n useLayoutEffect(\n function mount() {\n listenForCapture();\n\n // kill any pending window events when unmounting\n return function unmount() {\n unbindEventsRef.current();\n };\n },\n [listenForCapture],\n );\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { invariant } from \"../../../invariant\";\nimport type {\n SensorAPI,\n PreDragActions,\n SnapDragActions,\n DraggableId,\n} from \"../../../types\";\nimport type {\n EventBinding,\n EventOptions,\n} from \"../../event-bindings/event-types\";\nimport * as keyCodes from \"../../key-codes\";\nimport bindEvents from \"../../event-bindings/bind-events\";\nimport preventStandardKeyEvents from \"./util/prevent-standard-key-events\";\nimport supportedPageVisibilityEventName from \"./util/supported-page-visibility-event-name\";\nimport useLayoutEffect from \"../../use-isomorphic-layout-effect\";\n\nfunction noop() {}\n\ntype KeyMap = {\n [key: number]: true,\n};\n\nconst scrollJumpKeys: KeyMap = {\n [keyCodes.pageDown]: true,\n [keyCodes.pageUp]: true,\n [keyCodes.home]: true,\n [keyCodes.end]: true,\n};\n\nfunction getDraggingBindings(\n actions: SnapDragActions,\n stop: () => void,\n): EventBinding[] {\n function cancel() {\n stop();\n actions.cancel && actions.cancel();\n }\n\n function drop() {\n stop();\n actions.drop();\n }\n\n return [\n {\n eventName: \"keydown\",\n fn: (event: KeyboardEvent) => {\n if (event.keyCode === keyCodes.escape) {\n event.preventDefault();\n cancel();\n return;\n }\n\n // Dropping\n if (event.keyCode === keyCodes.space) {\n // need to stop parent Draggable's thinking this is a lift\n event.preventDefault();\n drop();\n return;\n }\n\n // Movement\n\n if (event.keyCode === keyCodes.arrowDown && actions.moveDown) {\n event.preventDefault();\n actions.moveDown();\n return;\n }\n\n if (event.keyCode === keyCodes.arrowUp && actions.moveUp) {\n event.preventDefault();\n actions.moveUp();\n return;\n }\n\n if (event.keyCode === keyCodes.arrowRight && actions.moveRight) {\n event.preventDefault();\n actions.moveRight();\n return;\n }\n\n if (event.keyCode === keyCodes.arrowLeft && actions.moveLeft) {\n event.preventDefault();\n actions.moveLeft();\n return;\n }\n\n // preventing scroll jumping at this time\n if (scrollJumpKeys[event.keyCode]) {\n event.preventDefault();\n return;\n }\n\n preventStandardKeyEvents(event);\n },\n },\n // any mouse actions kills a drag\n {\n eventName: \"mousedown\",\n fn: cancel,\n },\n {\n eventName: \"mouseup\",\n fn: cancel,\n },\n {\n eventName: \"click\",\n fn: cancel,\n },\n {\n eventName: \"touchstart\",\n fn: cancel,\n },\n // resizing the browser kills a drag\n {\n eventName: \"resize\",\n fn: cancel,\n },\n // kill if the user is using the mouse wheel\n // We are not supporting wheel / trackpad scrolling with keyboard dragging\n {\n eventName: \"wheel\",\n fn: cancel,\n // chrome says it is a violation for this to not be passive\n // it is fine for it to be passive as we just cancel as soon as we get\n // any event\n options: { passive: true },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n ];\n}\n\nexport default function useKeyboardSensor(api: SensorAPI) {\n const unbindEventsRef = useRef<() => void>(noop);\n\n const startCaptureBinding: EventBinding = useMemo(\n () => ({\n eventName: \"keydown\",\n fn: function onKeyDown(event: KeyboardEvent) {\n // Event already used\n if (event.defaultPrevented) {\n return;\n }\n\n // Need to start drag with a spacebar press\n if (event.keyCode !== keyCodes.space) {\n return;\n }\n\n const draggableId: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!draggableId) {\n return;\n }\n\n const preDrag: PreDragActions | null = api.tryGetLock(\n draggableId,\n // abort function not defined yet\n // eslint-disable-next-line no-use-before-define\n stop,\n { sourceEvent: event },\n );\n\n // Cannot start capturing at this time\n if (!preDrag) {\n return;\n }\n\n // we are consuming the event\n event.preventDefault();\n let isCapturing: boolean = true;\n\n // There is no pending period for a keyboard drag\n // We can lift immediately\n const actions: SnapDragActions = preDrag.snapLift();\n\n // unbind this listener\n unbindEventsRef.current();\n\n // setup our function to end everything\n function stop() {\n invariant(\n isCapturing,\n \"Cannot stop capturing a keyboard drag when not capturing\",\n );\n isCapturing = false;\n\n // unbind dragging bindings\n unbindEventsRef.current();\n // start listening for capture again\n // eslint-disable-next-line no-use-before-define\n listenForCapture();\n }\n\n // bind dragging listeners\n unbindEventsRef.current = bindEvents(\n window,\n getDraggingBindings(actions, stop),\n { capture: true, passive: false },\n );\n },\n }),\n // not including startPendingDrag as it is not defined initially\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [api],\n );\n\n const listenForCapture = useCallback(\n function tryStartCapture() {\n const options: EventOptions = {\n passive: false,\n capture: true,\n };\n\n unbindEventsRef.current = bindEvents(\n window,\n [startCaptureBinding],\n options,\n );\n },\n [startCaptureBinding],\n );\n\n useLayoutEffect(\n function mount() {\n listenForCapture();\n\n // kill any pending window events when unmounting\n return function unmount() {\n unbindEventsRef.current();\n };\n },\n [listenForCapture],\n );\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useCallback, useMemo } from \"@helpdice/memoizer\";\nimport type { Position } from \"css-box-model\";\nimport { invariant } from \"../../../invariant\";\nimport type {\n DraggableId,\n SensorAPI,\n PreDragActions,\n FluidDragActions,\n TimeoutID,\n} from \"../../../types\";\nimport type {\n EventBinding,\n EventOptions,\n} from \"../../event-bindings/event-types\";\nimport bindEvents from \"../../event-bindings/bind-events\";\nimport * as keyCodes from \"../../key-codes\";\nimport supportedPageVisibilityEventName from \"./util/supported-page-visibility-event-name\";\nimport { noop } from \"../../../empty\";\nimport useLayoutEffect from \"../../use-isomorphic-layout-effect\";\n\ntype TouchWithForce = Touch & {\n force: number,\n};\n\n//Exact\ntype Idle = {\n type: \"IDLE\",\n};\n\n// Exact\ntype Pending = {\n type: \"PENDING\",\n point: Position,\n actions: PreDragActions,\n longPressTimerId: TimeoutID,\n};\n\n// Exact\ntype Dragging = {\n type: \"DRAGGING\",\n actions: FluidDragActions,\n hasMoved: boolean,\n};\n\ntype Phase = Idle | Pending | Dragging;\n\nconst idle: Idle = { type: \"IDLE\" };\n// Decreased from 150 as a work around for an issue for forcepress on iOS\n// https://github.com/atlassian/react-beautiful-dnd/issues/1401\nexport const timeForLongPress: number = 120;\nexport const forcePressThreshold: number = 0.15;\n\n// Exact\ntype GetBindingArgs = {\n cancel: () => void,\n completed: () => void,\n getPhase: () => Phase,\n};\n\nfunction getWindowBindings({\n cancel,\n getPhase,\n}: GetBindingArgs): EventBinding[] {\n return [\n // If the orientation of the device changes - kill the drag\n // https://davidwalsh.name/orientation-change\n {\n eventName: \"orientationchange\",\n fn: cancel,\n },\n // some devices fire resize if the orientation changes\n {\n eventName: \"resize\",\n fn: cancel,\n },\n // Long press can bring up a context menu\n // need to opt out of this behavior\n {\n eventName: \"contextmenu\",\n fn: (event: Event) => {\n // always opting out of context menu events\n event.preventDefault();\n },\n },\n // On some devices it is possible to have a touch interface with a keyboard.\n // On any keyboard event we cancel a touch drag\n {\n eventName: \"keydown\",\n fn: (event: KeyboardEvent) => {\n if (getPhase().type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // direct cancel: we are preventing the default action\n // indirect cancel: we are not preventing the default action\n\n // escape is a direct cancel\n if (event.keyCode === keyCodes.escape) {\n event.preventDefault();\n }\n cancel();\n },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n ];\n}\n\n// All of the touch events get applied to the drag handle of the touch interaction\n// This plays well with the event.target being unmounted during a drag\nfunction getHandleBindings({\n cancel,\n completed,\n getPhase,\n}: GetBindingArgs): EventBinding[] {\n return [\n {\n eventName: \"touchmove\",\n // Opting out of passive touchmove (default) so as to prevent scrolling while moving\n // Not worried about performance as effect of move is throttled in requestAnimationFrame\n // Using `capture: false` due to a recent horrible firefox bug: https://twitter.com/alexandereardon/status/1125904207184187393\n options: { capture: false },\n fn: (event: TouchEvent) => {\n const phase: Phase = getPhase();\n // Drag has not yet started and we are waiting for a long press.\n if (phase.type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // At this point we are dragging\n phase.hasMoved = true;\n\n const { clientX, clientY } = event.touches[0];\n\n const point: Position = {\n x: clientX,\n y: clientY,\n };\n\n // We need to prevent the default event in order to block native scrolling\n // Also because we are using it as part of a drag we prevent the default action\n // as a sign that we are using the event\n event.preventDefault();\n phase.actions.move(point);\n },\n },\n {\n eventName: \"touchend\",\n fn: (event: TouchEvent) => {\n const phase: Phase = getPhase();\n // drag had not started yet - do not prevent the default action\n if (phase.type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // ending the drag\n event.preventDefault();\n phase.actions.drop({ shouldBlockNextClick: true });\n completed();\n },\n },\n {\n eventName: \"touchcancel\",\n fn: (event: TouchEvent) => {\n // drag had not started yet - do not prevent the default action\n if (getPhase().type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // already dragging - this event is directly ending a drag\n event.preventDefault();\n cancel();\n },\n },\n // Need to opt out of dragging if the user is a force press\n // Only for webkit which has decided to introduce its own custom way of doing things\n // https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html\n {\n eventName: \"touchforcechange\",\n fn: (event: TouchEvent) => {\n const phase: Phase = getPhase();\n\n // needed to use phase.actions\n invariant(phase.type !== \"IDLE\");\n\n // This is not fantastic logic, but it is done to account for\n // and issue with forcepress on iOS\n // Calling event.preventDefault() will currently opt out of scrolling and clicking\n // https://github.com/atlassian/react-beautiful-dnd/issues/1401\n\n const touch: TouchWithForce | null = (event.touches[0] as any);\n\n if (!touch) {\n return;\n }\n\n const isForcePress: boolean = touch.force >= forcePressThreshold;\n\n if (!isForcePress) {\n return;\n }\n\n const shouldRespect: boolean = phase.actions.shouldRespectForcePress();\n\n if (phase.type === \"PENDING\") {\n if (shouldRespect) {\n cancel();\n }\n // If not respecting we just let the event go through\n // It will not have an impact on the browser until\n // there has been a sufficient time ellapsed\n return;\n }\n\n // 'DRAGGING'\n\n if (shouldRespect) {\n if (phase.hasMoved) {\n // After the user has moved we do not allow the dragging item to be force pressed\n // This prevents strange behaviour such as a link preview opening mid drag\n event.preventDefault();\n return;\n }\n // indirect cancel\n cancel();\n return;\n }\n\n // not respecting during a drag\n event.preventDefault();\n },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n // Not adding a cancel on touchstart as this handler will pick up the initial touchstart event\n ];\n}\n\nexport default function useTouchSensor(api: SensorAPI) {\n const phaseRef = useRef<Phase>(idle);\n const unbindEventsRef = useRef<() => void>(noop);\n\n const getPhase = useCallback(function getPhase(): Phase {\n return phaseRef.current;\n }, []);\n\n const setPhase = useCallback(function setPhase(phase: Phase) {\n phaseRef.current = phase;\n }, []);\n\n const startCaptureBinding: EventBinding = useMemo(\n () => ({\n eventName: \"touchstart\",\n fn: function onTouchStart(event: TouchEvent) {\n // Event already used by something else\n if (event.defaultPrevented) {\n return;\n }\n\n // We need to NOT call event.preventDefault() so as to maintain as much standard\n // browser interactions as possible.\n // This includes navigation on anchors which we want to preserve\n\n const draggableId: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!draggableId) {\n return;\n }\n\n const actions: PreDragActions | null = api.tryGetLock(\n draggableId,\n // eslint-disable-next-line no-use-before-define\n stop,\n { sourceEvent: event },\n );\n\n // could not start a drag\n if (!actions) {\n return;\n }\n\n const touch: Touch = event.touches[0];\n const { clientX, clientY } = touch;\n const point: Position = {\n x: clientX,\n y: clientY,\n };\n\n // unbind this event handler\n unbindEventsRef.current();\n\n // eslint-disable-next-line no-use-before-define\n startPendingDrag(actions, point);\n },\n }),\n // not including stop or startPendingDrag as it is not defined initially\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [api],\n );\n\n const listenForCapture = useCallback(\n function listenForCapture() {\n const options: EventOptions = {\n capture: true,\n passive: false,\n };\n\n unbindEventsRef.current = bindEvents(\n window,\n [startCaptureBinding],\n options,\n );\n },\n [startCaptureBinding],\n );\n\n const stop = useCallback(() => {\n const current: Phase = phaseRef.current;\n if (current.type === \"IDLE\") {\n return;\n }\n\n // aborting any pending drag\n if (current.type === \"PENDING\") {\n clearTimeout(current.longPressTimerId);\n }\n\n setPhase(idle);\n unbindEventsRef.current();\n\n listenForCapture();\n }, [listenForCapture, setPhase]);\n\n const cancel = useCallback(() => {\n const phase: Phase = phaseRef.current;\n stop();\n if (phase.type === \"DRAGGING\" && phase.actions.cancel) {\n phase.actions.cancel({ shouldBlockNextClick: true });\n }\n if (phase.type === \"PENDING\") {\n phase.actions.abort();\n }\n }, [stop]);\n\n const bindCapturingEvents = useCallback(\n function bindCapturingEvents() {\n const options: EventOptions = { capture: true, passive: false };\n const args: GetBindingArgs = {\n cancel,\n completed: stop,\n getPhase,\n };\n\n // In prior versions of iOS it was required that touch listeners be added\n // to the handle to work correctly (even if the handle got removed in a portal / clone)\n // In the latest version it appears to be the opposite: for reparenting to work\n // the events need to be attached to the window.\n // For now i'll keep these two functions seperate in case we need to swap it back again\n // Old behaviour:\n // https://gist.github.com/parris/dda613e3ae78f14eb2dc9fa0f4bfce3d\n // https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed\n const unbindTarget = bindEvents(window, getHandleBindings(args), options);\n const unbindWindow = bindEvents(window, getWindowBindings(args), options);\n\n unbindEventsRef.current = function unbindAll() {\n unbindTarget();\n unbindWindow();\n };\n },\n [cancel, getPhase, stop],\n );\n\n const startDragging = useCallback(\n function startDragging() {\n const phase: Phase = getPhase();\n invariant(\n phase.type === \"PENDING\",\n `Cannot start dragging from phase ${phase.type}`,\n );\n\n const actions: FluidDragActions = phase.actions.fluidLift(phase.point);\n\n setPhase({\n type: \"DRAGGING\",\n actions,\n hasMoved: false,\n });\n },\n [getPhase, setPhase],\n );\n\n const startPendingDrag = useCallback(\n function startPendingDrag(actions: PreDragActions, point: Position) {\n invariant(\n getPhase().type === \"IDLE\",\n \"Expected to move from IDLE to PENDING drag\",\n );\n\n const longPressTimerId: TimeoutID = setTimeout(\n startDragging,\n timeForLongPress,\n );\n\n setPhase({\n type: \"PENDING\",\n point,\n actions,\n longPressTimerId,\n });\n\n bindCapturingEvents();\n },\n [bindCapturingEvents, getPhase, setPhase, startDragging],\n );\n\n useLayoutEffect(\n function mount() {\n listenForCapture();\n\n return function unmount() {\n // remove any existing listeners\n unbindEventsRef.current();\n\n // need to kill any pending drag start timer\n const phase: Phase = getPhase();\n if (phase.type === \"PENDING\") {\n clearTimeout(phase.longPressTimerId);\n setPhase(idle);\n }\n };\n },\n [getPhase, listenForCapture, setPhase],\n );\n\n // This is needed for safari\n // Simply adding a non capture, non passive 'touchmove' listener.\n // This forces event.preventDefault() in dynamically added\n // touchmove event handlers to actually work\n // https://github.com/atlassian/react-beautiful-dnd/issues/1374\n useLayoutEffect(function webkitHack(): () => void {\n const unbind = bindEvents(window, [\n {\n eventName: 'touchmove',\n // Using a new noop function for each usage as a single\n // removeEventListener() call will remove all handlers\n // with the same reference.\n fn: (): void => {},\n options: { capture: false, passive: false },\n },\n ], {});\n\n return unbind;\n}, []);\n\n // useLayoutEffect(function webkitHack() {\n // const unbind = bindEvents(window, [\n // {\n // eventName: \"touchmove\",\n // // using a new noop function for each usage as a single `removeEventListener()`\n // // call will remove all handlers with the same reference\n // // https://codesandbox.io/s/removing-multiple-handlers-with-same-reference-fxe15\n // fn: () => {},\n // options: { capture: false, passive: false },\n // },\n // ]);\n\n // return unbind;\n // }, []);\n}\n","// @flow\n/* eslint-disable react-hooks/rules-of-hooks */\nimport { invariant } from '../../invariant';\nimport type { Sensor } from '../../types';\nimport usePreviousRef from '../use-previous-ref';\nimport useDevSetupWarning from '../use-dev-setup-warning';\nimport useDev from '../use-dev';\n\nexport default function useValidateSensorHooks(sensorHooks: Sensor[]) {\n useDev(() => {\n const previousRef = usePreviousRef<Sensor[]>(sensorHooks);\n\n useDevSetupWarning(() => {\n invariant(\n previousRef.current.length === sensorHooks.length,\n 'Cannot change the amount of sensor hooks after mounting',\n );\n });\n });\n}\n","// @flow\nimport isHtmlElement from '../is-type-of-element/is-html-element';\n\nexport type TagNameMap = {\n [tagName: string]: true,\n};\n\nexport const interactiveTagNames: TagNameMap = {\n input: true,\n button: true,\n textarea: true,\n select: true,\n option: true,\n optgroup: true,\n video: true,\n audio: true,\n};\n\nfunction isAnInteractiveElement(parent: Element, current: Element | null) {\n if (current == null) {\n return false;\n }\n\n // Most interactive elements cannot have children. However, some can such as 'button'.\n // See 'Permitted content' on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n // Rather than having two different functions we can consolidate our checks into this single\n // function to keep things simple.\n // There is no harm checking if the parent has an interactive tag name even if it cannot have\n // any children. We need to perform this loop anyway to check for the contenteditable attribute\n const hasAnInteractiveTag: boolean = Boolean(\n interactiveTagNames[current.tagName.toLowerCase()],\n );\n\n if (hasAnInteractiveTag) {\n return true;\n }\n\n // contenteditable=\"true\" or contenteditable=\"\" are valid ways\n // of creating a contenteditable container\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable\n const attribute: string | null = current.getAttribute('contenteditable');\n if (attribute === 'true' || attribute === '') {\n return true;\n }\n\n // nothing more can be done and no results found\n if (current === parent) {\n return false;\n }\n\n // recursion to check parent\n return isAnInteractiveElement(parent, current.parentElement);\n}\n\n// Marked for Review\nexport default function isEventInInteractiveElement(\n draggable: Element,\n event: Event,\n): boolean {\n const target: EventTarget | null = event.target;\n\n if (target && !isHtmlElement(target as Element)) {\n return false;\n }\n\n return isAnInteractiveElement(draggable, target as Element);\n}\n","// @flow\nimport { getRect, type Position } from 'css-box-model';\n\nexport default (el: HTMLElement): Position =>\n getRect(el.getBoundingClientRect()).center;\n","// @flow\nimport getWindowFromEl from '../window/get-window-from-el';\n\nexport default function isElement(el: Element | null): el is Element {\n return el instanceof getWindowFromEl(el).Element;\n}\n\n// export default function isElement(el: Object): boolean %checks {\n// return el instanceof getWindowFromEl(el).Element;\n// }\n","// @flow Marked for Review\nimport { find } from '../../native-with-fallback';\n\n// const supportedMatchesName: string = ((): string => {\n// const base: string = 'matches';\n\n// // Server side rendering\n// if (typeof document === 'undefined') {\n// return base;\n// }\n\n// // See https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n// const candidates: string[] = [\n// base,\n// 'msMatchesSelector',\n// 'webkitMatchesSelector',\n// ];\n\n// const value: string | null = find(\n// candidates,\n// (name: string): boolean => name in Element.prototype,\n// );\n\n// return value || base;\n// })();\n\ntype MatchesMethod =\n | 'matches'\n | 'msMatchesSelector'\n | 'webkitMatchesSelector';\n\ntype MatchesElement = Element & {\n matches: (selector: string) => boolean;\n msMatchesSelector?: (selector: string) => boolean;\n webkitMatchesSelector?: (selector: string) => boolean;\n};\n\nconst supportedMatchesName: MatchesMethod = (() => {\n const base: MatchesMethod = 'matches';\n\n if (typeof document === 'undefined') {\n return base;\n }\n\n const candidates: MatchesMethod[] = [\n base,\n 'msMatchesSelector',\n 'webkitMatchesSelector',\n ];\n\n return find(\n candidates,\n (name: MatchesMethod): boolean => name in Element.prototype,\n ) || base;\n})();\n\n\nfunction closestPonyfill(el: Element | null, selector: string) {\n\n if (el == null) {\n return null;\n }\n\n const matchesElement = el as MatchesElement;\n\n // Element.prototype.matches is supported in ie11 with a different name\n // https://caniuse.com/#feat=matchesselector\n // $FlowFixMe - dynamic property\n\n // if (el[supportedMatchesName](selector)) {\n // return el;\n // }\n\n if (matchesElement[supportedMatchesName]?.(selector)) {\n return el;\n }\n\n // recursively look up the tree\n return closestPonyfill(el.parentElement, selector);\n}\n\nexport default function closest(el: Element | null, selector: string): Element | null {\n // Using native closest for maximum speed where we can\n if (el?.closest) {\n return el.closest(selector);\n }\n // ie11: damn you!\n return closestPonyfill(el, selector);\n}\n","// @flow\nimport type { ContextId, DraggableId } from '../../types';\nimport * as attributes from '../data-attributes';\nimport isElement from '../is-type-of-element/is-element';\nimport isHtmlElement from '../is-type-of-element/is-html-element';\nimport closest from './closest';\nimport { warning } from '../../dev-warning';\n\nfunction getSelector(contextId: ContextId): string {\n return `[${attributes.dragHandle.contextId}=\"${contextId}\"]`;\n}\n\nfunction findClosestDragHandleFromEvent(\n contextId: ContextId,\n event: Event,\n): HTMLElement | Element | null {\n const target: any = event.target; // Eventtarget | null\n\n if (!isElement(target)) {\n warning('event.target must be a Element');\n return null;\n }\n\n const selector: string = getSelector(contextId);\n const handle: Element | null = closest(target as Element, selector);\n\n if (!handle) {\n return null;\n }\n\n if (!isHtmlElement(handle)) {\n warning('drag handle must be a HTMLElement');\n return null;\n }\n\n return handle;\n}\n\nexport default function tryGetClosestDraggableIdFromEvent(\n contextId: ContextId,\n event: Event,\n): DraggableId | null {\n const handle: HTMLElement | Element | null = findClosestDragHandleFromEvent(contextId, event);\n\n if (!handle) {\n return null;\n }\n\n return handle.getAttribute(attributes.dragHandle.draggableId);\n}\n","// @flow\nimport type { DraggableId, ContextId } from '../../types';\nimport * as attributes from '../data-attributes';\nimport { find, toArray } from '../../native-with-fallback';\nimport { warning } from '../../dev-warning';\nimport isHtmlElement from '../is-type-of-element/is-html-element';\n\nexport default function findDraggable(\n contextId: ContextId,\n draggableId: DraggableId,\n): HTMLElement | null {\n // cannot create a selector with the draggable id as it might not be a valid attribute selector\n const selector: string = `[${attributes.draggable.contextId}=\"${contextId}\"]`;\n const possible: Element[] = toArray(document.querySelectorAll(selector));\n\n const draggable: Element | undefined = find(possible, (el: Element): boolean => {\n return el.getAttribute(attributes.draggable.id) === draggableId;\n });\n\n if (!draggable) {\n return null;\n }\n\n if (!isHtmlElement(draggable)) {\n warning('Draggable element is not a HTMLElement');\n return null;\n }\n\n return draggable as HTMLElement;\n}\n","// @flow\nimport rafSchd from \"raf-schd\";\nimport { useState } from \"react\";\nimport { useCallback, useMemo } from \"@helpdice/memoizer\";\nimport type { Position } from \"css-box-model\";\n// import { invariant } from \"../../invariant\";\nimport type {\n ContextId,\n State,\n Sensor,\n StopDragOptions,\n PreDragActions,\n FluidDragActions,\n SnapDragActions,\n DraggableId,\n SensorAPI,\n TryGetLock,\n TryGetLockOptions,\n DraggableOptions,\n} from \"../../types\";\nimport create, { type Lock, type LockAPI } from \"./lock\";\nimport type { Store, Action } from \"../../state/store-types\";\nimport canStartDrag from \"../../state/can-start-drag\";\nimport {\n move as moveAction,\n moveUp as moveUpAction,\n moveRight as moveRightAction,\n moveDown as moveDownAction,\n moveLeft as moveLeftAction,\n drop as dropAction,\n lift as liftAction,\n type LiftArgs as LiftActionArgs,\n flush,\n} from \"../../state/action-creators\";\nimport type {\n Registry,\n DraggableEntry,\n} from \"../../state/registry/registry-types\";\nimport useMouseSensor from \"./sensors/use-mouse-sensor\";\nimport useKeyboardSensor from \"./sensors/use-keyboard-sensor\";\nimport useTouchSensor from \"./sensors/use-touch-sensor\";\nimport useValidateSensorHooks from \"./use-validate-sensor-hooks\";\nimport isEventInInteractiveElement from \"./is-event-in-interactive-element\";\nimport getBorderBoxCenterPosition from \"../get-border-box-center-position\";\nimport { warning } from \"../../dev-warning\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport { noop } from \"../../empty\";\nimport findClosestDraggableIdFromEvent from \"./find-closest-draggable-id-from-event\";\nimport findDraggable from \"../get-elements/find-draggable\";\nimport bindEvents from \"../event-bindings/bind-events\";\nimport { isDragging } from \"../../state/reducer\";\n\nfunction preventDefault(event: Event) {\n event.preventDefault();\n}\n\ntype LockPhase = \"PRE_DRAG\" | \"DRAGGING\" | \"COMPLETED\";\n\n// Exact\ntype IsActiveArgs = {\n expected: LockPhase,\n phase: LockPhase,\n isLockActive: () => boolean,\n shouldWarn: boolean,\n};\n\nfunction isActive({\n expected,\n phase,\n isLockActive,\n shouldWarn,\n}: IsActiveArgs): boolean {\n // lock is no longer active\n if (!isLockActive()) {\n if (shouldWarn) {\n warning(`\n Cannot perform action.\n The sensor no longer has an action lock.\n\n Tips:\n\n - Throw away your action handlers when forceStop() is called\n - Check actions.isActive() if you really need to\n `);\n }\n return false;\n }\n // wrong phase\n if (expected !== phase) {\n if (shouldWarn) {\n warning(`\n Cannot perform action.\n The actions you used belong to an outdated phase\n\n Current phase: ${expected}\n You called an action from outdated phase: ${phase}\n\n Tips:\n\n - Do not use preDragActions actions after calling preDragActions.lift()\n `);\n }\n return false;\n }\n return true;\n}\n\n// Exact\ntype CanStartArgs = {\n lockAPI: LockAPI,\n registry: Registry,\n store: Store,\n draggableId: DraggableId,\n};\n\nfunction canStart({\n lockAPI,\n store,\n registry,\n draggableId,\n}: CanStartArgs): boolean {\n // lock is already claimed - cannot start\n if (lockAPI.isClaimed()) {\n return false;\n }\n\n const entry: DraggableEntry | null = registry.draggable.findById(draggableId);\n\n if (!entry) {\n warning(`Unable to find draggable with id: ${draggableId}`);\n return false;\n }\n\n // draggable is not enabled - cannot start\n if (!entry.options.isEnabled) {\n return false;\n }\n\n // Application might now allow dragging right now\n if (!canStartDrag(store.getState(), draggableId)) {\n return false;\n }\n\n return true;\n}\n\n// Exact\ntype TryStartArgs = {\n lockAPI: LockAPI,\n contextId: ContextId,\n registry: Registry,\n store: Store,\n draggableId: DraggableId,\n forceSensorStop?: () => void,\n sourceEvent: Event | null,\n};\n\nfunction tryStart({\n lockAPI,\n contextId,\n store,\n registry,\n draggableId,\n forceSensorStop,\n sourceEvent,\n}: TryStartArgs): PreDragActions | null {\n const shouldStart: boolean = canStart({\n lockAPI,\n store,\n registry,\n draggableId,\n });\n\n if (!shouldStart) {\n return null;\n }\n\n const entry: DraggableEntry = registry.draggable.getById(draggableId);\n const el: HTMLElement | null = findDraggable(contextId, entry.descriptor.id);\n\n if (!el) {\n warning(`Unable to find draggable element with id: ${draggableId}`);\n return null;\n }\n\n // Do not allow dragging from interactive elements\n if (\n sourceEvent &&\n !entry.options.canDragInteractiveElements &&\n isEventInInteractiveElement(el, sourceEvent)\n ) {\n return null;\n }\n\n // claiming lock\n const lock: Lock = lockAPI.claim(forceSensorStop || noop);\n let phase: LockPhase = \"PRE_DRAG\";\n\n function getShouldRespectForcePress(): boolean {\n // not looking up the entry as it might have been removed in a virtual list\n return entry.options.shouldRespectForcePress;\n }\n\n function isLockActive(): boolean {\n return lockAPI.isActive(lock);\n }\n\n function tryDispatch(expected: LockPhase, getAction: () => Action): void {\n if (isActive({ expected, phase, isLockActive, shouldWarn: true })) {\n store.dispatch(getAction());\n }\n }\n\n const tryDispatchWhenDragging = tryDispatch.bind(null, \"DRAGGING\");\n\n // Exact\n type LiftArgs = {\n liftActionArgs: LiftActionArgs,\n cleanup: () => void,\n actions: Object,\n };\n\n function lift(args: LiftArgs) {\n function completed() {\n lockAPI.release();\n phase = \"COMPLETED\";\n }\n // Double lift = bad\n if (phase !== \"PRE_DRAG\") {\n completed();\n // invariant(phase === \"PRE_DRAG\", `Cannot lift in phase ${phase}`);\n }\n\n store.dispatch(liftAction(args.liftActionArgs));\n\n // We are now in the DRAGGING phase\n phase = \"DRAGGING\";\n\n function finish(\n reason: \"CANCEL\" | \"DROP\",\n options: StopDragOptions = { shouldBlockNextClick: false },\n ) {\n args.cleanup();\n\n // block next click if requested\n if (options.shouldBlockNextClick) {\n const unbind = bindEvents(window, [\n {\n eventName: \"click\",\n fn: preventDefault,\n options: {\n // only blocking a single click\n once: true,\n passive: false,\n capture: true,\n },\n },\n ], {});\n // Sometimes the click is swallowed, such as when there is reparenting\n // The click event (in the message queue) will occur before the next setTimeout expiry\n // https://codesandbox.io/s/click-behaviour-pkfk2\n setTimeout(unbind);\n }\n\n // releasing\n completed();\n store.dispatch(dropAction({ reason }));\n }\n\n return {\n isActive: () =>\n isActive({\n expected: \"DRAGGING\",\n phase,\n isLockActive,\n // Do not want to want warnings for boolean checks\n shouldWarn: false,\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n drop: (options?: StopDragOptions) => finish(\"DROP\", options),\n cancel: (options?: StopDragOptions) => finish(\"CANCEL\", options),\n ...args.actions,\n };\n }\n\n function fluidLift(clientSelection: Position): FluidDragActions {\n const move = rafSchd((client: Position) => {\n tryDispatchWhenDragging(() => moveAction({ client }));\n });\n\n const api = lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection,\n movementMode: \"FLUID\",\n },\n cleanup: () => move.cancel(),\n actions: { move },\n });\n\n return {\n ...api,\n move,\n };\n }\n\n function snapLift(): SnapDragActions {\n const actions = {\n moveUp: () => tryDispatchWhenDragging(moveUpAction),\n moveRight: () => tryDispatchWhenDragging(moveRightAction),\n moveDown: () => tryDispatchWhenDragging(moveDownAction),\n moveLeft: () => tryDispatchWhenDragging(moveLeftAction),\n };\n\n return lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection: getBorderBoxCenterPosition(el as HTMLElement),\n movementMode: \"SNAP\",\n },\n cleanup: noop,\n actions,\n });\n }\n\n function abortPreDrag() {\n const shouldRelease: boolean = isActive({\n expected: \"PRE_DRAG\",\n phase,\n isLockActive,\n shouldWarn: true,\n });\n\n if (shouldRelease) {\n lockAPI.release();\n }\n }\n\n const preDrag: PreDragActions = {\n isActive: () =>\n isActive({\n expected: \"PRE_DRAG\",\n phase,\n isLockActive,\n // Do not want to want warnings for boolean checks\n shouldWarn: false,\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n fluidLift,\n snapLift,\n abort: abortPreDrag,\n };\n\n return preDrag;\n}\n\n// Exact\ntype SensorMarshalArgs = {\n contextId: ContextId,\n registry: Registry,\n store: Store,\n customSensors?: (Sensor[]) | null,\n enableDefaultSensors: boolean,\n};\n\n// default sensors are now exported to library consumers\nconst defaultSensors: Sensor[] = [\n useMouseSensor,\n useKeyboardSensor,\n useTouchSensor,\n];\n\nexport default function useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors,\n enableDefaultSensors,\n}: SensorMarshalArgs) {\n const useSensors: Sensor[] = [\n ...(enableDefaultSensors ? defaultSensors : []),\n ...(customSensors || []),\n ];\n const lockAPI: LockAPI = useState(() => create())[0];\n\n const tryAbandonLock = useCallback(\n function tryAbandonLock(previous: State, current: State) {\n if (isDragging(previous) && !isDragging(current)) {\n lockAPI.tryAbandon();\n }\n // if (previous.isDragging && !current.isDragging) {\n // lockAPI.tryAbandon();\n // }\n },\n [lockAPI],\n );\n\n // We need to abort any capturing if there is no longer a drag\n useLayoutEffect(\n function listenToStore() {\n let previous: State = store.getState();\n const unsubscribe = store.subscribe(() => {\n const current: State = store.getState();\n tryAbandonLock(previous, current);\n previous = current;\n });\n\n // unsubscribe from store when unmounting\n return unsubscribe;\n },\n [lockAPI, store, tryAbandonLock],\n );\n\n // abort any lock on unmount\n useLayoutEffect(() => {\n return lockAPI.tryAbandon;\n }, [lockAPI.tryAbandon]);\n\n const canGetLock = useCallback(\n (draggableId: DraggableId): boolean => {\n return canStart({\n lockAPI,\n registry,\n store,\n draggableId,\n });\n },\n [lockAPI, registry, store],\n );\n\n const tryGetLock: TryGetLock = useCallback(\n (\n draggableId: DraggableId,\n forceStop?: () => void,\n options?: TryGetLockOptions,\n ): PreDragActions | null =>\n tryStart({\n lockAPI,\n registry,\n contextId,\n store,\n draggableId,\n forceSensorStop: forceStop,\n sourceEvent:\n options && options.sourceEvent ? options.sourceEvent : null,\n }),\n [contextId, lockAPI, registry, store],\n );\n\n const findClosestDraggableId = useCallback(\n (event: Event): DraggableId | null =>\n findClosestDraggableIdFromEvent(contextId, event),\n [contextId],\n );\n\n const findOptionsForDraggable = useCallback(\n (id: DraggableId): DraggableOptions | null => {\n const entry: DraggableEntry | null = registry.draggable.findById(id);\n return entry ? entry.options : null;\n },\n [registry.draggable],\n );\n\n const tryReleaseLock = useCallback(\n function tryReleaseLock() {\n if (!lockAPI.isClaimed()) {\n return;\n }\n\n lockAPI.tryAbandon();\n\n if (store.getState().phase !== \"IDLE\") {\n store.dispatch(flush());\n }\n },\n [lockAPI, store],\n );\n const isLockClaimed = useCallback(lockAPI.isClaimed, [lockAPI]);\n\n const api: SensorAPI = useMemo(\n () => ({\n canGetLock,\n tryGetLock,\n findClosestDraggableId,\n findOptionsForDraggable,\n tryReleaseLock,\n isLockClaimed,\n }),\n [\n canGetLock,\n tryGetLock,\n findClosestDraggableId,\n findOptionsForDraggable,\n tryReleaseLock,\n isLockClaimed,\n ],\n );\n\n // Bad ass\n useValidateSensorHooks(useSensors);\n for (let i = 0; i < useSensors.length; i++) {\n useSensors[i](api);\n }\n}\n","// @flow\nimport { useEffect, useRef, type ReactNode } from \"react\";\n// import { bindActionCreators } from \"redux\";\nimport { Provider } from \"react-redux\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { invariant } from \"../../invariant\";\nimport createStore from \"../../state/create-store\";\nimport createDimensionMarshal from \"../../state/dimension-marshal/dimension-marshal\";\nimport canStartDrag from \"../../state/can-start-drag\";\nimport scrollWindow from \"../window/scroll-window\";\nimport createAutoScroller from \"../../state/auto-scroller\";\nimport useStyleMarshal from \"../use-style-marshal/use-style-marshal\";\nimport useFocusMarshal from \"../use-focus-marshal\";\nimport useRegistry from \"../../state/registry/use-registry\";\nimport type { Registry } from \"../../state/registry/registry-types\";\nimport type { FocusMarshal } from \"../use-focus-marshal/focus-marshal-types\";\nimport type { AutoScroller } from \"../../state/auto-scroller/auto-scroller-types\";\nimport type { StyleMarshal } from \"../use-style-marshal/style-marshal-types\";\nimport type {\n DimensionMarshal,\n Callbacks as DimensionMarshalCallbacks,\n} from \"../../state/dimension-marshal/dimension-marshal-types\";\nimport type {\n DraggableId,\n State,\n Responders,\n Announce,\n Sensor,\n ElementId,\n} from \"../../types\";\nimport type { Store, Action } from \"../../state/store-types\";\nimport type { SetAppCallbacks, AppCallbacks } from \"./drag-drop-context-types\";\nimport StoreContext from \"../context/store-context\";\nimport {\n move,\n publishWhileDragging,\n updateDroppableScroll,\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n collectionStarting,\n flush,\n} from \"../../state/action-creators\";\nimport isMovementAllowed from \"../../state/is-movement-allowed\";\nimport useAnnouncer from \"../use-announcer\";\nimport useHiddenTextElement from \"../use-hidden-text-element\";\nimport AppContext, { type AppContextValue } from \"../context/app-context\";\nimport useStartupValidation from \"./use-startup-validation\";\nimport usePrevious from \"../use-previous-ref\";\nimport { warning } from \"../../dev-warning\";\nimport useSensorMarshal from \"../use-sensor-marshal/use-sensor-marshal\";\nimport { isDragging } from \"../../state/reducer\";\n\n// Exact\nexport type Props = Responders & {\n contextId: string,\n setCallbacks: SetAppCallbacks,\n nonce?: string,\n // we do not technically need any children for this component\n children: ReactNode,\n\n // sensors\n sensors?: Sensor[] | null,\n enableDefaultSensors?: boolean | null,\n\n // screen reader\n dragHandleUsageInstructions: string,\n};\n\nconst createResponders = (props: Props): Responders => ({\n onBeforeCapture: props.onBeforeCapture,\n onBeforeDragStart: props.onBeforeDragStart,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragUpdate: props.onDragUpdate,\n});\n\n// flow does not support MutableRefObject\n// type LazyStoreRef = MutableRefObject<?Store>;\ntype LazyStoreRef = { current: Store | null };\n\nfunction getStore(lazyRef: LazyStoreRef): Store {\n invariant(lazyRef.current, \"Could not find store from lazy ref\");\n return lazyRef.current;\n}\n\nexport default function App(props: Props) {\n const {\n contextId,\n setCallbacks,\n sensors,\n nonce,\n dragHandleUsageInstructions,\n } = props;\n const lazyStoreRef: LazyStoreRef = useRef<Store | null>(null);\n\n useStartupValidation();\n\n // lazy collection of responders using a ref - update on ever render\n const lastPropsRef = usePrevious<Props>(props);\n\n const getResponders: () => Responders = useCallback(() => {\n return createResponders(lastPropsRef.current);\n }, [lastPropsRef]);\n\n const announce: Announce = useAnnouncer(contextId);\n\n const dragHandleUsageInstructionsId: ElementId = useHiddenTextElement({\n contextId,\n text: dragHandleUsageInstructions,\n });\n const styleMarshal: StyleMarshal = useStyleMarshal(contextId, nonce);\n\n // const lazyDispatch: (arg: Action) => void = useCallback((action: Action): void => {\n // getStore(lazyStoreRef).dispatch(action);\n // }, []);\n\n // const marshalCallbacks: DimensionMarshalCallbacks = useMemo(\n // () =>\n // bindActionCreators(\n // {\n // publishWhileDragging,\n // updateDroppableScroll,\n // updateDroppableIsEnabled,\n // updateDroppableIsCombineEnabled,\n // collectionStarting,\n // },\n // // $FlowFixMe - not sure why this is wrong\n // lazyDispatch as LazyDispatch, // Changed to LazyDispatch but can have error to fix\n // ),\n // [lazyDispatch],\n // );\n\n const lazyDispatch = useCallback(\n (action: Action) => getStore(lazyStoreRef).dispatch(action),\n [],\n );\n\n const marshalCallbacks: DimensionMarshalCallbacks = useMemo(\n () => ({\n publishWhileDragging: (...args) =>\n lazyDispatch(publishWhileDragging(...args)),\n\n updateDroppableScroll: (...args) =>\n lazyDispatch(updateDroppableScroll(...args)),\n\n updateDroppableIsEnabled: (...args) =>\n lazyDispatch(updateDroppableIsEnabled(...args)),\n\n updateDroppableIsCombineEnabled: (...args) =>\n lazyDispatch(updateDroppableIsCombineEnabled(...args)),\n\n collectionStarting: (...args) =>\n lazyDispatch(collectionStarting(...args)),\n }),\n [lazyDispatch],\n );\n\n const registry: Registry = useRegistry();\n\n const dimensionMarshal: DimensionMarshal = useMemo<DimensionMarshal>(() => {\n return createDimensionMarshal(registry, marshalCallbacks);\n }, [registry, marshalCallbacks]);\n\n // const autoScroller: AutoScroller = useMemo<AutoScroller>(\n // () =>\n // createAutoScroller({\n // scrollWindow,\n // scrollDroppable: dimensionMarshal.scrollDroppable,\n // ...bindActionCreators(\n // {\n // move,\n // },\n // // $FlowFixMe - not sure why this is wrong\n // lazyDispatch,\n // ),\n // }),\n // [dimensionMarshal.scrollDroppable, lazyDispatch],\n // );\n\n const autoScroller: AutoScroller = useMemo(\n () =>\n createAutoScroller({\n scrollWindow,\n scrollDroppable: dimensionMarshal.scrollDroppable,\n move: (...args) => lazyDispatch(move(...args)),\n }),\n [dimensionMarshal.scrollDroppable, lazyDispatch, scrollWindow, move],\n );\n\n const focusMarshal: FocusMarshal = useFocusMarshal(contextId);\n\n const store: Store = useMemo<Store>(\n () =>\n createStore({\n announce,\n autoScroller,\n dimensionMarshal,\n focusMarshal,\n getResponders,\n styleMarshal,\n }),\n [\n announce,\n autoScroller,\n dimensionMarshal,\n focusMarshal,\n getResponders,\n styleMarshal,\n ],\n );\n\n // Checking for unexpected store changes\n if (process.env.NODE_ENV !== \"production\") {\n if (lazyStoreRef.current && lazyStoreRef.current !== store) {\n warning(\"unexpected store change\");\n }\n }\n\n // assigning lazy store ref\n lazyStoreRef.current = store;\n\n const tryResetStore = useCallback(() => {\n const current: Store = getStore(lazyStoreRef);\n const state: State = current.getState();\n if (state.phase !== \"IDLE\") {\n current.dispatch(flush());\n }\n }, []);\n\n // Added Check for isDragging\n const isDraggingState = useCallback((): boolean => {\n const state: State = getStore(lazyStoreRef).getState();\n return isDragging(state) || state.phase === \"DROP_ANIMATING\";\n }, []);\n\n const appCallbacks: AppCallbacks = useMemo(\n () => ({\n isDragging: isDraggingState,\n tryAbort: tryResetStore,\n }),\n [isDraggingState, tryResetStore],\n );\n\n // doing this in render rather than a side effect so any errors on the\n // initial mount are caught\n setCallbacks(appCallbacks);\n\n const getCanLift = useCallback(\n (id: DraggableId) => canStartDrag(getStore(lazyStoreRef).getState(), id),\n [],\n );\n\n const getIsMovementAllowed = useCallback(\n () => isMovementAllowed(getStore(lazyStoreRef).getState()),\n [],\n );\n\n const appContext: AppContextValue = useMemo(\n () => ({\n marshal: dimensionMarshal,\n focus: focusMarshal,\n contextId,\n canLift: getCanLift,\n isMovementAllowed: getIsMovementAllowed,\n dragHandleUsageInstructionsId,\n registry,\n }),\n [\n contextId,\n dimensionMarshal,\n dragHandleUsageInstructionsId,\n focusMarshal,\n getCanLift,\n getIsMovementAllowed,\n registry,\n ],\n );\n\n useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors: sensors,\n // default to 'true' unless 'false' is explicitly passed\n enableDefaultSensors: props.enableDefaultSensors !== false,\n });\n\n // Clean store when unmounting\n useEffect(() => {\n return tryResetStore;\n }, [tryResetStore]);\n\n return (\n <AppContext.Provider value={appContext}>\n <Provider context={StoreContext} store={store}>\n {props.children}\n </Provider>\n </AppContext.Provider>\n );\n}\n","// @flow\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { ContextId } from \"../../types\";\n\nlet count = 0;\n\nexport function reset() {\n count = 0;\n}\n\nexport default function useInstanceCount(): ContextId {\n return useMemo(() => `${count++}`, []);\n}\n","// @flow\nimport { type ReactNode } from 'react';\nimport type { Responders, ContextId, Sensor } from '../../types';\nimport ErrorBoundary from './error-boundary';\nimport preset from '../../screen-reader-message-preset';\nimport App from './app';\nimport useUniqueContextId, {\n reset as resetContextId,\n} from './use-unique-context-id';\nimport { reset as resetUniqueIds } from '../use-unique-id';\n\n// Exact\ntype Props = Responders & {\n // We do not technically need any children for this component\n children: ReactNode,\n // Read out by screen readers when focusing on a drag handle\n dragHandleUsageInstructions?: string,\n // Used for strict content security policies\n // See our [content security policy guide](/docs/guides/content-security-policy.md)\n nonce?: string,\n // See our [sensor api](/docs/sensors/sensor-api.md)\n sensors?: Sensor[],\n enableDefaultSensors?: boolean | null,\n};\n\n// Reset any context that gets persisted across server side renders\nexport function resetServerContext() {\n resetContextId();\n resetUniqueIds();\n}\n\nexport default function DragDropContext(props: Props) {\n const contextId: ContextId = useUniqueContextId();\n const dragHandleUsageInstructions: string =\n props.dragHandleUsageInstructions || preset.dragHandleUsageInstructions;\n\n // We need the error boundary to be on the outside of App\n // so that it can catch any errors caused by App\n return (\n <ErrorBoundary>\n {(setCallbacks: any) => (\n <App\n nonce={props.nonce}\n contextId={contextId}\n setCallbacks={setCallbacks}\n dragHandleUsageInstructions={dragHandleUsageInstructions}\n enableDefaultSensors={props.enableDefaultSensors}\n sensors={props.sensors}\n onBeforeCapture={props.onBeforeCapture}\n onBeforeDragStart={props.onBeforeDragStart}\n onDragStart={props.onDragStart}\n onDragUpdate={props.onDragUpdate}\n onDragEnd={props.onDragEnd}\n >\n {props.children}\n </App>\n )}\n </ErrorBoundary>\n );\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport { warning } from '../../dev-warning';\nimport getBodyElement from '../get-body-element';\n\n// Exact\ntype Overflow = {\n overflowX: string,\n overflowY: string,\n};\n\nconst isEqual = (base: string) => (value: string): boolean => base === value;\nconst isScroll = isEqual('scroll');\nconst isAuto = isEqual('auto');\nconst isVisible = isEqual('visible');\nconst isEither = (overflow: Overflow, fn: (value: string) => boolean) =>\n fn(overflow.overflowX) || fn(overflow.overflowY);\nconst isBoth = (overflow: Overflow, fn: (value: string) => boolean) =>\n fn(overflow.overflowX) && fn(overflow.overflowY);\n\nconst isElementScrollable = (el: Element): boolean => {\n const style: CSSStyleDeclaration = window.getComputedStyle(el);\n const overflow: Overflow = {\n overflowX: style.overflowX,\n overflowY: style.overflowY,\n };\n\n return isEither(overflow, isScroll) || isEither(overflow, isAuto);\n};\n\n// Special case for a body element\n// Playground: https://codepen.io/alexreardon/pen/ZmyLgX?editors=1111\nconst isBodyScrollable = (): boolean => {\n // Because we always return false for now, we can skip any actual processing in production\n if (process.env.NODE_ENV === 'production') {\n return false;\n }\n\n const body: HTMLElement = getBodyElement(); // HTMLBodyElement\n const html: HTMLElement | null = document.documentElement;\n invariant(html);\n\n // 1. The `body` has `overflow-[x|y]: auto | scroll`\n if (!isElementScrollable(body)) {\n return false;\n }\n\n const htmlStyle: CSSStyleDeclaration = window.getComputedStyle(html);\n const htmlOverflow: Overflow = {\n overflowX: htmlStyle.overflowX,\n overflowY: htmlStyle.overflowY,\n };\n\n if (isBoth(htmlOverflow, isVisible)) {\n return false;\n }\n\n warning(`\n We have detected that your <body> element might be a scroll container.\n We have found no reliable way of detecting whether the <body> element is a scroll container.\n Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)\n\n Because we cannot determine if the <body> is a scroll container, and generally it is not one,\n we will be treating the <body> as *not* a scroll container\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/how-we-detect-scroll-containers.md\n `);\n return false;\n};\n\nconst getClosestScrollable = (el: Element | null): Element | null => {\n // cannot do anything else!\n if (el == null) {\n return null;\n }\n\n // not allowing us to go higher then body\n if (el === document.body) {\n return isBodyScrollable() ? el : null;\n }\n\n // Should never get here, but just being safe\n if (el === document.documentElement) {\n return null;\n }\n\n if (!isElementScrollable(el)) {\n // keep recursing\n return getClosestScrollable(el.parentElement);\n }\n\n // success!\n return el;\n};\n\nexport default getClosestScrollable;\n","// @flow\nimport getClosestScrollable from './get-closest-scrollable';\nimport { warning } from '../../dev-warning';\n\n// We currently do not support nested scroll containers\n// But will hopefully support this soon!\nexport default (scrollable: Element | null) => {\n if (!scrollable) {\n return;\n }\n\n const anotherScrollParent: Element | null = getClosestScrollable(\n scrollable.parentElement,\n );\n\n if (!anotherScrollParent) {\n return;\n }\n\n warning(`\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n `);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\n\nexport default (el: Element): Position => ({\n x: el.scrollLeft,\n y: el.scrollTop,\n});\n","// @flow\nimport getClosestScrollable from './get-closest-scrollable';\n\n// Exact\nexport type Env = {\n closestScrollable: Element | null,\n isFixedOnPage: boolean,\n};\n\n// TODO: do this check at the same time as the closest scrollable\n// in order to avoid double calling getComputedStyle\n// Do this when we move to multiple scroll containers\nconst getIsFixed = (el: Element | null): boolean => {\n if (!el) {\n return false;\n }\n const style: CSSStyleDeclaration = window.getComputedStyle(el);\n if (style.position === 'fixed') {\n return true;\n }\n return getIsFixed(el.parentElement);\n};\n\nexport default (start: Element): Env => {\n const closestScrollable: Element | null = getClosestScrollable(start);\n const isFixedOnPage: boolean = getIsFixed(start);\n\n return {\n closestScrollable,\n isFixedOnPage,\n };\n};\n","// @flow\nimport { type BoxModel, type Position } from 'css-box-model';\nimport type {\n Axis,\n DroppableDimension,\n DroppableDescriptor,\n Scrollable,\n DroppableSubject,\n ScrollSize,\n} from '../../types';\nimport { vertical, horizontal } from '../axis';\nimport { origin } from '../position';\nimport getMaxScroll from '../get-max-scroll';\nimport getSubject from './util/get-subject';\n\n// Exact\nexport type Closest = {\n client: BoxModel,\n page: BoxModel,\n scroll: Position,\n scrollSize: ScrollSize,\n shouldClipSubject: boolean,\n};\n\n// Exact\ntype Args = {\n descriptor: DroppableDescriptor,\n isEnabled: boolean,\n isCombineEnabled?: boolean,\n isFixedOnPage: boolean,\n direction?: 'vertical' | 'horizontal',\n client: BoxModel,\n // is null when in a fixed container\n page: BoxModel,\n closest?: Closest | null,\n};\n\nexport default ({\n descriptor,\n isEnabled,\n isCombineEnabled,\n isFixedOnPage,\n direction,\n client,\n page,\n closest,\n}: Args): DroppableDimension => {\n const frame: Scrollable | null = (() => {\n if (!closest) {\n return null;\n }\n\n const { scrollSize, client: frameClient } = closest;\n\n // scrollHeight and scrollWidth are based on the padding box\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight\n const maxScroll: Position = getMaxScroll({\n scrollHeight: scrollSize.scrollHeight,\n scrollWidth: scrollSize.scrollWidth,\n height: frameClient.paddingBox.height,\n width: frameClient.paddingBox.width,\n });\n\n return {\n pageMarginBox: closest.page.marginBox,\n frameClient,\n scrollSize,\n shouldClipSubject: closest.shouldClipSubject,\n scroll: {\n initial: closest.scroll,\n current: closest.scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin,\n },\n },\n };\n })();\n\n const axis: Axis = direction === 'vertical' ? vertical : horizontal;\n\n const subject: DroppableSubject = getSubject({\n page,\n withPlaceholder: null,\n axis,\n frame,\n });\n\n const dimension: DroppableDimension = {\n descriptor,\n isCombineEnabled,\n isFixedOnPage,\n axis,\n isEnabled,\n client,\n page,\n frame,\n subject,\n };\n\n return dimension;\n};\n","// @flow\nimport {\n getBox,\n withScroll,\n createBox,\n expand,\n type BoxModel,\n type Position,\n type Spacing,\n} from 'css-box-model';\nimport getDroppableDimension, {\n type Closest,\n} from '../../state/droppable/get-droppable';\nimport type { Env } from './get-env';\nimport type {\n DroppableDimension,\n DroppableDescriptor,\n Direction,\n ScrollSize,\n} from '../../types';\nimport getScroll from './get-scroll';\n\nconst getClient = (\n targetRef: HTMLElement,\n closestScrollable: Element | null,\n): BoxModel => {\n const base: BoxModel = getBox(targetRef);\n\n // Droppable has no scroll parent\n if (!closestScrollable) {\n return base;\n }\n\n // Droppable is not the same as the closest scrollable\n if (targetRef !== closestScrollable) {\n return base;\n }\n\n // Droppable is scrollable\n\n // Element.getBoundingClient() returns a clipped padding box:\n // When not scrollable: the full size of the element\n // When scrollable: the visible size of the element\n // (which is not the full width of its scrollable content)\n // So we recalculate the borderBox of a scrollable droppable to give\n // it its full dimensions. This will be cut to the correct size by the frame\n\n // Creating the paddingBox based on scrollWidth / scrollTop\n // scrollWidth / scrollHeight are based on the paddingBox of an element\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight\n const top: number = base.paddingBox.top - closestScrollable.scrollTop;\n const left: number = base.paddingBox.left - closestScrollable.scrollLeft;\n const bottom: number = top + closestScrollable.scrollHeight;\n const right: number = left + closestScrollable.scrollWidth;\n\n // unclipped padding box\n const paddingBox: Spacing = {\n top,\n right,\n bottom,\n left,\n };\n\n // Creating the borderBox by adding the borders to the paddingBox\n const borderBox: Spacing = expand(paddingBox, base.border);\n\n // We are not accounting for scrollbars\n // Adjusting for scrollbars is hard because:\n // - they are different between browsers\n // - scrollbars can be activated and removed during a drag\n // We instead account for this slightly in our auto scroller\n\n const client: BoxModel = createBox({\n borderBox,\n margin: base.margin,\n border: base.border,\n padding: base.padding,\n });\n return client;\n};\n\n// Exact\ntype Args = {\n ref: HTMLElement,\n descriptor: DroppableDescriptor,\n env: Env,\n windowScroll: Position,\n direction?: Direction,\n isDropDisabled?: boolean,\n isCombineEnabled?: boolean,\n shouldClipSubject: boolean,\n};\n\nexport default ({\n ref,\n descriptor,\n env,\n windowScroll,\n direction,\n isDropDisabled,\n isCombineEnabled,\n shouldClipSubject,\n}: Args): DroppableDimension => {\n const closestScrollable: Element | null = env.closestScrollable;\n const client: BoxModel = getClient(ref, closestScrollable);\n const page: BoxModel = withScroll(client, windowScroll);\n\n const closest: Closest | null = (() => {\n if (!closestScrollable) {\n return null;\n }\n\n const frameClient: BoxModel = getBox(closestScrollable);\n const scrollSize: ScrollSize = {\n scrollHeight: closestScrollable.scrollHeight,\n scrollWidth: closestScrollable.scrollWidth,\n };\n\n return {\n client: frameClient,\n page: withScroll(frameClient, windowScroll),\n scroll: getScroll(closestScrollable),\n scrollSize,\n shouldClipSubject,\n };\n })();\n\n const dimension: DroppableDimension = getDroppableDimension({\n descriptor,\n isEnabled: !isDropDisabled,\n isCombineEnabled,\n isFixedOnPage: env.isFixedOnPage,\n direction,\n client,\n page,\n closest,\n });\n\n return dimension;\n};\n","// @flow\nimport type { ScrollOptions } from '../../types';\n\nconst immediate = {\n passive: false,\n};\nconst delayed = {\n passive: true,\n};\n\nexport default (options: ScrollOptions) =>\n options.shouldPublishImmediately ? immediate : delayed;\n","// @flow\n// import { useContext, type Context as ContextType } from 'react';\n// import { invariant } from '../invariant';\n\n// export default function useRequiredContext<T>(Context: ContextType<?T>): T {\n// const result: ?T = useContext(Context);\n// invariant(result, 'Could not find required context');\n// return result;\n// }\n\nimport { useContext, type Context } from 'react';\nimport { invariant } from '../invariant';\n\nexport default function useRequiredContext<T>(\n Context: Context<T | null>,\n): T { // Removed Null\n const result: T | null = useContext(Context);\n\n invariant(result, 'Could not find required context');\n\n return result;\n}","// @flow\nimport { useRef } from \"react\";\nimport { type Position } from \"css-box-model\";\nimport rafSchedule from \"raf-schd\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport memoizeOne from \"memoize-one\";\nimport { invariant } from \"../../invariant\";\nimport checkForNestedScrollContainers from \"./check-for-nested-scroll-container\";\nimport * as dataAttr from \"../data-attributes\";\nimport { origin } from \"../../state/position\";\nimport getScroll from \"./get-scroll\";\nimport type {\n DroppableEntry,\n DroppableCallbacks,\n} from \"../../state/registry/registry-types\";\nimport getEnv, { type Env } from \"./get-env\";\nimport type {\n Id,\n DroppableId,\n TypeId,\n DroppableDimension,\n DroppableDescriptor,\n Direction,\n ScrollOptions,\n DroppableMode,\n} from \"../../types\";\nimport getDimension from \"./get-dimension\";\nimport AppContext, { type AppContextValue } from \"../context/app-context\";\nimport { warning } from \"../../dev-warning\";\nimport getListenerOptions from \"./get-listener-options\";\nimport useRequiredContext from \"../use-required-context\";\nimport usePreviousRef from \"../use-previous-ref\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport useUniqueId from \"../use-unique-id\";\n\n// Exact\ntype Props = {\n droppableId: DroppableId,\n type?: TypeId,\n mode?: DroppableMode,\n direction?: Direction,\n isDropDisabled?: boolean,\n isCombineEnabled?: boolean,\n ignoreContainerClipping?: boolean,\n getDroppableRef?: () => HTMLElement | null,\n};\n\n// Exact\ntype WhileDragging = {\n ref: HTMLElement,\n descriptor: DroppableDescriptor,\n env: Env,\n scrollOptions: ScrollOptions,\n};\n\nconst getClosestScrollableFromDrag = (dragging: WhileDragging | null): Element | null =>\n (dragging && dragging.env.closestScrollable) || null;\n\nexport default function useDroppablePublisher(args: Props) {\n const whileDraggingRef = useRef<WhileDragging | null>(null);\n const appContext: AppContextValue = useRequiredContext(AppContext);\n const uniqueId: Id = useUniqueId(\"droppable\");\n const { registry, marshal } = appContext;\n const previousRef = usePreviousRef(args);\n\n const descriptor = useMemo<DroppableDescriptor>(\n () => ({\n id: args.droppableId,\n type: args.type ?? \"\",\n mode: args.mode ?? \"standard\", // By default\n }),\n [args.droppableId, args.mode, args.type],\n );\n const publishedDescriptorRef = useRef<DroppableDescriptor>(descriptor);\n\n const memoizedUpdateScroll = useMemo(\n () =>\n memoizeOne((x: number, y: number) => {\n invariant(\n whileDraggingRef.current,\n \"Can only update scroll when dragging\",\n );\n const scroll: Position = { x, y };\n marshal.updateDroppableScroll(descriptor.id, scroll);\n }),\n [descriptor.id, marshal],\n );\n\n const getClosestScroll = useCallback((): Position => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n if (!dragging || !dragging.env.closestScrollable) {\n return origin;\n }\n\n return getScroll(dragging.env.closestScrollable);\n }, []);\n\n const updateScroll = useCallback(() => {\n // reading scroll value when called so value will be the latest\n const scroll: Position = getClosestScroll();\n memoizedUpdateScroll(scroll.x, scroll.y);\n }, [getClosestScroll, memoizedUpdateScroll]);\n\n const scheduleScrollUpdate = useMemo(\n () => rafSchedule(updateScroll),\n [updateScroll],\n );\n\n const onClosestScroll = useCallback(() => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n\n invariant(\n dragging && closest,\n \"Could not find scroll options while scrolling\",\n );\n const options: ScrollOptions = dragging.scrollOptions;\n if (options.shouldPublishImmediately) {\n updateScroll();\n return;\n }\n scheduleScrollUpdate();\n }, [scheduleScrollUpdate, updateScroll]);\n\n const getDimensionAndWatchScroll = useCallback(\n (windowScroll: Position, options: ScrollOptions) => {\n invariant(\n !whileDraggingRef.current,\n \"Cannot collect a droppable while a drag is occurring\",\n );\n const previous: Props = previousRef.current;\n const ref: HTMLElement | null = previous.getDroppableRef ? previous.getDroppableRef() : null;\n invariant(ref, \"Cannot collect without a droppable ref\");\n const env: Env = getEnv(ref);\n\n const dragging: WhileDragging = {\n ref,\n descriptor,\n env,\n scrollOptions: options,\n };\n // side effect\n whileDraggingRef.current = dragging;\n\n const dimension: DroppableDimension = getDimension({\n ref,\n descriptor,\n env,\n windowScroll,\n direction: previous.direction,\n isDropDisabled: previous.isDropDisabled,\n isCombineEnabled: previous.isCombineEnabled,\n shouldClipSubject: !previous.ignoreContainerClipping,\n });\n\n const scrollable: Element | null = env.closestScrollable;\n\n if (scrollable) {\n scrollable.setAttribute(\n dataAttr.scrollContainer.contextId,\n appContext.contextId,\n );\n\n // bind scroll listener\n scrollable.addEventListener(\n \"scroll\",\n onClosestScroll,\n getListenerOptions(dragging.scrollOptions),\n );\n // print a debug warning if using an unsupported nested scroll container setup\n if (process.env.NODE_ENV !== \"production\") {\n checkForNestedScrollContainers(scrollable);\n }\n }\n\n return dimension;\n },\n [appContext.contextId, descriptor, onClosestScroll, previousRef],\n );\n\n const getScrollWhileDragging = useCallback((): Position => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n invariant(\n dragging && closest,\n \"Can only recollect Droppable client for Droppables that have a scroll container\",\n );\n\n return getScroll(closest);\n }, []);\n\n const dragStopped = useCallback(() => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n invariant(dragging, \"Cannot stop drag when no active drag\");\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n\n // goodbye old friend\n whileDraggingRef.current = null;\n\n if (!closest) {\n return;\n }\n\n // unwatch scroll\n scheduleScrollUpdate.cancel();\n closest.removeAttribute(dataAttr.scrollContainer.contextId);\n const listenerOptions: AddEventListenerOptions = \n getListenerOptions(dragging.scrollOptions);\n closest.removeEventListener(\n \"scroll\",\n onClosestScroll,\n listenerOptions,\n );\n }, [onClosestScroll, scheduleScrollUpdate]);\n\n const scroll = useCallback((change: Position) => {\n // arrange\n const dragging: WhileDragging | null = whileDraggingRef.current;\n invariant(dragging, \"Cannot scroll when there is no drag\");\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n invariant(closest, \"Cannot scroll a droppable with no closest scrollable\");\n\n // act\n closest.scrollTop += change.y;\n closest.scrollLeft += change.x;\n }, []);\n\n const callbacks: DroppableCallbacks = useMemo(() => {\n return {\n getDimensionAndWatchScroll,\n getScrollWhileDragging,\n dragStopped,\n scroll,\n };\n }, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);\n\n const entry: DroppableEntry = useMemo(\n () => ({\n uniqueId,\n descriptor,\n callbacks,\n }),\n [callbacks, descriptor, uniqueId],\n );\n\n // Register with the marshal and let it know of:\n // - any descriptor changes\n // - when it unmounts\n useLayoutEffect(() => {\n publishedDescriptorRef.current = entry.descriptor;\n registry.droppable.register(entry);\n\n return () => {\n if (whileDraggingRef.current) {\n warning(\n \"Unsupported: changing the droppableId or type of a Droppable during a drag\",\n );\n dragStopped();\n }\n\n registry.droppable.unregister(entry);\n };\n }, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);\n\n // update is enabled with the marshal\n // only need to update when there is a drag\n useLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsEnabled(\n publishedDescriptorRef.current.id,\n !args.isDropDisabled,\n );\n }, [args.isDropDisabled, marshal]);\n\n // update is combine enabled with the marshal\n // only need to update when there is a drag\n useLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsCombineEnabled(\n publishedDescriptorRef.current.id,\n args.isCombineEnabled ?? false, // by default\n );\n }, [args.isCombineEnabled, marshal]);\n}\n","// @flow\nimport React, { useState, useRef, useEffect, type ReactNode } from \"react\";\nimport { useCallback } from \"@helpdice/memoizer\";\nimport type { Spacing } from \"css-box-model\";\nimport type {\n Placeholder as PlaceholderType,\n InOutAnimationMode,\n ContextId,\n TimeoutID,\n} from \"../../types\";\nimport { transitions } from \"../../animation\";\nimport { noSpacing } from \"../../state/spacing\";\n\nfunction noop() {}\n\n// Exact\nexport type PlaceholderStyle = {\n display: string,\n boxSizing: \"border-box\",\n width: number,\n height: number,\n marginTop: number,\n marginRight: number,\n marginBottom: number,\n marginLeft: number,\n flexShrink: \"0\",\n flexGrow: \"0\",\n pointerEvents: \"none\",\n transition: string | null,\n};\n\n// Exact\nexport type Props = {\n placeholder: PlaceholderType,\n animate: InOutAnimationMode,\n onClose: () => void,\n innerRef: (value: HTMLElement | null) => void,\n onTransitionEnd: () => void,\n contextId: ContextId,\n};\n\n// Exact\ntype Size = {\n width: number,\n height: number,\n // Need to animate in/out animation as well as size\n margin: Spacing,\n};\n\n// Exact\ntype HelperArgs = {\n isAnimatingOpenOnMount: boolean,\n placeholder: PlaceholderType,\n animate: InOutAnimationMode,\n};\n\nconst empty: Size = {\n width: 0,\n height: 0,\n margin: noSpacing,\n};\n\nconst getSize = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate,\n}: HelperArgs): Size => {\n if (isAnimatingOpenOnMount) {\n return empty;\n }\n\n if (animate === \"close\") {\n return empty;\n }\n\n return {\n height: placeholder.client.borderBox.height,\n width: placeholder.client.borderBox.width,\n margin: placeholder.client.margin,\n };\n};\n\nconst getStyle = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate,\n}: HelperArgs): PlaceholderStyle => {\n const size: Size = getSize({ isAnimatingOpenOnMount, placeholder, animate });\n\n return {\n display: placeholder.display,\n // ## Recreating the box model\n // We created the borderBox and then apply the margins directly\n // this is to maintain any margin collapsing behaviour\n\n // creating borderBox\n // background: 'green',\n boxSizing: \"border-box\",\n width: size.width,\n height: size.height,\n // creating marginBox\n marginTop: size.margin.top,\n marginRight: size.margin.right,\n marginBottom: size.margin.bottom,\n marginLeft: size.margin.left,\n\n // ## Avoiding collapsing\n // Avoiding the collapsing or growing of this element when pushed by flex child siblings.\n // We have already taken a snapshot the current dimensions we do not want this element\n // to recalculate its dimensions\n // It is okay for these properties to be applied on elements that are not flex children\n flexShrink: \"0\",\n flexGrow: \"0\",\n // Just a little performance optimisation: avoiding the browser needing\n // to worry about pointer events for this element\n pointerEvents: \"none\",\n\n // Animate the placeholder size and margin\n transition: animate !== \"none\" ? transitions.placeholder : null,\n };\n};\n\nfunction Placeholder(props: Props): ReactNode {\n const animateOpenTimerRef = useRef<TimeoutID | null>(null);\n\n const tryClearAnimateOpenTimer = useCallback(() => {\n if (!animateOpenTimerRef.current) {\n return;\n }\n clearTimeout(animateOpenTimerRef.current);\n animateOpenTimerRef.current = null;\n }, []);\n\n const { animate, onTransitionEnd, onClose, contextId } = props;\n const [isAnimatingOpenOnMount, setIsAnimatingOpenOnMount] = useState<boolean>(\n props.animate === \"open\",\n );\n\n // Will run after a render is flushed\n // Still need to wait a timeout to ensure that the\n // update is completely applied to the DOM\n useEffect(() => {\n // No need to do anything\n if (!isAnimatingOpenOnMount) {\n return noop;\n }\n\n // might need to clear the timer\n if (animate !== \"open\") {\n tryClearAnimateOpenTimer();\n setIsAnimatingOpenOnMount(false);\n return noop;\n }\n\n // timer already pending\n if (animateOpenTimerRef.current) {\n return noop;\n }\n\n animateOpenTimerRef.current = setTimeout(() => {\n animateOpenTimerRef.current = null;\n setIsAnimatingOpenOnMount(false);\n });\n\n // clear the timer if needed\n return tryClearAnimateOpenTimer;\n }, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);\n\n const onSizeChangeEnd = useCallback(\n (event: TransitionEvent) => {\n // We transition height, width and margin\n // each of those transitions will independently call this callback\n // Because they all have the same duration we can just respond to one of them\n // 'height' was chosen for no particular reason :D\n if (event.propertyName !== \"height\") {\n return;\n }\n\n onTransitionEnd();\n\n if (animate === \"close\") {\n onClose();\n }\n },\n [animate, onClose, onTransitionEnd],\n );\n\n const style: PlaceholderStyle = getStyle({\n isAnimatingOpenOnMount,\n animate: props.animate,\n placeholder: props.placeholder,\n });\n\n return React.createElement(props.placeholder.tagName, {\n style,\n \"data-rbd-placeholder-context-id\": contextId,\n onTransitionEnd: onSizeChangeEnd,\n ref: props.innerRef,\n });\n}\n\nexport default React.memo<Props>(Placeholder);\n// enzyme does not work well with memo, so exporting the non-memo version\nexport const WithoutMemo = Placeholder;\n","// @flow\nimport React from 'react';\nimport type { DraggableId, DroppableId, TypeId } from '../../types';\n\n// Exact\nexport type DroppableContextValue = {\n isUsingCloneFor?: DraggableId | null,\n droppableId: DroppableId,\n type?: TypeId,\n};\n\nexport default React.createContext<DroppableContextValue | null>(null);\n","// @flow\nimport { invariant } from '../invariant';\nimport isHtmlElement from './is-type-of-element/is-html-element';\n\nexport default function checkIsValidInnerRef(el: HTMLElement | null) {\n invariant(\n el && isHtmlElement(el),\n `\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md\n `,\n );\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { Props } from './droppable-types';\nimport { warning } from '../../dev-warning';\nimport checkIsValidInnerRef from '../check-is-valid-inner-ref';\nimport useDevSetupWarning from '../use-dev-setup-warning';\n\n// Exact\ntype Args = {\n props: Props,\n getDroppableRef: () => HTMLElement | null,\n getPlaceholderRef: () => HTMLElement | null,\n};\n\ntype CheckFn = (args: Args) => void;\n\nfunction isBoolean(value: unknown): boolean {\n return typeof value === 'boolean';\n}\n\nfunction runChecks(args: Args, checks: CheckFn[]) {\n checks.forEach((check: CheckFn) => check(args));\n}\n\nconst shared: CheckFn[] = [\n function required({ props }: Args) {\n invariant(props.droppableId, 'A Droppable requires a droppableId prop');\n invariant(\n typeof props.droppableId === 'string',\n `A Droppable requires a [string] droppableId. Provided: [${typeof props.droppableId}]`,\n );\n },\n function boolean({ props }: Args) {\n invariant(\n isBoolean(props.isDropDisabled),\n 'isDropDisabled must be a boolean',\n );\n invariant(\n isBoolean(props.isCombineEnabled),\n 'isCombineEnabled must be a boolean',\n );\n invariant(\n isBoolean(props.ignoreContainerClipping),\n 'ignoreContainerClipping must be a boolean',\n );\n },\n function ref({ getDroppableRef }: Args) {\n checkIsValidInnerRef(getDroppableRef());\n },\n];\n\nconst standard: CheckFn[] = [\n function placeholder({ props, getPlaceholderRef }: Args) {\n if (!props.placeholder) {\n return;\n }\n\n const ref: HTMLElement | null = getPlaceholderRef();\n\n if (ref) {\n return;\n }\n\n warning(`\n Droppable setup issue [droppableId: \"${props.droppableId}\"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/droppable.md\n `);\n },\n];\n\nconst virtual: CheckFn[] = [\n function hasClone({ props }: Args) {\n invariant(\n props.renderClone,\n 'Must provide a clone render function (renderClone) for virtual lists',\n );\n },\n function hasNoPlaceholder({ getPlaceholderRef }: Args) {\n invariant(\n !getPlaceholderRef(),\n 'Expected virtual list to not have a placeholder',\n );\n },\n];\n\nexport default function useValidation(args: Args) {\n useDevSetupWarning(() => {\n // wrapping entire block for better minification\n runChecks(args, shared);\n\n if (args.props.mode === 'standard') {\n runChecks(args, standard);\n }\n\n if (args.props.mode === 'virtual') {\n runChecks(args, virtual);\n }\n });\n}\n","// @flow\nimport React, { type ReactNode } from 'react';\nimport type { InOutAnimationMode } from '../../types';\n\n// Exact\nexport type AnimateProvided = {\n onClose: () => void,\n animate: InOutAnimationMode,\n data: unknown,\n};\n\n// Exact\ntype Props = {\n on: unknown,\n shouldAnimate: boolean,\n children: (provided: AnimateProvided) => ReactNode,\n};\n\n// Exact\ntype State = {\n data: unknown,\n isVisible: boolean,\n animate: InOutAnimationMode,\n};\n\n// Using a class here rather than hooks because\n// getDerivedStateFromProps results in far less renders.\n// Using hooks to implement this was quite messy and resulted in lots of additional renders\n\nexport default class AnimateInOut extends React.PureComponent<Props, State> {\n state: State = {\n isVisible: Boolean(this.props.on),\n data: this.props.on,\n // not allowing to animate close on mount\n animate: this.props.shouldAnimate && this.props.on ? 'open' : 'none',\n };\n\n static getDerivedStateFromProps(props: Props, state: State): State {\n if (!props.shouldAnimate) {\n return {\n isVisible: Boolean(props.on),\n data: props.on,\n animate: 'none',\n };\n }\n\n // need to animate in\n if (props.on) {\n return {\n isVisible: true,\n // have new data to animate in with\n data: props.on,\n animate: 'open',\n };\n }\n\n // need to animate out if there was data\n\n if (state.isVisible) {\n return {\n isVisible: true,\n // use old data for animating out\n data: state.data,\n animate: 'close',\n };\n }\n\n // close animation no longer visible\n return {\n isVisible: false,\n animate: 'close',\n data: null,\n };\n }\n\n onClose = () => {\n if (this.state.animate !== 'close') {\n return;\n }\n\n this.setState({\n isVisible: false,\n });\n };\n\n render() {\n if (!this.state.isVisible) {\n return null;\n }\n\n const provided: AnimateProvided = {\n onClose: this.onClose,\n data: this.state.data,\n animate: this.state.animate,\n };\n return this.props.children(provided);\n }\n}\n","// @flow\nimport type { BoxModel } from 'css-box-model';\nimport { combine, transforms, transitions } from '../../animation';\nimport type { DraggableDimension } from '../../types';\nimport type {\n DraggingStyle,\n NotDraggingStyle,\n ZIndexOptions,\n DropAnimation,\n SecondaryMapProps,\n DraggingMapProps,\n DraggableStyle,\n MappedProps,\n} from './draggable-types';\n\nexport const zIndexOptions: ZIndexOptions = {\n dragging: 5000,\n dropAnimating: 4500,\n};\n\nconst getDraggingTransition = (\n shouldAnimateDragMovement: boolean,\n dropping: DropAnimation | null,\n): string => {\n if (dropping) {\n return transitions.drop(dropping.duration);\n }\n if (shouldAnimateDragMovement) {\n return transitions.snap;\n }\n return transitions.fluid;\n};\n\nconst getDraggingOpacity = (\n isCombining: boolean,\n isDropAnimating: boolean,\n): number | null => {\n // if not combining: no not impact opacity\n if (!isCombining) {\n return null;\n }\n\n return isDropAnimating ? combine.opacity.drop : combine.opacity.combining;\n};\n\nconst getShouldDraggingAnimate = (dragging: DraggingMapProps): boolean => {\n if (dragging.forceShouldAnimate != null) {\n return dragging.forceShouldAnimate;\n }\n return dragging.mode === 'SNAP';\n};\n\nfunction getDraggingStyle(dragging: DraggingMapProps): DraggingStyle {\n const dimension: DraggableDimension = dragging.dimension;\n const box: BoxModel = dimension.client;\n const { offset, combineWith, dropping } = dragging;\n\n const isCombining: boolean = Boolean(combineWith);\n\n const shouldAnimate: boolean = getShouldDraggingAnimate(dragging);\n const isDropAnimating: boolean = Boolean(dropping);\n\n const transform: string | null = isDropAnimating\n ? transforms.drop(offset, isCombining)\n : transforms.moveTo(offset);\n\n const style: DraggingStyle = {\n // ## Placement\n position: 'fixed',\n // As we are applying the margins we need to align to the start of the marginBox\n top: box.marginBox.top,\n left: box.marginBox.left,\n\n // ## Sizing\n // Locking these down as pulling the node out of the DOM could cause it to change size\n boxSizing: 'border-box',\n width: box.borderBox.width,\n height: box.borderBox.height,\n\n // ## Movement\n // Opting out of the standard css transition for the dragging item\n transition: getDraggingTransition(shouldAnimate, dropping),\n transform,\n opacity: getDraggingOpacity(isCombining, isDropAnimating),\n // ## Layering\n zIndex: isDropAnimating\n ? zIndexOptions.dropAnimating\n : zIndexOptions.dragging,\n\n // ## Blocking any pointer events on the dragging or dropping item\n // global styles on cover while dragging\n pointerEvents: 'none',\n };\n return style;\n}\n\nfunction getSecondaryStyle(secondary: SecondaryMapProps): NotDraggingStyle {\n return {\n transform: transforms.moveTo(secondary.offset),\n // transition style is applied in the head\n transition: secondary.shouldAnimateDisplacement ? null : 'none',\n };\n}\n\nexport default function getStyle(mapped: MappedProps): DraggableStyle {\n return mapped.type === 'DRAGGING'\n ? getDraggingStyle(mapped)\n : getSecondaryStyle(mapped);\n}\n","// @flow\nimport {\n type BoxModel,\n type Position,\n calculateBox,\n withScroll,\n} from 'css-box-model';\nimport type {\n DraggableDescriptor,\n DraggableDimension,\n Placeholder,\n} from '../../types';\nimport { origin } from '../../state/position';\n\nexport default function getDimension(\n descriptor: DraggableDescriptor,\n el: HTMLElement,\n windowScroll: Position = origin,\n): DraggableDimension {\n const computedStyles: CSSStyleDeclaration = window.getComputedStyle(el);\n const borderBox: ClientRect = el.getBoundingClientRect();\n const client: BoxModel = calculateBox(borderBox, computedStyles);\n const page: BoxModel = withScroll(client, windowScroll);\n\n const placeholder: Placeholder = {\n client,\n tagName: el.tagName.toLowerCase(),\n display: computedStyles.display,\n };\n const displaceBy: Position = {\n x: client.marginBox.width,\n y: client.marginBox.height,\n };\n\n const dimension: DraggableDimension = {\n descriptor,\n placeholder,\n displaceBy,\n client,\n page,\n };\n\n return dimension;\n}\n","// @flow\nimport { type Position } from \"css-box-model\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { useRef } from \"react\";\nimport { invariant } from \"../../invariant\";\nimport type {\n DraggableDescriptor,\n DraggableDimension,\n Id,\n DraggableOptions,\n} from \"../../types\";\nimport type {\n Registry,\n DraggableEntry,\n} from \"../../state/registry/registry-types\";\nimport makeDimension from \"./get-dimension\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport useUniqueId from \"../use-unique-id\";\n\n// Exact\nexport type Args = {\n descriptor: DraggableDescriptor,\n getDraggableRef: () => HTMLElement | null,\n registry: Registry,\n} & DraggableOptions;\n\nexport default function useDraggablePublisher(args: Args) {\n const uniqueId: Id = useUniqueId(\"draggable\");\n\n const {\n descriptor,\n registry,\n getDraggableRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n } = args;\n\n const options: DraggableOptions = useMemo(\n () => ({\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n }),\n [canDragInteractiveElements, isEnabled, shouldRespectForcePress],\n );\n\n const getDimension = useCallback(\n (windowScroll?: Position): DraggableDimension => {\n const el: HTMLElement | null = getDraggableRef();\n invariant(el, \"Cannot get dimension when no ref is set\");\n return makeDimension(descriptor, el, windowScroll);\n },\n [descriptor, getDraggableRef],\n );\n\n const entry: DraggableEntry = useMemo(\n () => ({\n uniqueId,\n descriptor,\n options,\n getDimension,\n }),\n [descriptor, getDimension, options, uniqueId],\n );\n\n const publishedRef = useRef<DraggableEntry>(entry);\n const isFirstPublishRef = useRef<boolean>(true);\n\n // mounting and unmounting\n useLayoutEffect(() => {\n registry.draggable.register(publishedRef.current);\n return () => registry.draggable.unregister(publishedRef.current);\n }, [registry.draggable]);\n\n // updates while mounted\n useLayoutEffect(() => {\n if (isFirstPublishRef.current) {\n isFirstPublishRef.current = false;\n return;\n }\n\n const last: DraggableEntry = publishedRef.current;\n publishedRef.current = entry;\n registry.draggable.update(entry, last);\n }, [entry, registry.draggable]);\n}\n","// @flow\nimport { useRef } from 'react';\nimport { invariant } from '../../invariant';\nimport { isInteger } from '../../native-with-fallback';\nimport type { DraggableId, ContextId } from '../../types';\nimport type { Props } from './draggable-types';\nimport checkIsValidInnerRef from '../check-is-valid-inner-ref';\nimport findDragHandle from '../get-elements/find-drag-handle';\nimport useDevSetupWarning from '../use-dev-setup-warning';\nimport useDev from '../use-dev';\n\nexport function useValidation(\n props: Props,\n contextId: ContextId,\n getRef: () => HTMLElement | null,\n) {\n // running after every update in development\n useDevSetupWarning(() => {\n function prefix(id: DraggableId): string {\n return `Draggable[id: ${id}]: `;\n }\n\n // wrapping entire block for better minification\n const id: DraggableId | null = props.draggableId;\n invariant(id, 'Draggable requires a draggableId');\n invariant(\n typeof id === 'string',\n `Draggable requires a [string] draggableId.\n Provided: [type: ${typeof id}] (value: ${id})`,\n );\n\n invariant(\n isInteger(props.index),\n `${prefix(id)} requires an integer index prop`,\n );\n\n if (props.mapped.type === 'DRAGGING') {\n return;\n }\n\n // Checking provided ref (only when not dragging as it might be removed)\n checkIsValidInnerRef(getRef());\n\n // Checking that drag handle is provided\n // Only running check when enabled.\n // When not enabled there is no drag handle props\n if (props.isEnabled) {\n invariant(\n findDragHandle(contextId, id),\n `${prefix(id)} Unable to find drag handle`,\n );\n }\n });\n}\n\n// we expect isClone not to change for entire component's life\nexport function useClonePropValidation(isClone: boolean) {\n useDev(() => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const initialRef = useRef<boolean>(isClone);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useDevSetupWarning(() => {\n invariant(\n isClone === initialRef.current,\n 'Draggable isClone prop value changed during component life',\n );\n }, [isClone]);\n });\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport type { DraggableRubric, DraggableDescriptor } from \"../../types\";\nimport getStyle from \"./get-style\";\nimport useDraggablePublisher, {\n type Args as PublisherArgs,\n} from \"../use-draggable-publisher/use-draggable-publisher\";\nimport AppContext from \"../context/app-context\";\nimport DroppableContext from \"../context/droppable-context\";\nimport type {\n Props,\n Provided,\n DraggableStyle,\n DragHandleProps,\n} from \"./draggable-types\";\nimport { useValidation, useClonePropValidation } from \"./use-validation\";\nimport useRequiredContext from \"../use-required-context\";\n\nfunction preventHtml5Dnd(event: DragEvent) {\n event.preventDefault();\n}\n\nexport default function Draggable(props: Props) {\n // reference to DOM node\n const ref = useRef<HTMLElement | null>(null);\n const setRef = useCallback((el: HTMLElement | null) => {\n ref.current = el;\n }, []);\n const getRef = useCallback((): HTMLElement | null => ref.current, []);\n\n // context\n const { contextId, dragHandleUsageInstructionsId, registry } = useRequiredContext(AppContext);\n const { type, droppableId } = useRequiredContext(DroppableContext);\n\n const descriptor: DraggableDescriptor = useMemo(\n () => ({\n id: props.draggableId,\n index: props.index,\n type: type ?? \"\", // Empty by default Marked for review\n droppableId,\n }),\n [props.draggableId, props.index, type, droppableId],\n );\n\n // props\n const {\n // ownProps\n children,\n draggableId,\n isEnabled,\n shouldRespectForcePress,\n canDragInteractiveElements,\n isClone,\n\n // mapProps\n mapped,\n\n // dispatchProps\n dropAnimationFinished: dropAnimationFinishedAction,\n } = props;\n\n // Validating props and innerRef\n useValidation(props, contextId, getRef);\n\n // Clones do not speak to the dimension marshal\n // We are violating the rules of hooks here: conditional hooks.\n // In this specific use case it is okay as an item will always either be a\n // clone or not for it's whole lifecycle\n /* eslint-disable react-hooks/rules-of-hooks */\n\n // Being super sure that isClone is not changing during a draggable lifecycle\n useClonePropValidation(isClone);\n if (!isClone) {\n const forPublisher: PublisherArgs = useMemo(\n () => ({\n descriptor,\n registry,\n getDraggableRef: getRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n }),\n [\n descriptor,\n registry,\n getRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n ],\n );\n useDraggablePublisher(forPublisher);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const dragHandleProps: DragHandleProps | null = useMemo(\n () =>\n isEnabled\n ? {\n // See `draggable-types` for an explanation of why these are used\n tabIndex: 0,\n role: \"button\",\n \"aria-describedby\": dragHandleUsageInstructionsId,\n \"data-rbd-drag-handle-draggable-id\": draggableId,\n \"data-rbd-drag-handle-context-id\": contextId,\n draggable: false,\n onDragStart: preventHtml5Dnd,\n }\n : null,\n [contextId, dragHandleUsageInstructionsId, draggableId, isEnabled],\n );\n\n const onMoveEnd = useCallback(\n (event: TransitionEvent) => {\n if (mapped.type !== \"DRAGGING\") {\n return;\n }\n\n if (!mapped.dropping) {\n return;\n }\n\n // There might be other properties on the element that are\n // being transitioned. We do not want those to end a drop animation!\n if (event.propertyName !== \"transform\") {\n return;\n }\n\n dropAnimationFinishedAction();\n },\n [dropAnimationFinishedAction, mapped],\n );\n\n const provided: Provided = useMemo(() => {\n const style: DraggableStyle = getStyle(mapped);\n const onTransitionEnd =\n mapped.type === \"DRAGGING\" && mapped.dropping ? onMoveEnd : null;\n\n const result: Provided = {\n innerRef: setRef,\n draggableProps: {\n \"data-rbd-draggable-context-id\": contextId,\n \"data-rbd-draggable-id\": draggableId,\n style,\n onTransitionEnd,\n },\n dragHandleProps,\n };\n\n return result;\n }, [contextId, dragHandleProps, draggableId, mapped, onMoveEnd, setRef]);\n\n const rubric: DraggableRubric = useMemo(\n () => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId,\n },\n }),\n [descriptor.droppableId, descriptor.id, descriptor.index, descriptor.type],\n );\n\n return children(provided, mapped.snapshot, rubric);\n}\n","// @flow\nimport type { DroppableId, DropResult } from '../../types';\n\nexport default (result: DropResult): DroppableId | null => {\n const { combine, destination } = result;\n\n if (destination) {\n return destination.droppableId;\n }\n\n if (combine) {\n return combine.droppableId;\n }\n\n return null;\n};\n","import {\r\n createDispatchHook,\r\n createSelectorHook,\r\n createStoreHook,\r\n} from 'react-redux';\r\n\r\n// import type { Dispatch } from 'redux';\r\nimport type { State, Action } from '../../state/store-types';\r\n\r\nimport StoreContext from './store-context';\r\n\r\nexport const useAppDispatch = createDispatchHook<\r\n State,\r\n Action\r\n>(StoreContext);\r\n\r\nexport const useAppSelector = createSelectorHook(\r\n StoreContext,\r\n);\r\n\r\nexport const useAppStore = createStoreHook(StoreContext);","// @flow Marked for Review\nimport { type Position } from 'css-box-model';\n// eslint-disable-next-line\n// import { Component } from 'react';\nimport memoizeOne from 'memoize-one';\n// import { connect } from 'react-redux';\nimport Draggable from './draggable';\nimport { origin, negate } from '../../state/position';\n// import isStrictEqual from '../is-strict-equal';\nimport * as animation from '../../animation';\nimport { dropAnimationFinished as dropAnimationFinishedAction } from '../../state/action-creators';\nimport type {\n State,\n DraggableId,\n DroppableId,\n DraggableDimension,\n Displacement,\n CompletedDrag,\n DragImpact,\n MovementMode,\n DropResult,\n LiftEffect,\n Combine,\n} from '../../types';\nimport type {\n MapProps,\n OwnProps,\n // DispatchProps,\n Selector,\n StateSnapshot,\n DropAnimation,\n} from './draggable-types';\nimport whatIsDraggedOver from '../../state/droppable/what-is-dragged-over';\n// import StoreContext from '../context/store-context';\nimport whatIsDraggedOverFromResult from '../../state/droppable/what-is-dragged-over-from-result';\nimport { tryGetCombine } from '../../state/get-impact-location';\nimport { isDragging } from '../../state/reducer';\nimport { useCallback, useMemo } from '@helpdice/memoizer';\nimport React from 'react';\nimport { useAppDispatch, useAppSelector } from '../context/hooks';\n\nconst getCombineWithFromResult = (result: DropResult): DraggableId | null => {\n return result.combine ? result.combine.draggableId : null;\n};\n\nconst getCombineWithFromImpact = (impact: DragImpact): DraggableId | null => {\n return impact.at && impact.at.type === 'COMBINE'\n ? impact.at.combine.draggableId\n : null;\n};\n\ntype TrySelect = (state: State, ownProps: OwnProps) => MapProps | null;\n\nfunction getDraggableSelector(): TrySelect {\n const memoizedOffset = memoizeOne((x: number, y: number): Position => ({\n x,\n y,\n }));\n\n const getMemoizedSnapshot = memoizeOne(\n (\n mode: MovementMode,\n isClone: boolean,\n draggingOver: DroppableId | null,\n combineWith: DraggableId | null,\n dropping: DropAnimation | null,\n ): StateSnapshot => ({\n isDragging: true,\n isClone,\n isDropAnimating: Boolean(dropping),\n dropAnimation: dropping,\n mode,\n draggingOver,\n combineWith,\n combineTargetFor: null,\n }),\n );\n\n const getMemoizedProps = memoizeOne((\n offset: Position,\n mode: MovementMode,\n dimension: DraggableDimension,\n isClone: boolean,\n // the id of the droppable you are over\n draggingOver: DroppableId | null,\n // the id of a draggable you are grouping with\n combineWith: DraggableId | null,\n forceShouldAnimate: boolean | null,\n ): MapProps => ({\n mapped: {\n type: 'DRAGGING',\n dropping: null,\n draggingOver,\n combineWith,\n mode,\n offset,\n dimension,\n forceShouldAnimate,\n snapshot: getMemoizedSnapshot(\n mode,\n isClone,\n draggingOver,\n combineWith,\n null,\n ),\n },\n }));\n\n const selector: TrySelect = (state: State, ownProps: OwnProps): MapProps | null => {\n // Dragging Marked for Review\n if (isDragging(state)) {\n // not the dragging item\n if (state.critical.draggable.id !== ownProps.draggableId) {\n return null;\n }\n\n const offset: Position = state.current.client.offset;\n const dimension: DraggableDimension =\n state.dimensions.draggables[ownProps.draggableId];\n // const shouldAnimateDragMovement: boolean = state.shouldAnimate;\n const draggingOver: DroppableId | null = whatIsDraggedOver(state.impact);\n const combineWith: DraggableId | null = getCombineWithFromImpact(state.impact);\n const forceShouldAnimate: boolean | null = state.forceShouldAnimate;\n\n return getMemoizedProps(\n memoizedOffset(offset.x, offset.y),\n state.movementMode,\n dimension,\n ownProps.isClone,\n draggingOver,\n combineWith,\n forceShouldAnimate,\n );\n }\n\n // Dropping\n if (state.phase === 'DROP_ANIMATING') {\n const completed: CompletedDrag = state.completed;\n if (completed.result.draggableId !== ownProps.draggableId) {\n return null;\n }\n\n const isClone: boolean = ownProps.isClone;\n const dimension: DraggableDimension =\n state.dimensions.draggables[ownProps.draggableId];\n const result: DropResult = completed.result;\n const mode: MovementMode = result.mode;\n // these need to be pulled from the result as they can be different to the final impact\n const draggingOver: DroppableId | null = whatIsDraggedOverFromResult(result);\n const combineWith: DraggableId | null = getCombineWithFromResult(result);\n const duration: number = state.dropDuration;\n\n // not memoized as it is the only execution\n const dropping: DropAnimation = {\n duration,\n curve: animation.curves.drop,\n moveTo: state.newHomeClientOffset,\n opacity: combineWith ? animation.combine.opacity.drop : null,\n scale: combineWith ? animation.combine.scale.drop : null,\n };\n\n return {\n mapped: {\n type: 'DRAGGING',\n offset: state.newHomeClientOffset,\n dimension,\n dropping,\n draggingOver,\n combineWith,\n mode,\n forceShouldAnimate: null,\n snapshot: getMemoizedSnapshot(\n mode,\n isClone,\n draggingOver,\n combineWith,\n dropping,\n ),\n },\n };\n }\n\n return null;\n };\n\n return selector;\n}\n\nfunction getSecondarySnapshot(combineTargetFor: DraggableId | null): StateSnapshot {\n return {\n isDragging: false,\n isDropAnimating: false,\n isClone: false,\n dropAnimation: null,\n mode: null,\n draggingOver: null,\n combineTargetFor,\n combineWith: null,\n };\n}\n\nconst atRest: MapProps = {\n mapped: {\n type: 'SECONDARY',\n offset: origin,\n combineTargetFor: null,\n shouldAnimateDisplacement: true,\n snapshot: getSecondarySnapshot(null),\n },\n};\n\nfunction getSecondarySelector(): TrySelect {\n const memoizedOffset = memoizeOne((x: number, y: number): Position => ({\n x,\n y,\n }));\n\n const getMemoizedSnapshot = memoizeOne(getSecondarySnapshot);\n\n const getMemoizedProps = memoizeOne(\n (\n offset: Position,\n combineTargetFor: DraggableId | null = null,\n shouldAnimateDisplacement: boolean,\n ): MapProps => ({\n mapped: {\n type: 'SECONDARY',\n offset,\n combineTargetFor,\n shouldAnimateDisplacement,\n snapshot: getMemoizedSnapshot(combineTargetFor),\n },\n }),\n );\n\n // Is we are the combine target for something then we need to publish that\n // otherwise we will return null to get the default props\n const getFallback = (combineTargetFor: DraggableId | null): MapProps | null => {\n return combineTargetFor\n ? getMemoizedProps(origin, combineTargetFor, true)\n : null;\n };\n\n const getProps = (\n ownId: DraggableId,\n draggingId: DraggableId,\n impact: DragImpact,\n afterCritical: LiftEffect,\n ): MapProps | null => {\n const visualDisplacement: Displacement | null = impact.displaced.visible[ownId];\n const isAfterCriticalInVirtualList: boolean = Boolean(\n afterCritical.inVirtualList && afterCritical.effected[ownId],\n );\n\n const combine: Combine | null = tryGetCombine(impact);\n const combineTargetFor: DraggableId | null =\n combine && combine.draggableId === ownId ? draggingId : null;\n\n if (!visualDisplacement) {\n if (!isAfterCriticalInVirtualList) {\n return getFallback(combineTargetFor);\n }\n\n // After critical but not visibly displaced in a virtual list\n // This can occur if:\n // 1. the item is not visible (displaced.invisible)\n // 2. We have moved out of the home list.\n\n // Don't need to do anything - item is invisible\n if (impact.displaced.invisible[ownId]) {\n return null;\n }\n\n // We are no longer over the home list.\n // We need to move backwards to close the gap that the dragging item has left\n const change: Position = negate(afterCritical.displacedBy.point);\n const offset: Position = memoizedOffset(change.x, change.y);\n return getMemoizedProps(offset, combineTargetFor, true);\n }\n\n if (isAfterCriticalInVirtualList) {\n // In a virtual list the removal of a dragging item does\n // not cause the list to collapse. So when something is 'displaced'\n // we can just leave it in the original spot.\n return getFallback(combineTargetFor);\n }\n const displaceBy: Position = impact.displacedBy.point;\n const offset: Position = memoizedOffset(displaceBy.x, displaceBy.y);\n\n return getMemoizedProps(\n offset,\n combineTargetFor,\n visualDisplacement.shouldAnimate,\n );\n };\n\n const selector: TrySelect = (state: State, ownProps: OwnProps): MapProps | null => {\n // Dragging Marked for Review\n if (isDragging(state)) {\n // we do not care about the dragging item\n if (state.critical.draggable.id === ownProps.draggableId) {\n return null;\n }\n\n return getProps(\n ownProps.draggableId,\n state.critical.draggable.id,\n state.impact,\n state.afterCritical,\n );\n }\n\n // Dropping\n if (state.phase === 'DROP_ANIMATING') {\n const completed: CompletedDrag = state.completed;\n // do nothing if this was the dragging item\n if (completed.result.draggableId === ownProps.draggableId) {\n return null;\n }\n return getProps(\n ownProps.draggableId,\n completed.result.draggableId,\n completed.impact,\n completed.afterCritical,\n );\n }\n\n // Otherwise\n return null;\n };\n\n return selector;\n}\n\n// Returning a function to ensure each\n// Draggable gets its own selector\nexport const makeMapStateToProps = (): Selector => {\n const draggingSelector: TrySelect = getDraggableSelector();\n const secondarySelector: TrySelect = getSecondarySelector();\n\n const selector = (state: State, ownProps: OwnProps): MapProps =>\n draggingSelector(state, ownProps) ||\n secondarySelector(state, ownProps) ||\n atRest;\n\n return selector;\n};\n\n// const mapDispatchToProps: DispatchProps = {\n// dropAnimationFinished: dropAnimationFinishedAction,\n// };\n\n// Leaning heavily on the default shallow equality checking\n// that `connect` provides.\n// It avoids needing to do it own within `<Draggable />`\n// const ConnectedDraggable = connect(\n// // returning a function so each component can do its own memoization\n// makeMapStateToProps,\n// mapDispatchToProps,\n// // mergeProps: use default\n// null,\n// // options\n// // $FlowFixMe: current react-redux type does not know about context property\n// {\n// // Using our own context for the store to avoid clashing with consumers\n// context: StoreContext,\n// // Default value, but being really clear\n// pure: true,\n// // When pure, compares the result of mapStateToProps to its previous value.\n// // Default value: shallowEqual\n// // Switching to a strictEqual as we return a memoized object on changes\n// areStatePropsEqual: isStrictEqual,\n// },\n// )(Draggable);\n\nconst DraggableWithRedux = (props: OwnProps) => {\n const dispatch = useAppDispatch();\n\n const selector = useMemo(\n () => makeMapStateToProps(),\n [],\n );\n\n const stateProps = useAppSelector((state: State) =>\n selector(state, props),\n );\n\n // const dispatchProps = useMemo(\n // () => mapDispatchToProps(dispatch, props),\n // [dispatch, props],\n // );\n\n // const dispatchProps = useMemo(\n // () => bindActionCreators(mapDispatchToProps, dispatch),\n // [dispatch],\n // );\n\n const dropAnimationFinished = useCallback(\n () => dispatch(dropAnimationFinishedAction()),\n [dispatch],\n );\n\n // return (\n // <Draggable\n // { ...props }\n // {...stateProps }\n // {...dispatchProps }\n // />\n // );\n\n return <Draggable\n {...props}\n {...stateProps}\n dropAnimationFinished={dropAnimationFinished}\n />;\n};\n\nexport default React.memo(DraggableWithRedux);\n\n// export default ConnectedDraggable;\n","// @flow\n// import React from 'react';\nimport type { DraggableId } from '../../types';\nimport type { PublicOwnProps, PrivateOwnProps } from './draggable-types';\nimport ConnectedDraggable from './connected-draggable';\nimport useRequiredContext from '../use-required-context';\nimport DroppableContext, {\n type DroppableContextValue,\n} from '../context/droppable-context';\n\n// We can use this to render a draggable with more control\n// It is used by a Droppable to render a clone\nexport function PrivateDraggable(props: PrivateOwnProps) {\n const droppableContext: DroppableContextValue | null = useRequiredContext(\n DroppableContext,\n );\n // The droppable can render a clone of the draggable item.\n // In that case we unmount the existing dragging item\n const isUsingCloneFor: DraggableId | null | undefined = droppableContext?.isUsingCloneFor;\n if (isUsingCloneFor === props.draggableId && !props.isClone) {\n return null;\n }\n\n return <ConnectedDraggable {...props} />;\n}\n\n// What we give to consumers\nexport function PublicDraggable(props: PublicOwnProps) {\n // default values for props\n const isEnabled: boolean =\n typeof props.isDragDisabled === 'boolean' ? !props.isDragDisabled : true;\n const canDragInteractiveElements: boolean = Boolean(\n props.disableInteractiveElementBlocking,\n );\n const shouldRespectForcePress: boolean = Boolean(\n props.shouldRespectForcePress,\n );\n\n return (\n <PrivateDraggable\n {...props}\n isClone={false}\n isEnabled={isEnabled}\n canDragInteractiveElements={canDragInteractiveElements}\n shouldRespectForcePress={shouldRespectForcePress}\n />\n );\n}\n","// @flow\nimport ReactDOM from \"react-dom\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { useRef, useContext, type ReactNode } from \"react\";\nimport { invariant } from \"../../invariant\";\nimport type { DraggableId } from \"../../types\";\nimport type { Props, Provided } from \"./droppable-types\";\nimport useDroppablePublisher from \"../use-droppable-publisher\";\nimport Placeholder from \"../placeholder\";\nimport AppContext, { type AppContextValue } from \"../context/app-context\";\nimport DroppableContext, {\n type DroppableContextValue,\n} from \"../context/droppable-context\";\n// import useAnimateInOut from '../use-animate-in-out/use-animate-in-out';\nimport getMaxWindowScroll from \"../window/get-max-window-scroll\";\nimport useValidation from \"./use-validation\";\nimport type {\n StateSnapshot as DraggableStateSnapshot,\n Provided as DraggableProvided,\n} from \"../draggable/draggable-types\";\nimport AnimateInOut, {\n type AnimateProvided,\n} from \"../animate-in-out/animate-in-out\";\nimport { PrivateDraggable } from \"../draggable/draggable-api\";\n\nexport default function Droppable(props: Props) {\n const appContext: AppContextValue | null = useContext<AppContextValue | null>(AppContext);\n invariant(appContext, \"Could not find app context\");\n const { contextId, isMovementAllowed } = appContext;\n const droppableRef = useRef<HTMLElement | null>(null);\n const placeholderRef = useRef<HTMLElement | null>(null);\n\n const {\n // own props\n children,\n droppableId,\n type,\n mode,\n direction,\n ignoreContainerClipping,\n isDropDisabled,\n isCombineEnabled,\n // map props\n snapshot,\n useClone,\n // dispatch props\n updateViewportMaxScroll,\n\n // clone (ownProps)\n getContainerForClone,\n } = props;\n\n const getDroppableRef = useCallback(\n (): HTMLElement | null => droppableRef.current,\n [],\n );\n const setDroppableRef = useCallback((value: HTMLElement | null) => {\n droppableRef.current = value;\n }, []);\n const getPlaceholderRef = useCallback(\n (): HTMLElement | null => placeholderRef.current,\n [],\n );\n const setPlaceholderRef = useCallback((value: HTMLElement | null) => {\n placeholderRef.current = value;\n }, []);\n\n useValidation({\n props,\n getDroppableRef,\n getPlaceholderRef,\n });\n\n const onPlaceholderTransitionEnd = useCallback(() => {\n // A placeholder change can impact the window's max scroll\n if (isMovementAllowed()) {\n updateViewportMaxScroll({ maxScroll: getMaxWindowScroll() });\n }\n }, [isMovementAllowed, updateViewportMaxScroll]);\n\n useDroppablePublisher({\n droppableId,\n type,\n mode,\n direction,\n isDropDisabled,\n isCombineEnabled,\n ignoreContainerClipping,\n getDroppableRef,\n });\n\n const placeholder: ReactNode = (\n <AnimateInOut\n on={props.placeholder}\n shouldAnimate={props.shouldAnimatePlaceholder}\n >\n {({ onClose, data, animate }: AnimateProvided) => (\n <Placeholder\n placeholder={data as any}\n onClose={onClose}\n innerRef={setPlaceholderRef}\n animate={animate}\n contextId={contextId}\n onTransitionEnd={onPlaceholderTransitionEnd}\n />\n )}\n </AnimateInOut>\n );\n\n const provided: Provided = useMemo(\n (): Provided => ({\n innerRef: setDroppableRef,\n placeholder,\n droppableProps: {\n \"data-rbd-droppable-id\": droppableId,\n \"data-rbd-droppable-context-id\": contextId,\n },\n }),\n [contextId, droppableId, placeholder, setDroppableRef],\n );\n\n const isUsingCloneFor: DraggableId | null = useClone\n ? useClone.dragging.draggableId\n : null;\n\n const droppableContext: DroppableContextValue | null = useMemo(\n () => ({\n droppableId,\n type,\n isUsingCloneFor,\n }),\n [droppableId, isUsingCloneFor, type],\n );\n\n function getClone(): ReactNode {\n if (!useClone) {\n return null;\n }\n const { dragging, render } = useClone;\n\n const node: ReactNode = (\n <PrivateDraggable\n draggableId={dragging.draggableId}\n index={dragging.source.index}\n isClone\n isEnabled\n // not important as drag has already started\n shouldRespectForcePress={false}\n canDragInteractiveElements\n >\n {(\n draggableProvided: DraggableProvided,\n draggableSnapshot: DraggableStateSnapshot,\n ) => render(draggableProvided, draggableSnapshot, dragging)}\n </PrivateDraggable>\n );\n\n return ReactDOM.createPortal(node, getContainerForClone());\n }\n\n return (\n <DroppableContext.Provider value={droppableContext}>\n {children(provided, snapshot)}\n {getClone()}\n </DroppableContext.Provider>\n );\n}\n","// @flow\n// eslint-disable-next-line no-unused-vars\n\nimport { memo, useMemo, useCallback } from 'react';\nimport memoizeOne from 'memoize-one';\n\nimport { invariant } from '../../invariant';\n\nimport type {\n State,\n DroppableId,\n DraggableId,\n CompletedDrag,\n DraggableDimension,\n DimensionMap,\n TypeId,\n Critical,\n DraggableRubric,\n DraggableDescriptor,\n} from '../../types';\n\nimport type {\n MapProps,\n OwnProps,\n DefaultProps,\n Selector,\n StateSnapshot,\n UseClone,\n DraggableChildrenFn,\n} from './droppable-types';\n\nimport Droppable from './droppable';\n\nimport whatIsDraggedOver from '../../state/droppable/what-is-dragged-over';\nimport whatIsDraggedOverFromResult from '../../state/droppable/what-is-dragged-over-from-result';\n\nimport {\n updateViewportMaxScroll as updateViewportMaxScrollAction,\n} from '../../state/action-creators';\n\nimport { isDragging } from '../../state/reducer';\n\nimport {\n useAppDispatch,\n useAppSelector,\n} from '../context/hooks';\n\n// -----------------------------------------------------------------------------\n// Helpers\n// -----------------------------------------------------------------------------\n\nconst isMatchingType = (\n type: TypeId,\n critical: Critical,\n): boolean => type === critical.droppable.type;\n\nconst getDraggable = (\n critical: Critical,\n dimensions: DimensionMap,\n): DraggableDimension =>\n dimensions.draggables[critical.draggable.id];\n\n// -----------------------------------------------------------------------------\n// Selector\n// -----------------------------------------------------------------------------\n\nexport const makeMapStateToProps = (): Selector => {\n const idleWithAnimation: MapProps = {\n placeholder: null,\n shouldAnimatePlaceholder: true,\n snapshot: {\n isDraggingOver: false,\n draggingOverWith: null,\n draggingFromThisWith: null,\n isUsingPlaceholder: false,\n },\n useClone: null,\n };\n\n const idleWithoutAnimation: MapProps = {\n ...idleWithAnimation,\n shouldAnimatePlaceholder: false,\n };\n\n const getDraggableRubric = memoizeOne(\n (descriptor: DraggableDescriptor): DraggableRubric => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId,\n },\n }),\n );\n\n const getMapProps = memoizeOne(\n (\n id: DroppableId,\n isEnabled: boolean,\n isDraggingOverForConsumer: boolean,\n isDraggingOverForImpact: boolean,\n dragging: DraggableDimension,\n renderClone: DraggableChildrenFn | null,\n ): MapProps => {\n const draggableId: DraggableId = dragging.descriptor.id;\n const isHome: boolean =\n dragging.descriptor.droppableId === id;\n\n if (isHome) {\n const useClone: UseClone | null = renderClone\n ? {\n render: renderClone,\n dragging: getDraggableRubric(dragging.descriptor),\n }\n : null;\n\n const snapshot: StateSnapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: isDraggingOverForConsumer\n ? draggableId\n : null,\n draggingFromThisWith: draggableId,\n isUsingPlaceholder: true,\n };\n\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: false,\n snapshot,\n useClone,\n };\n }\n\n if (!isEnabled) {\n return idleWithoutAnimation;\n }\n\n if (!isDraggingOverForImpact) {\n return idleWithAnimation;\n }\n\n const snapshot: StateSnapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: draggableId,\n draggingFromThisWith: null,\n isUsingPlaceholder: true,\n };\n\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: true,\n snapshot,\n useClone: null,\n };\n },\n );\n\n const selector: Selector = (\n state: State,\n ownProps: OwnProps,\n ): MapProps => {\n const id: DroppableId = ownProps.droppableId;\n const type: TypeId | undefined = ownProps.type;\n const isEnabled: boolean = !ownProps.isDropDisabled;\n const renderClone: DraggableChildrenFn | null =\n ownProps.renderClone;\n\n if (isDragging(state)) {\n const critical: Critical = state.critical;\n\n if (type && !isMatchingType(type, critical)) {\n return idleWithoutAnimation;\n }\n\n const dragging: DraggableDimension = getDraggable(\n critical,\n state.dimensions,\n );\n\n const isDraggingOver: boolean =\n whatIsDraggedOver(state.impact) === id;\n\n return getMapProps(\n id,\n isEnabled,\n isDraggingOver,\n isDraggingOver,\n dragging,\n renderClone,\n );\n }\n\n if (state.phase === 'DROP_ANIMATING') {\n const completed: CompletedDrag = state.completed;\n\n if (type && !isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n\n const dragging: DraggableDimension = getDraggable(\n completed.critical,\n state.dimensions,\n );\n\n return getMapProps(\n id,\n isEnabled,\n whatIsDraggedOverFromResult(completed.result) === id,\n whatIsDraggedOver(completed.impact) === id,\n dragging,\n renderClone,\n );\n }\n\n if (\n state.phase === 'IDLE' &&\n state.completed &&\n !state.shouldFlush\n ) {\n const completed: CompletedDrag = state.completed;\n\n if (type && !isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n\n const wasOver: boolean =\n whatIsDraggedOver(completed.impact) === id;\n\n const wasCombining: boolean = Boolean(\n completed.impact.at &&\n completed.impact.at.type === 'COMBINE',\n );\n\n const isHome: boolean =\n completed.critical.droppable.id === id;\n\n if (wasOver) {\n return wasCombining\n ? idleWithAnimation\n : idleWithoutAnimation;\n }\n\n if (isHome) {\n return idleWithAnimation;\n }\n\n return idleWithoutAnimation;\n }\n\n return idleWithoutAnimation;\n };\n\n return selector;\n};\n\n// -----------------------------------------------------------------------------\n// Default props\n// -----------------------------------------------------------------------------\n\nfunction getBody(): HTMLElement {\n invariant(document.body, 'document.body is not ready');\n return document.body;\n}\n\nconst defaultProps: DefaultProps = {\n mode: 'standard',\n type: 'DEFAULT',\n direction: 'vertical',\n isDropDisabled: false,\n isCombineEnabled: false,\n ignoreContainerClipping: false,\n renderClone: null,\n getContainerForClone: getBody,\n};\n\n// -----------------------------------------------------------------------------\n// Connected Droppable using hooks\n// -----------------------------------------------------------------------------\n\nconst ConnectedDroppable = (props: OwnProps) => {\n const mergedProps = {\n ...defaultProps,\n ...props,\n } as OwnProps;\n\n // Each Droppable gets its own memoized selector\n const selector = useMemo(\n () => makeMapStateToProps(),\n [],\n );\n\n const mapped: MapProps = useAppSelector(\n (state: State) => selector(state, mergedProps),\n );\n\n const dispatch = useAppDispatch();\n\n const updateViewportMaxScroll = useCallback(\n (...args: Parameters<typeof updateViewportMaxScrollAction>) =>\n dispatch(updateViewportMaxScrollAction(...args)),\n [dispatch],\n );\n\n return (\n <Droppable\n {...mergedProps}\n {...mapped}\n updateViewportMaxScroll={updateViewportMaxScroll}\n />\n );\n};\n\nConnectedDroppable.displayName = 'ConnectedDroppable';\n\nexport default memo(ConnectedDroppable);\n\n\n\n// import { Component } from 'react';\n// import { connect } from 'react-redux';\n// import memoizeOne from 'memoize-one';\n// import { invariant } from '../../invariant';\n// import type {\n// State,\n// DroppableId,\n// DraggableId,\n// CompletedDrag,\n// DraggableDimension,\n// DimensionMap,\n// TypeId,\n// Critical,\n// DraggableRubric,\n// DraggableDescriptor,\n// } from '../../types';\n// import type {\n// MapProps,\n// OwnProps,\n// DefaultProps,\n// Selector,\n// DispatchProps,\n// StateSnapshot,\n// UseClone,\n// DraggableChildrenFn,\n// } from './droppable-types';\n// import Droppable from './droppable';\n// import isStrictEqual from '../is-strict-equal';\n// import whatIsDraggedOver from '../../state/droppable/what-is-dragged-over';\n// import { updateViewportMaxScroll as updateViewportMaxScrollAction } from '../../state/action-creators';\n// import StoreContext from '../context/store-context';\n// import whatIsDraggedOverFromResult from '../../state/droppable/what-is-dragged-over-from-result';\n// import { isDragging } from '../../state/reducer';\n\n// const isMatchingType = (type: TypeId, critical: Critical): boolean =>\n// type === critical.droppable.type;\n\n// const getDraggable = (\n// critical: Critical,\n// dimensions: DimensionMap,\n// ): DraggableDimension => dimensions.draggables[critical.draggable.id];\n\n// // Returning a function to ensure each\n// // Droppable gets its own selector\n// export const makeMapStateToProps = (): Selector => {\n// const idleWithAnimation: MapProps = {\n// placeholder: null,\n// shouldAnimatePlaceholder: true,\n// snapshot: {\n// isDraggingOver: false,\n// draggingOverWith: null,\n// draggingFromThisWith: null,\n// isUsingPlaceholder: false,\n// },\n// useClone: null,\n// };\n\n// const idleWithoutAnimation = {\n// ...idleWithAnimation,\n// shouldAnimatePlaceholder: false,\n// };\n\n// const getDraggableRubric = memoizeOne(\n// (descriptor: DraggableDescriptor): DraggableRubric => ({\n// draggableId: descriptor.id,\n// type: descriptor.type,\n// source: {\n// index: descriptor.index,\n// droppableId: descriptor.droppableId,\n// },\n// }),\n// );\n\n// const getMapProps = memoizeOne(\n// (\n// id: DroppableId,\n// isEnabled: boolean,\n// isDraggingOverForConsumer: boolean,\n// isDraggingOverForImpact: boolean,\n// dragging: DraggableDimension,\n// // snapshot: StateSnapshot,\n// renderClone: ?DraggableChildrenFn,\n// ): MapProps => {\n// const draggableId: DraggableId = dragging.descriptor.id;\n// const isHome: boolean = dragging.descriptor.droppableId === id;\n\n// if (isHome) {\n// const useClone: ?UseClone = renderClone\n// ? {\n// render: renderClone,\n// dragging: getDraggableRubric(dragging.descriptor),\n// }\n// : null;\n\n// const snapshot: StateSnapshot = {\n// isDraggingOver: isDraggingOverForConsumer,\n// draggingOverWith: isDraggingOverForConsumer ? draggableId : null,\n// draggingFromThisWith: draggableId,\n// isUsingPlaceholder: true,\n// };\n\n// return {\n// placeholder: dragging.placeholder,\n// shouldAnimatePlaceholder: false,\n// snapshot,\n// useClone,\n// };\n// }\n\n// if (!isEnabled) {\n// return idleWithoutAnimation;\n// }\n\n// // not over foreign list - return idle\n// if (!isDraggingOverForImpact) {\n// return idleWithAnimation;\n// }\n\n// const snapshot: StateSnapshot = {\n// isDraggingOver: isDraggingOverForConsumer,\n// draggingOverWith: draggableId,\n// draggingFromThisWith: null,\n// isUsingPlaceholder: true,\n// };\n\n// return {\n// placeholder: dragging.placeholder,\n// // Animating placeholder in foreign list\n// shouldAnimatePlaceholder: true,\n// snapshot,\n// useClone: null,\n// };\n// },\n// );\n\n// const selector = (state: State, ownProps: OwnProps): MapProps => {\n// // not checking if item is disabled as we need the home list to display a placeholder\n\n// const id: DroppableId = ownProps.droppableId;\n// const type: TypeId = ownProps.type;\n// const isEnabled: boolean = !ownProps.isDropDisabled;\n// const renderClone: ?DraggableChildrenFn = ownProps.renderClone;\n\n// if (isDragging(state)) { // Marked for Review state.isDragging\n// const critical: Critical = state.critical;\n// if (!isMatchingType(type, critical)) {\n// return idleWithoutAnimation;\n// }\n\n// const dragging: DraggableDimension = getDraggable(\n// critical,\n// state.dimensions,\n// );\n// const isDraggingOver: boolean = whatIsDraggedOver(state.impact) === id;\n\n// return getMapProps(\n// id,\n// isEnabled,\n// isDraggingOver,\n// isDraggingOver,\n// dragging,\n// renderClone,\n// );\n// }\n\n// if (state.phase === 'DROP_ANIMATING') {\n// const completed: CompletedDrag = state.completed;\n// if (!isMatchingType(type, completed.critical)) {\n// return idleWithoutAnimation;\n// }\n\n// const dragging: DraggableDimension = getDraggable(\n// completed.critical,\n// state.dimensions,\n// );\n\n// // Snapshot based on result and not impact\n// // The result might be null (cancel) but the impact is populated\n// // to move everything back\n// return getMapProps(\n// id,\n// isEnabled,\n// whatIsDraggedOverFromResult(completed.result) === id,\n// whatIsDraggedOver(completed.impact) === id,\n// dragging,\n// renderClone,\n// );\n// }\n\n// if (state.phase === 'IDLE' && state.completed && !state.shouldFlush) {\n// const completed: CompletedDrag = state.completed;\n// if (!isMatchingType(type, completed.critical)) {\n// return idleWithoutAnimation;\n// }\n\n// // Looking at impact as this controls the placeholder\n// const wasOver: boolean = whatIsDraggedOver(completed.impact) === id;\n// const wasCombining: boolean = Boolean(\n// completed.impact.at && completed.impact.at.type === 'COMBINE',\n// );\n// const isHome: boolean = completed.critical.droppable.id === id;\n\n// if (wasOver) {\n// // if reordering we need to cut an animation immediately\n// // if merging: animate placeholder closed after drop\n// return wasCombining ? idleWithAnimation : idleWithoutAnimation;\n// }\n\n// // we need to animate the home placeholder closed if it is not\n// // being dropped into\n// if (isHome) {\n// return idleWithAnimation;\n// }\n\n// return idleWithoutAnimation;\n// }\n\n// // default: including when flushed\n// return idleWithoutAnimation;\n// };\n\n// return selector;\n// };\n\n// const mapDispatchToProps: DispatchProps = {\n// updateViewportMaxScroll: updateViewportMaxScrollAction,\n// };\n\n// function getBody(): HTMLElement {\n// invariant(document.body, 'document.body is not ready');\n// return document.body;\n// }\n\n// const defaultProps = ({\n// mode: 'standard',\n// type: 'DEFAULT',\n// direction: 'vertical',\n// isDropDisabled: false,\n// isCombineEnabled: false,\n// ignoreContainerClipping: false,\n// renderClone: null,\n// getContainerForClone: getBody,\n// }: DefaultProps);\n\n// // Abstract class allows to specify props and defaults to component.\n// // All other ways give any or do not let add default props.\n// // eslint-disable-next-line\n// /*::\n// class DroppableType extends Component<OwnProps> {\n// static defaultProps = defaultProps;\n// }\n// */\n\n// // Leaning heavily on the default shallow equality checking\n// // that `connect` provides.\n// // It avoids needing to do it own within `Droppable`\n// const ConnectedDroppable: typeof DroppableType = connect(\n// // returning a function so each component can do its own memoization\n// makeMapStateToProps,\n// // no dispatch props for droppable\n// mapDispatchToProps,\n// // mergeProps - using default\n// null,\n// // $FlowFixMe: current react-redux type does not know about context property\n// {\n// // Ensuring our context does not clash with consumers\n// context: StoreContext,\n// // pure: true is default value, but being really clear\n// pure: true,\n// // When pure, compares the result of mapStateToProps to its previous value.\n// // Default value: shallowEqual\n// // Switching to a strictEqual as we return a memoized object on changes\n// areStatePropsEqual: isStrictEqual,\n// },\n// )(Droppable);\n\n// ConnectedDroppable.defaultProps = defaultProps;\n\n// export default ConnectedDroppable;\n"],"names":["React","require$$0","jsxRuntimeModule","require$$1","isProduction","clean","noop","prefix","invariant","withSelectorModule","useIsomorphicLayoutEffect","useSyncExternalStoreWithSelector","areInputsEqual","useState","useRef","useEffect","createStore","isEqual","closest","noSpacing","getWindowScroll","scroll","isVisible","getDraggables","getPageBorderBoxCenter","getDroppableOver","didStartAfterCritical","getDidStartAfterCritical","recomputeDisplacementVisibility","offset","offsetBox","timings.start","timings.finish","idle","lift","drop","distance","getDistance","messagePreset","getScroll","start","dragHandle","attributes.dragHandle","draggable","attributes.draggable","droppable","attributes.droppable","useLayoutEffect","getStyles","dragHandleAttr","count","reset","keyCodes.enter","keyCodes.tab","keyCodes.escape","supportedPageVisibilityEventName","keyCodes.pageDown","keyCodes.pageUp","keyCodes.home","keyCodes.end","keyCodes.space","keyCodes.arrowDown","keyCodes.arrowUp","keyCodes.arrowRight","keyCodes.arrowLeft","usePreviousRef","liftAction","dropAction","move","moveAction","moveUpAction","moveRightAction","moveDownAction","moveLeftAction","findClosestDraggableIdFromEvent","_jsx","resetContextId","resetUniqueIds","useUniqueContextId","useContext","rafSchedule","getDimension","dataAttr.scrollContainer","getStyle","useValidation","makeDimension","animation.curves","animation.combine","makeMapStateToProps","dropAnimationFinished","dropAnimationFinishedAction","Placeholder","_jsxs","useMemo","updateViewportMaxScroll","useCallback","updateViewportMaxScrollAction","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,CAAA,IAAI,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC;AACjE,GAAE,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;AACpD,CAAA,SAAS,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;GACvC,IAAI,GAAG,GAAG,IAAI;GACd,MAAM,KAAK,QAAQ,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC;AAC9C,GAAE,MAAM,KAAK,MAAM,CAAC,GAAG,KAAK,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;AAClD,GAAE,IAAI,KAAK,IAAI,MAAM,EAAE;KACnB,QAAQ,GA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AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;ACjTA,4BAAe,CAAC,EACd,QAAQ,EACR,OAAO,EACP,MAAM,EACN,aAAa,EACb,sBAAsB,GACjB,KAAqB;IAC1B,MAAM,MAAM,GAAoBsB,WAAS,CAAC;QACxC,aAAa;QACb,SAAS,EAAE,QAAQ,CAAC,KAAK;QACzB,OAAO;QACP,MAAM;QACN,sBAAsB;AACvB,KAAA,CAAC;AAEF,IAAA,OAAO,MAAM,IAAI,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;AACpE,CAAC;;AChBD,+BAAe,CAAC,EACd,SAAS,EACT,OAAO,EACP,MAAM,EACN,aAAa,EACb,sBAAsB,GACjB,KAAqB;;AAE1B,IAAA,MAAM,KAAK,GAAsB,SAAS,CAAC,KAAK;;IAGhD,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI;IACb;IAEA,MAAM,MAAM,GAAoBA,WAAS,C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,EAAA,EACJ,WAAW,EACX,MAAM,EAAA,EACV,uBAAuB,EAAEmB,yBAAuB,EAAA,CAAA,CAChD;AAEN,CAAC;AAED,kBAAkB,CAAC,WAAW,GAAG,oBAAoB;AAErD,yBAAeG,UAAI,CAAC,kBAAkB,CAAC;;;;;;;;","x_google_ignoreList":[0,1,2,9,10,11,12,13,14,16,17,22,97]}
1
+ {"version":3,"file":"draggable.cjs.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/file:/D:/Github/draggable/src/dev-warning.ts","../src/file:/D:/Github/draggable/src/empty.ts","../src/view/event-bindings/file:/D:/Github/draggable/src/view/event-bindings/bind-events.ts","../src/file:/D:/Github/draggable/src/invariant.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/error-boundary.tsx","../src/file:/D:/Github/draggable/src/screen-reader-message-preset.ts","../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js","../node_modules/use-sync-external-store/with-selector.js","../node_modules/react-redux/dist/react-redux.mjs","../node_modules/@helpdice/memoizer/dist/memoizer.esm.js","../node_modules/redux/dist/redux.mjs","../src/state/file:/D:/Github/draggable/src/state/position.ts","../node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../node_modules/css-box-model/dist/css-box-model.esm.js","../src/state/droppable/util/file:/D:/Github/draggable/src/state/droppable/util/clip.ts","../src/state/file:/D:/Github/draggable/src/state/spacing.ts","../src/state/droppable/util/file:/D:/Github/draggable/src/state/droppable/util/get-subject.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/scroll-droppable.ts","../node_modules/memoize-one/dist/memoize-one.esm.js","../src/file:/D:/Github/draggable/src/native-with-fallback.ts","../src/state/file:/D:/Github/draggable/src/state/dimension-structures.ts","../src/state/file:/D:/Github/draggable/src/state/get-draggables-inside-droppable.ts","../src/state/file:/D:/Github/draggable/src/state/get-impact-location.ts","../src/state/file:/D:/Github/draggable/src/state/remove-draggable-from-list.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-combine/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-combine/index.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/is-home-of.ts","../src/state/file:/D:/Github/draggable/src/state/no-impact.ts","../src/state/file:/D:/Github/draggable/src/state/is-within.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-partially-visible-through-frame.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-totally-visible-through-frame.ts","../src/state/file:/D:/Github/draggable/src/state/axis.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-totally-visible-through-frame-on-axis.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-visible.ts","../src/state/file:/D:/Github/draggable/src/state/get-displacement-groups.ts","../src/state/calculate-drag-impact/file:/D:/Github/draggable/src/state/calculate-drag-impact/calculate-reorder-impact.ts","../src/state/file:/D:/Github/draggable/src/state/did-start-after-critical.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-index/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-index/from-combine.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-index/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-index/from-reorder.ts","../src/state/move-in-direction/move-to-next-place/move-to-next-index/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/move-to-next-index/index.ts","../src/state/file:/D:/Github/draggable/src/state/get-combined-item-displacement.ts","../src/state/get-center-from-impact/get-page-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-page-border-box-center/when-combining.ts","../src/state/get-center-from-impact/file:/D:/Github/draggable/src/state/get-center-from-impact/move-relative-to.ts","../src/state/get-center-from-impact/get-page-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-page-border-box-center/when-reordering.ts","../src/state/with-scroll-change/file:/D:/Github/draggable/src/state/with-scroll-change/with-droppable-displacement.ts","../src/state/get-center-from-impact/get-page-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-page-border-box-center/index.ts","../src/state/file:/D:/Github/draggable/src/state/scroll-viewport.ts","../src/state/update-displacement-visibility/file:/D:/Github/draggable/src/state/update-displacement-visibility/speculatively-increase.ts","../src/state/with-scroll-change/file:/D:/Github/draggable/src/state/with-scroll-change/with-viewport-displacement.ts","../src/state/get-center-from-impact/get-client-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center.ts","../src/state/move-in-direction/move-to-next-place/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/is-totally-visible-in-new-location.ts","../src/state/move-in-direction/move-to-next-place/file:/D:/Github/draggable/src/state/move-in-direction/move-to-next-place/index.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/get-best-cross-axis-droppable.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/without-starting-displacement.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/get-closest-draggable.ts","../src/state/file:/D:/Github/draggable/src/state/get-displaced-by.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/with-placeholder.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/move-to-new-droppable.ts","../src/state/move-in-direction/move-cross-axis/file:/D:/Github/draggable/src/state/move-in-direction/move-cross-axis/index.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/what-is-dragged-over.ts","../src/state/move-in-direction/file:/D:/Github/draggable/src/state/move-in-direction/index.ts","../src/state/file:/D:/Github/draggable/src/state/is-movement-allowed.ts","../src/state/visibility/file:/D:/Github/draggable/src/state/visibility/is-position-in-frame.ts","../src/state/file:/D:/Github/draggable/src/state/get-droppable-over.ts","../src/state/file:/D:/Github/draggable/src/state/rect.ts","../src/state/with-scroll-change/file:/D:/Github/draggable/src/state/with-scroll-change/with-droppable-scroll.ts","../src/state/file:/D:/Github/draggable/src/state/get-is-displaced.ts","../src/state/get-drag-impact/file:/D:/Github/draggable/src/state/get-drag-impact/get-reorder-impact.ts","../src/state/get-drag-impact/file:/D:/Github/draggable/src/state/get-drag-impact/get-combine-impact.ts","../src/state/get-drag-impact/file:/D:/Github/draggable/src/state/get-drag-impact/index.ts","../src/state/file:/D:/Github/draggable/src/state/patch-droppable-map.ts","../src/state/file:/D:/Github/draggable/src/state/recompute-placeholders.ts","../src/state/post-reducer/when-moving/file:/D:/Github/draggable/src/state/post-reducer/when-moving/update.ts","../src/state/update-displacement-visibility/file:/D:/Github/draggable/src/state/update-displacement-visibility/recompute.ts","../src/state/get-center-from-impact/get-client-border-box-center/file:/D:/Github/draggable/src/state/get-center-from-impact/get-client-border-box-center/index.ts","../src/state/post-reducer/when-moving/file:/D:/Github/draggable/src/state/post-reducer/when-moving/refresh-snap.ts","../src/state/file:/D:/Github/draggable/src/state/get-home-location.ts","../src/state/file:/D:/Github/draggable/src/state/get-lift-effect.ts","../src/state/file:/D:/Github/draggable/src/state/patch-dimension-map.ts","../src/debug/file:/D:/Github/draggable/src/debug/timings.ts","../src/state/publish-while-dragging-in-virtual/file:/D:/Github/draggable/src/state/publish-while-dragging-in-virtual/offset-draggable.ts","../src/state/file:/D:/Github/draggable/src/state/get-frame.ts","../src/state/publish-while-dragging-in-virtual/file:/D:/Github/draggable/src/state/publish-while-dragging-in-virtual/adjust-additions-for-scroll-changes.ts","../src/state/publish-while-dragging-in-virtual/file:/D:/Github/draggable/src/state/publish-while-dragging-in-virtual/index.ts","../src/state/file:/D:/Github/draggable/src/state/reducer.ts","../src/state/file:/D:/Github/draggable/src/state/action-creators.ts","../src/state/middleware/util/file:/D:/Github/draggable/src/state/middleware/util/validate-dimensions.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/lift.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/style.ts","../src/file:/D:/Github/draggable/src/animation.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/get-drop-duration.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/get-new-home-client-offset.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/get-drop-impact.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/drop-middleware.ts","../node_modules/raf-schd/dist/raf-schd.esm.js","../src/view/window/file:/D:/Github/draggable/src/view/window/get-window-scroll.ts","../src/view/file:/D:/Github/draggable/src/view/scroll-listener.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/scroll-listener.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/expiring-announce.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/async-marshal.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/is-equal.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/publisher.ts","../src/state/middleware/responders/file:/D:/Github/draggable/src/state/middleware/responders/responders-middleware.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/drop-animation-finish-middleware.ts","../src/state/middleware/drop/file:/D:/Github/draggable/src/state/middleware/drop/drop-animation-flush-on-scroll-middleware.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/dimension-marshal-stopper.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/focus.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/auto-scroll.ts","../src/state/middleware/file:/D:/Github/draggable/src/state/middleware/pending-drop.ts","../src/state/file:/D:/Github/draggable/src/state/create-store.ts","../src/state/dimension-marshal/file:/D:/Github/draggable/src/state/dimension-marshal/while-dragging-publisher.ts","../src/state/file:/D:/Github/draggable/src/state/get-max-scroll.ts","../src/view/file:/D:/Github/draggable/src/view/get-document-element.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/get-max-window-scroll.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/get-viewport.ts","../src/state/dimension-marshal/file:/D:/Github/draggable/src/state/dimension-marshal/get-initial-publish.ts","../src/state/dimension-marshal/file:/D:/Github/draggable/src/state/dimension-marshal/dimension-marshal.ts","../src/state/file:/D:/Github/draggable/src/state/can-start-drag.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/scroll-window.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-best-scrollable-droppable.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/config.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-distance-thresholds.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-percentage.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/min-scroll.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value-from-distance.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/dampen-value-by-time.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/index.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/adjust-for-size-limits.ts","../src/state/auto-scroller/fluid-scroller/get-scroll/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-scroll/index.ts","../src/state/auto-scroller/file:/D:/Github/draggable/src/state/auto-scroller/can-scroll.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-window-scroll-change.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/get-droppable-scroll-change.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/scroll.ts","../src/state/auto-scroller/fluid-scroller/file:/D:/Github/draggable/src/state/auto-scroller/fluid-scroller/index.ts","../src/state/auto-scroller/file:/D:/Github/draggable/src/state/auto-scroller/jump-scroller.ts","../src/state/auto-scroller/file:/D:/Github/draggable/src/state/auto-scroller/index.ts","../src/view/file:/D:/Github/draggable/src/view/data-attributes.ts","../src/view/use-style-marshal/file:/D:/Github/draggable/src/view/use-style-marshal/get-styles.ts","../src/view/file:/D:/Github/draggable/src/view/use-isomorphic-layout-effect.ts","../src/view/use-style-marshal/file:/D:/Github/draggable/src/view/use-style-marshal/use-style-marshal.ts","../src/view/window/file:/D:/Github/draggable/src/view/window/get-window-from-el.ts","../src/view/is-type-of-element/file:/D:/Github/draggable/src/view/is-type-of-element/is-html-element.ts","../src/view/get-elements/file:/D:/Github/draggable/src/view/get-elements/find-drag-handle.ts","../src/view/use-focus-marshal/file:/D:/Github/draggable/src/view/use-focus-marshal/use-focus-marshal.ts","../src/state/registry/file:/D:/Github/draggable/src/state/registry/create-registry.ts","../src/state/registry/file:/D:/Github/draggable/src/state/registry/use-registry.ts","../src/view/context/file:/D:/Github/draggable/src/view/context/store-context.ts","../src/view/file:/D:/Github/draggable/src/view/get-body-element.ts","../src/view/file:/D:/Github/draggable/src/view/visually-hidden-style.ts","../src/view/use-announcer/file:/D:/Github/draggable/src/view/use-announcer/use-announcer.ts","../src/view/file:/D:/Github/draggable/src/view/use-unique-id.ts","../src/view/use-hidden-text-element/file:/D:/Github/draggable/src/view/use-hidden-text-element/use-hidden-text-element.ts","../src/view/context/file:/D:/Github/draggable/src/view/context/app-context.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/check-react-version.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/check-doctype.ts","../src/view/file:/D:/Github/draggable/src/view/use-dev.ts","../src/view/file:/D:/Github/draggable/src/view/use-dev-setup-warning.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/use-startup-validation.ts","../src/view/file:/D:/Github/draggable/src/view/use-previous-ref.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/lock.ts","../src/view/file:/D:/Github/draggable/src/view/key-codes.ts","../src/view/use-sensor-marshal/sensors/util/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/util/prevent-standard-key-events.ts","../src/view/use-sensor-marshal/sensors/util/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/util/supported-page-visibility-event-name.ts","../src/view/use-sensor-marshal/sensors/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/use-mouse-sensor.ts","../src/view/use-sensor-marshal/sensors/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/use-keyboard-sensor.ts","../src/view/use-sensor-marshal/sensors/file:/D:/Github/draggable/src/view/use-sensor-marshal/sensors/use-touch-sensor.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/use-validate-sensor-hooks.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/is-event-in-interactive-element.ts","../src/view/file:/D:/Github/draggable/src/view/get-border-box-center-position.ts","../src/view/is-type-of-element/file:/D:/Github/draggable/src/view/is-type-of-element/is-element.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/closest.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/find-closest-draggable-id-from-event.ts","../src/view/get-elements/file:/D:/Github/draggable/src/view/get-elements/find-draggable.ts","../src/view/use-sensor-marshal/file:/D:/Github/draggable/src/view/use-sensor-marshal/use-sensor-marshal.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/app.tsx","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/use-unique-context-id.ts","../src/view/drag-drop-context/file:/D:/Github/draggable/src/view/drag-drop-context/drag-drop-context.tsx","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-closest-scrollable.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/check-for-nested-scroll-container.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-scroll.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-env.ts","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/get-droppable.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-dimension.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/get-listener-options.ts","../src/view/file:/D:/Github/draggable/src/view/use-required-context.ts","../src/view/use-droppable-publisher/file:/D:/Github/draggable/src/view/use-droppable-publisher/use-droppable-publisher.ts","../src/view/placeholder/file:/D:/Github/draggable/src/view/placeholder/placeholder.tsx","../src/view/context/file:/D:/Github/draggable/src/view/context/droppable-context.ts","../src/view/file:/D:/Github/draggable/src/view/check-is-valid-inner-ref.ts","../src/view/droppable/file:/D:/Github/draggable/src/view/droppable/use-validation.ts","../src/view/animate-in-out/file:/D:/Github/draggable/src/view/animate-in-out/animate-in-out.tsx","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/get-style.ts","../src/view/use-draggable-publisher/file:/D:/Github/draggable/src/view/use-draggable-publisher/get-dimension.ts","../src/view/use-draggable-publisher/file:/D:/Github/draggable/src/view/use-draggable-publisher/use-draggable-publisher.ts","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/use-validation.ts","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/draggable.tsx","../src/state/droppable/file:/D:/Github/draggable/src/state/droppable/what-is-dragged-over-from-result.ts","../src/view/context/file:/D:/Github/draggable/src/view/context/hooks.ts","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/connected-draggable.tsx","../src/view/draggable/file:/D:/Github/draggable/src/view/draggable/draggable-api.tsx","../src/view/droppable/file:/D:/Github/draggable/src/view/droppable/droppable.tsx","../src/view/droppable/file:/D:/Github/draggable/src/view/droppable/connected-droppable.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n if (trackActualOwner) {\n var previousStackTraceLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = 10;\n var debugStackDEV = Error(\"react-stack-top-frame\");\n Error.stackTraceLimit = previousStackTraceLimit;\n } else debugStackDEV = unknownOwnerDebugStack;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n debugStackDEV,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n if (trackActualOwner) {\n var previousStackTraceLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = 10;\n var debugStackDEV = Error(\"react-stack-top-frame\");\n Error.stackTraceLimit = previousStackTraceLimit;\n } else debugStackDEV = unknownOwnerDebugStack;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n debugStackDEV,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","// @flow\n\nconst isProduction: boolean = process.env.NODE_ENV === 'production';\n\n// not replacing newlines (which \\s does)\nconst spacesAndTabs: RegExp = /[ \\t]{2,}/g;\nconst lineStartWithSpaces: RegExp = /^[ \\t]*/gm;\n\n// using .trim() to clear the any newlines before the first text and after last text\nconst clean = (value: string): string =>\n value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();\n\nconst getDevMessage = (message: string): string =>\n clean(`\n %creact-beautiful-dnd\n\n %c${clean(message)}\n\n %c👷‍ This is a development only message. It will be removed in production builds.\n`);\n\nexport const getFormattedMessage = (message: string): string[] => [\n getDevMessage(message),\n // title (green400)\n 'color: #00C584; font-size: 1.2em; font-weight: bold;',\n // message\n 'line-height: 1.5',\n // footer (purple300)\n 'color: #723874;',\n];\n\nconst isDisabledFlag: string = '__react-beautiful-dnd-disable-dev-warnings';\n\nexport function log(type: 'error' | 'warn', message: string) {\n // no warnings in production\n if (isProduction) {\n return;\n }\n\n // manual opt out of warnings\n if (typeof window !== 'undefined' && window[isDisabledFlag as any]) {\n return;\n }\n\n // eslint-disable-next-line no-console\n console[type](...getFormattedMessage(message));\n}\n\nexport const warning = log.bind(null, 'warn');\nexport const error = log.bind(null, 'error');\n","// @flow\nexport function noop(): void {}\n\nexport function identity<T>(value: T): T {\n return value;\n}\n","// @flow\nimport type { EventBinding, EventOptions } from './event-types';\n\ntype UnbindFn = () => void;\n\nfunction getOptions(\n shared?: EventOptions | null,\n fromBinding?: EventOptions | null,\n): EventOptions {\n return {\n ...shared,\n ...fromBinding,\n };\n}\n\nexport default function bindEvents(\n el: HTMLElement | Window,\n bindings: EventBinding[],\n sharedOptions: EventOptions,\n): () => void {\n const unbindings: UnbindFn[] = bindings.map(\n (binding: EventBinding): UnbindFn => {\n const options: Object = getOptions(sharedOptions, binding.options);\n\n el.addEventListener(binding.eventName, binding.fn as EventListenerOrEventListenerObject, options);\n\n return function unbind() {\n el.removeEventListener(binding.eventName, binding.fn as EventListenerOrEventListenerObject, options);\n };\n },\n );\n\n // Return a function to unbind events\n return function unbindAll() {\n unbindings.forEach((unbind: UnbindFn) => {\n unbind();\n });\n };\n}\n","// @flow\n/* eslint-disable no-restricted-syntax */\nconst isProduction: boolean = process.env.NODE_ENV === 'production';\nconst prefix: string = 'Invariant failed';\n\n// Want to use this:\n// export class RbdInvariant extends Error { }\n// But it causes babel to bring in a lot of code\n\n// export function RbdInvariant(message: string) {\n// this.message = message;\n// }\n// // $FlowFixMe\n// RbdInvariant.prototype.toString = function toString() {\n// return this.message;\n// };\n\n// // A copy-paste of tiny-invariant but with a custom error type\n// // Throw an error if the condition fails\n// export function invariant(condition: unknown, message?: string) {\n// if (condition) {\n// return;\n// }\n\n// if (isProduction) {\n// // In production we strip the message but still throw\n// throw new RbdInvariant(prefix);\n// } else {\n// // When not in production we allow the message to pass through\n// // *This block will be removed in production builds*\n// throw new RbdInvariant(`${prefix}: ${message || ''}`);\n// }\n// }\n\n\nexport class RbdInvariant extends Error {\n constructor(message: string) {\n super(message);\n\n this.name = 'RbdInvariant';\n\n // Required for correct prototype chain in some JS targets\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n// A copy-paste of tiny-invariant but with a custom error type\n// Throw an error if the condition fails\nexport function invariant(\n condition: unknown,\n message?: string,\n): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n // In production we strip the message but still throw\n throw new RbdInvariant(prefix);\n } else {\n // In development we allow the message to pass through\n throw new RbdInvariant(`${prefix}: ${message || ''}`);\n }\n}","// @flow\nimport React, { type ReactNode } from 'react';\nimport { warning, error } from '../../dev-warning';\nimport { noop } from '../../empty';\nimport bindEvents from '../event-bindings/bind-events';\nimport { RbdInvariant } from '../../invariant';\nimport type { AppCallbacks } from './drag-drop-context-types';\n\n// Exact\ntype Props = {\n children: (setCallbacks: (callbacks: AppCallbacks) => void) => ReactNode,\n};\n\n// Lame that this is not in flow\ntype ErrorEvent = Event & {\n error: Error | null,\n};\n\nexport default class ErrorBoundary extends React.Component<Props> {\n callbacks: AppCallbacks | null = null;\n unbind: () => void = noop;\n\n componentDidMount() {\n this.unbind = bindEvents(window, [\n {\n eventName: 'error',\n fn: this.onWindowError,\n },\n ], {});\n }\n\n componentDidCatch(err: Error) {\n if (err instanceof RbdInvariant) {\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n\n this.setState({});\n return;\n }\n\n // throwing error for other error boundaries\n // eslint-disable-next-line no-restricted-syntax\n throw err;\n }\n\n componentWillUnmount() {\n this.unbind();\n }\n\n onWindowError = (event: ErrorEvent) => {\n const callbacks: AppCallbacks = this.getCallbacks();\n\n if (callbacks.isDragging()) {\n callbacks.tryAbort();\n warning(`\n An error was caught by our window 'error' event listener while a drag was occurring.\n The active drag has been aborted.\n `);\n }\n\n const err: Error | null = event.error;\n\n if (err instanceof RbdInvariant) {\n // Marking the event as dealt with.\n // This will prevent any 'uncaught' error warnings in the console\n event.preventDefault();\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n }\n };\n\n getCallbacks = (): AppCallbacks => {\n if (!this.callbacks) {\n // eslint-disable-next-line no-restricted-syntax\n throw new Error('Unable to find AppCallbacks in <ErrorBoundary/>');\n }\n return this.callbacks;\n };\n\n setCallbacks = (callbacks: AppCallbacks) => {\n this.callbacks = callbacks;\n };\n\n render() {\n return this.props.children(this.setCallbacks);\n }\n}\n","// @flow\nimport type {\n DraggableId,\n DragStart,\n DragUpdate,\n DropResult,\n DraggableLocation,\n Combine,\n} from './types';\n\n// Exact\nexport type MessagePreset = {\n dragHandleUsageInstructions: string,\n onDragStart: (start: DragStart) => string,\n onDragUpdate: (update: DragUpdate) => string,\n onDragEnd: (result: DropResult) => string,\n};\n\nconst dragHandleUsageInstructions: string = `\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n`;\n\nconst position = (index: number): number => index + 1;\n\n// We cannot list what index the Droppable is in automatically as we are not sure how\n// the Droppable's have been configured\nconst onDragStart = (start: DragStart): string => `\n You have lifted an item in position ${position(start.source.index)}\n`;\n\nconst withLocation = (\n source: DraggableLocation,\n destination: DraggableLocation,\n) => {\n const isInHomeList: boolean = source.droppableId === destination.droppableId;\n\n const startPosition: number = position(source.index);\n const endPosition: number = position(destination.index);\n\n if (isInHomeList) {\n return `\n You have moved the item from position ${startPosition}\n to position ${endPosition}\n `;\n }\n\n return `\n You have moved the item from position ${startPosition}\n in list ${source.droppableId}\n to list ${destination.droppableId}\n in position ${endPosition}\n `;\n};\n\nconst withCombine = (\n id: DraggableId,\n source: DraggableLocation,\n combine: Combine,\n): string => {\n const inHomeList: boolean = source.droppableId === combine.droppableId;\n\n if (inHomeList) {\n return `\n The item ${id}\n has been combined with ${combine.draggableId}`;\n }\n\n return `\n The item ${id}\n in list ${source.droppableId}\n has been combined with ${combine.draggableId}\n in list ${combine.droppableId}\n `;\n};\n\nconst onDragUpdate = (update: DragUpdate): string => {\n const location: DraggableLocation | null = update.destination;\n if (location) {\n return withLocation(update.source, location);\n }\n\n const combine: Combine | null = update.combine;\n if (combine) {\n return withCombine(update.draggableId, update.source, combine);\n }\n\n return 'You are over an area that cannot be dropped on';\n};\n\nconst returnedToStart = (source: DraggableLocation): string => `\n The item has returned to its starting position\n of ${position(source.index)}\n`;\n\nconst onDragEnd = (result: DropResult): string => {\n if (result.reason === 'CANCEL') {\n return `\n Movement cancelled.\n ${returnedToStart(result.source)}\n `;\n }\n\n const location: DraggableLocation | null = result.destination;\n const combine: Combine | null = result.combine;\n\n if (location) {\n return `\n You have dropped the item.\n ${withLocation(result.source, location)}\n `;\n }\n\n if (combine) {\n return `\n You have dropped the item.\n ${withCombine(result.draggableId, result.source, combine)}\n `;\n }\n\n return `\n The item has been dropped while not over a drop area.\n ${returnedToStart(result.source)}\n `;\n};\n\nconst preset: MessagePreset = {\n dragHandleUsageInstructions,\n onDragStart,\n onDragUpdate,\n onDragEnd,\n};\n\nexport default preset;\n","/**\n * @license React\n * use-sync-external-store-with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","import * as React from \"react\";\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/with-selector.js\";\n//#region src/utils/react-is.ts\nconst IS_REACT_19 = /* @__PURE__ */ React.version.startsWith(\"19\");\nconst REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(IS_REACT_19 ? \"react.transitional.element\" : \"react.element\");\nconst REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for(\"react.portal\");\nconst REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for(\"react.fragment\");\nconst REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for(\"react.strict_mode\");\nconst REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for(\"react.profiler\");\nconst REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for(\"react.consumer\");\nconst REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for(\"react.context\");\nconst REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for(\"react.forward_ref\");\nconst REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for(\"react.suspense\");\nconst REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(\"react.suspense_list\");\nconst REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for(\"react.memo\");\nconst REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for(\"react.lazy\");\nconst REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for(\"react.offscreen\");\nconst REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(\"react.client.reference\");\nconst ForwardRef = REACT_FORWARD_REF_TYPE;\nconst Memo = REACT_MEMO_TYPE;\nfunction isValidElementType(type) {\n\treturn typeof type === \"string\" || typeof type === \"function\" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE || typeof type === \"object\" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0) ? !0 : !1;\n}\nfunction typeOf(object) {\n\tif (typeof object === \"object\" && object !== null) {\n\t\tconst { $$typeof } = object;\n\t\tswitch ($$typeof) {\n\t\t\tcase REACT_ELEMENT_TYPE: switch (object = object.type, object) {\n\t\t\t\tcase REACT_FRAGMENT_TYPE:\n\t\t\t\tcase REACT_PROFILER_TYPE:\n\t\t\t\tcase REACT_STRICT_MODE_TYPE:\n\t\t\t\tcase REACT_SUSPENSE_TYPE:\n\t\t\t\tcase REACT_SUSPENSE_LIST_TYPE: return object;\n\t\t\t\tdefault: switch (object = object && object.$$typeof, object) {\n\t\t\t\t\tcase REACT_CONTEXT_TYPE:\n\t\t\t\t\tcase REACT_FORWARD_REF_TYPE:\n\t\t\t\t\tcase REACT_LAZY_TYPE:\n\t\t\t\t\tcase REACT_MEMO_TYPE: return object;\n\t\t\t\t\tcase REACT_CONSUMER_TYPE: return object;\n\t\t\t\t\tdefault: return $$typeof;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase REACT_PORTAL_TYPE: return $$typeof;\n\t\t}\n\t}\n}\nfunction isContextConsumer(object) {\n\treturn IS_REACT_19 ? typeOf(object) === REACT_CONSUMER_TYPE : typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isMemo(object) {\n\treturn typeOf(object) === REACT_MEMO_TYPE;\n}\n//#endregion\n//#region src/utils/warning.ts\n/**\n* Prints a warning in the console if it exists.\n*\n* @param {String} message The warning message.\n* @returns {void}\n*/\nfunction warning(message) {\n\tif (typeof console !== \"undefined\" && typeof console.error === \"function\") console.error(message);\n\ttry {\n\t\tthrow new Error(message);\n\t} catch (e) {}\n}\n//#endregion\n//#region src/connect/verifySubselectors.ts\nfunction verify(selector, methodName) {\n\tif (!selector) throw new Error(`Unexpected value for ${methodName} in connect.`);\n\telse if (methodName === \"mapStateToProps\" || methodName === \"mapDispatchToProps\") {\n\t\tif (!Object.prototype.hasOwnProperty.call(selector, \"dependsOnOwnProps\")) warning(`The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`);\n\t}\n}\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {\n\tverify(mapStateToProps, \"mapStateToProps\");\n\tverify(mapDispatchToProps, \"mapDispatchToProps\");\n\tverify(mergeProps, \"mergeProps\");\n}\n//#endregion\n//#region src/connect/selectorFactory.ts\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, { areStatesEqual, areOwnPropsEqual, areStatePropsEqual }) {\n\tlet hasRunAtLeastOnce = false;\n\tlet state;\n\tlet ownProps;\n\tlet stateProps;\n\tlet dispatchProps;\n\tlet mergedProps;\n\tfunction handleFirstCall(firstState, firstOwnProps) {\n\t\tstate = firstState;\n\t\townProps = firstOwnProps;\n\t\tstateProps = mapStateToProps(state, ownProps);\n\t\tdispatchProps = mapDispatchToProps(dispatch, ownProps);\n\t\tmergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\thasRunAtLeastOnce = true;\n\t\treturn mergedProps;\n\t}\n\tfunction handleNewPropsAndNewState() {\n\t\tstateProps = mapStateToProps(state, ownProps);\n\t\tif (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\t\tmergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\treturn mergedProps;\n\t}\n\tfunction handleNewProps() {\n\t\tif (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\t\tif (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\t\tmergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\treturn mergedProps;\n\t}\n\tfunction handleNewState() {\n\t\tconst nextStateProps = mapStateToProps(state, ownProps);\n\t\tconst statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n\t\tstateProps = nextStateProps;\n\t\tif (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\treturn mergedProps;\n\t}\n\tfunction handleSubsequentCalls(nextState, nextOwnProps) {\n\t\tconst propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n\t\tconst stateChanged = !areStatesEqual(nextState, state, nextOwnProps, ownProps);\n\t\tstate = nextState;\n\t\townProps = nextOwnProps;\n\t\tif (propsChanged && stateChanged) return handleNewPropsAndNewState();\n\t\tif (propsChanged) return handleNewProps();\n\t\tif (stateChanged) return handleNewState();\n\t\treturn mergedProps;\n\t}\n\treturn function pureFinalPropsSelector(nextState, nextOwnProps) {\n\t\treturn hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n\t};\n}\nfunction finalPropsSelectorFactory(dispatch, { initMapStateToProps, initMapDispatchToProps, initMergeProps, ...options }) {\n\tconst mapStateToProps = initMapStateToProps(dispatch, options);\n\tconst mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n\tconst mergeProps = initMergeProps(dispatch, options);\n\tif (process.env.NODE_ENV !== \"production\") verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps);\n\treturn pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n//#endregion\n//#region src/utils/bindActionCreators.ts\nfunction bindActionCreators(actionCreators, dispatch) {\n\tconst boundActionCreators = {};\n\tfor (const key in actionCreators) {\n\t\tconst actionCreator = actionCreators[key];\n\t\tif (typeof actionCreator === \"function\") boundActionCreators[key] = (...args) => dispatch(actionCreator(...args));\n\t}\n\treturn boundActionCreators;\n}\n//#endregion\n//#region src/utils/isPlainObject.ts\n/**\n* @param {any} obj The object to inspect.\n* @returns {boolean} True if the argument appears to be a plain object.\n*/\nfunction isPlainObject(obj) {\n\tif (typeof obj !== \"object\" || obj === null) return false;\n\tconst proto = Object.getPrototypeOf(obj);\n\tif (proto === null) return true;\n\tlet baseProto = proto;\n\twhile (Object.getPrototypeOf(baseProto) !== null) baseProto = Object.getPrototypeOf(baseProto);\n\treturn proto === baseProto;\n}\n//#endregion\n//#region src/utils/verifyPlainObject.ts\nfunction verifyPlainObject(value, displayName, methodName) {\n\tif (!isPlainObject(value)) warning(`${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`);\n}\n//#endregion\n//#region src/connect/wrapMapToProps.ts\nfunction wrapMapToPropsConstant(getConstant) {\n\treturn function initConstantSelector(dispatch) {\n\t\tconst constant = getConstant(dispatch);\n\t\tfunction constantSelector() {\n\t\t\treturn constant;\n\t\t}\n\t\tconstantSelector.dependsOnOwnProps = false;\n\t\treturn constantSelector;\n\t};\n}\nfunction getDependsOnOwnProps(mapToProps) {\n\treturn mapToProps.dependsOnOwnProps != null ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n\treturn function initProxySelector(dispatch, { displayName }) {\n\t\tconst proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t\t\treturn proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0);\n\t\t};\n\t\tproxy.dependsOnOwnProps = true;\n\t\tproxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t\t\tproxy.mapToProps = mapToProps;\n\t\t\tproxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t\t\tlet props = proxy(stateOrDispatch, ownProps);\n\t\t\tif (typeof props === \"function\") {\n\t\t\t\tproxy.mapToProps = props;\n\t\t\t\tproxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t\t\t\tprops = proxy(stateOrDispatch, ownProps);\n\t\t\t}\n\t\t\tif (process.env.NODE_ENV !== \"production\") verifyPlainObject(props, displayName, methodName);\n\t\t\treturn props;\n\t\t};\n\t\treturn proxy;\n\t};\n}\n//#endregion\n//#region src/connect/invalidArgFactory.ts\nfunction createInvalidArgFactory(arg, name) {\n\treturn (dispatch, options) => {\n\t\tthrow new Error(`Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`);\n\t};\n}\n//#endregion\n//#region src/connect/mapDispatchToProps.ts\nfunction mapDispatchToPropsFactory(mapDispatchToProps) {\n\treturn mapDispatchToProps && typeof mapDispatchToProps === \"object\" ? wrapMapToPropsConstant((dispatch) => bindActionCreators(mapDispatchToProps, dispatch)) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({ dispatch })) : typeof mapDispatchToProps === \"function\" ? wrapMapToPropsFunc(mapDispatchToProps, \"mapDispatchToProps\") : createInvalidArgFactory(mapDispatchToProps, \"mapDispatchToProps\");\n}\n//#endregion\n//#region src/connect/mapStateToProps.ts\nfunction mapStateToPropsFactory(mapStateToProps) {\n\treturn !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === \"function\" ? wrapMapToPropsFunc(mapStateToProps, \"mapStateToProps\") : createInvalidArgFactory(mapStateToProps, \"mapStateToProps\");\n}\n//#endregion\n//#region src/connect/mergeProps.ts\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n\treturn {\n\t\t...ownProps,\n\t\t...stateProps,\n\t\t...dispatchProps\n\t};\n}\nfunction wrapMergePropsFunc(mergeProps) {\n\treturn function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) {\n\t\tlet hasRunOnce = false;\n\t\tlet mergedProps;\n\t\treturn function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n\t\t\tconst nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\t\t\tif (hasRunOnce) {\n\t\t\t\tif (!areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n\t\t\t} else {\n\t\t\t\thasRunOnce = true;\n\t\t\t\tmergedProps = nextMergedProps;\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") verifyPlainObject(mergedProps, displayName, \"mergeProps\");\n\t\t\t}\n\t\t\treturn mergedProps;\n\t\t};\n\t};\n}\nfunction mergePropsFactory(mergeProps) {\n\treturn !mergeProps ? () => defaultMergeProps : typeof mergeProps === \"function\" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, \"mergeProps\");\n}\n//#endregion\n//#region src/utils/batch.ts\nfunction defaultNoopBatch(callback) {\n\tcallback();\n}\n//#endregion\n//#region src/utils/Subscription.ts\nfunction createListenerCollection() {\n\tlet first = null;\n\tlet last = null;\n\treturn {\n\t\tclear() {\n\t\t\tfirst = null;\n\t\t\tlast = null;\n\t\t},\n\t\tnotify() {\n\t\t\tdefaultNoopBatch(() => {\n\t\t\t\tlet listener = first;\n\t\t\t\twhile (listener) {\n\t\t\t\t\tlistener.callback();\n\t\t\t\t\tlistener = listener.next;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tget() {\n\t\t\tconst listeners = [];\n\t\t\tlet listener = first;\n\t\t\twhile (listener) {\n\t\t\t\tlisteners.push(listener);\n\t\t\t\tlistener = listener.next;\n\t\t\t}\n\t\t\treturn listeners;\n\t\t},\n\t\tsubscribe(callback) {\n\t\t\tlet isSubscribed = true;\n\t\t\tconst listener = last = {\n\t\t\t\tcallback,\n\t\t\t\tnext: null,\n\t\t\t\tprev: last\n\t\t\t};\n\t\t\tif (listener.prev) listener.prev.next = listener;\n\t\t\telse first = listener;\n\t\t\treturn function unsubscribe() {\n\t\t\t\tif (!isSubscribed || first === null) return;\n\t\t\t\tisSubscribed = false;\n\t\t\t\tif (listener.next) listener.next.prev = listener.prev;\n\t\t\t\telse last = listener.prev;\n\t\t\t\tif (listener.prev) listener.prev.next = listener.next;\n\t\t\t\telse first = listener.next;\n\t\t\t};\n\t\t}\n\t};\n}\nconst nullListeners = {\n\tnotify() {},\n\tget: () => []\n};\nfunction createSubscription(store, parentSub) {\n\tlet unsubscribe;\n\tlet listeners = nullListeners;\n\tlet subscriptionsAmount = 0;\n\tlet selfSubscribed = false;\n\tfunction addNestedSub(listener) {\n\t\ttrySubscribe();\n\t\tconst cleanupListener = listeners.subscribe(listener);\n\t\tlet removed = false;\n\t\treturn () => {\n\t\t\tif (!removed) {\n\t\t\t\tremoved = true;\n\t\t\t\tcleanupListener();\n\t\t\t\ttryUnsubscribe();\n\t\t\t}\n\t\t};\n\t}\n\tfunction notifyNestedSubs() {\n\t\tlisteners.notify();\n\t}\n\tfunction handleChangeWrapper() {\n\t\tif (subscription.onStateChange) subscription.onStateChange();\n\t}\n\tfunction isSubscribed() {\n\t\treturn selfSubscribed;\n\t}\n\tfunction trySubscribe() {\n\t\tsubscriptionsAmount++;\n\t\tif (!unsubscribe) {\n\t\t\tunsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n\t\t\tlisteners = createListenerCollection();\n\t\t}\n\t}\n\tfunction tryUnsubscribe() {\n\t\tsubscriptionsAmount--;\n\t\tif (unsubscribe && subscriptionsAmount === 0) {\n\t\t\tunsubscribe();\n\t\t\tunsubscribe = void 0;\n\t\t\tlisteners.clear();\n\t\t\tlisteners = nullListeners;\n\t\t}\n\t}\n\tfunction trySubscribeSelf() {\n\t\tif (!selfSubscribed) {\n\t\t\tselfSubscribed = true;\n\t\t\ttrySubscribe();\n\t\t}\n\t}\n\tfunction tryUnsubscribeSelf() {\n\t\tif (selfSubscribed) {\n\t\t\tselfSubscribed = false;\n\t\t\ttryUnsubscribe();\n\t\t}\n\t}\n\tconst subscription = {\n\t\taddNestedSub,\n\t\tnotifyNestedSubs,\n\t\thandleChangeWrapper,\n\t\tisSubscribed,\n\t\ttrySubscribe: trySubscribeSelf,\n\t\ttryUnsubscribe: tryUnsubscribeSelf,\n\t\tgetListeners: () => listeners\n\t};\n\treturn subscription;\n}\n//#endregion\n//#region src/utils/useIsomorphicLayoutEffect.ts\nconst canUseDOM = () => !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nconst isDOM = /* @__PURE__ */ canUseDOM();\n/**\n* Checks if the code is running in a React Native environment.\n*\n* @returns Whether the code is running in a React Native environment.\n*\n* @see {@link https://github.com/facebook/react-native/issues/1331 Reference}\n*/\nconst isRunningInReactNative = () => typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\";\nconst isReactNative = /* @__PURE__ */ isRunningInReactNative();\nconst getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React.useLayoutEffect : React.useEffect;\nconst useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();\n//#endregion\n//#region src/utils/shallowEqual.ts\nfunction is(x, y) {\n\tif (x === y) return x !== 0 || y !== 0 || 1 / x === 1 / y;\n\telse return x !== x && y !== y;\n}\nfunction shallowEqual(objA, objB) {\n\tif (is(objA, objB)) return true;\n\tif (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) return false;\n\tconst keysA = Object.keys(objA);\n\tconst keysB = Object.keys(objB);\n\tif (keysA.length !== keysB.length) return false;\n\tfor (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/utils/hoistStatics.ts\nconst REACT_STATICS = {\n\tchildContextTypes: true,\n\tcontextType: true,\n\tcontextTypes: true,\n\tdefaultProps: true,\n\tdisplayName: true,\n\tgetDefaultProps: true,\n\tgetDerivedStateFromError: true,\n\tgetDerivedStateFromProps: true,\n\tmixins: true,\n\tpropTypes: true,\n\ttype: true\n};\nconst KNOWN_STATICS = {\n\tname: true,\n\tlength: true,\n\tprototype: true,\n\tcaller: true,\n\tcallee: true,\n\targuments: true,\n\tarity: true\n};\nconst FORWARD_REF_STATICS = {\n\t$$typeof: true,\n\trender: true,\n\tdefaultProps: true,\n\tdisplayName: true,\n\tpropTypes: true\n};\nconst MEMO_STATICS = {\n\t$$typeof: true,\n\tcompare: true,\n\tdefaultProps: true,\n\tdisplayName: true,\n\tpropTypes: true,\n\ttype: true\n};\nconst TYPE_STATICS = {\n\t[ForwardRef]: FORWARD_REF_STATICS,\n\t[Memo]: MEMO_STATICS\n};\nfunction getStatics(component) {\n\tif (isMemo(component)) return MEMO_STATICS;\n\treturn TYPE_STATICS[component[\"$$typeof\"]] || REACT_STATICS;\n}\nconst defineProperty = Object.defineProperty;\nconst getOwnPropertyNames = Object.getOwnPropertyNames;\nconst getOwnPropertySymbols = Object.getOwnPropertySymbols;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent) {\n\tif (typeof sourceComponent !== \"string\") {\n\t\tif (objectPrototype) {\n\t\t\tconst inheritedComponent = getPrototypeOf(sourceComponent);\n\t\t\tif (inheritedComponent && inheritedComponent !== objectPrototype) hoistNonReactStatics(targetComponent, inheritedComponent);\n\t\t}\n\t\tlet keys = getOwnPropertyNames(sourceComponent);\n\t\tif (getOwnPropertySymbols) keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n\t\tconst targetStatics = getStatics(targetComponent);\n\t\tconst sourceStatics = getStatics(sourceComponent);\n\t\tfor (let i = 0; i < keys.length; ++i) {\n\t\t\tconst key = keys[i];\n\t\t\tif (!KNOWN_STATICS[key] && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n\t\t\t\tconst descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\t\t\t\ttry {\n\t\t\t\t\tdefineProperty(targetComponent, key, descriptor);\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\t\t}\n\t}\n\treturn targetComponent;\n}\n//#endregion\n//#region src/components/Context.ts\nconst ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);\nconst gT = typeof globalThis !== \"undefined\" ? globalThis : {};\nfunction getContext() {\n\tif (!React.createContext) return {};\n\tconst contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();\n\tlet realContext = contextMap.get(React.createContext);\n\tif (!realContext) {\n\t\trealContext = React.createContext(null);\n\t\tif (process.env.NODE_ENV !== \"production\") realContext.displayName = \"ReactRedux\";\n\t\tcontextMap.set(React.createContext, realContext);\n\t}\n\treturn realContext;\n}\nconst ReactReduxContext = /*#__PURE__*/ getContext();\n//#endregion\n//#region src/components/connect.tsx\nconst NO_SUBSCRIPTION_ARRAY = [null, null];\nconst stringifyComponent = (Comp) => {\n\ttry {\n\t\treturn JSON.stringify(Comp);\n\t} catch (err) {\n\t\treturn String(Comp);\n\t}\n};\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n\tuseIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);\n}\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n\tlastWrapperProps.current = wrapperProps;\n\trenderIsScheduled.current = false;\n\tif (childPropsFromStoreUpdate.current) {\n\t\tchildPropsFromStoreUpdate.current = null;\n\t\tnotifyNestedSubs();\n\t}\n}\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener, displayName) {\n\tif (!shouldHandleStateChanges) return () => {};\n\tlet didUnsubscribe = false;\n\tlet lastThrownError = null;\n\tconst checkForUpdates = () => {\n\t\tif (didUnsubscribe || !isMounted.current) return;\n\t\tconst latestStoreState = store.getState();\n\t\tlet newChildProps, error;\n\t\ttry {\n\t\t\tnewChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t\tlastThrownError = e;\n\t\t\tif (process.env.NODE_ENV !== \"production\") console.error(`An error occurred in \\`mapStateToProps\\` (or a selector) of the \\`connect()\\`-ed component \"${displayName}\". See https://github.com/reduxjs/react-redux/issues/1942 for details.`, e);\n\t\t}\n\t\tif (!error) lastThrownError = null;\n\t\tif (newChildProps === lastChildProps.current) {\n\t\t\tif (!renderIsScheduled.current) notifyNestedSubs();\n\t\t} else {\n\t\t\tlastChildProps.current = newChildProps;\n\t\t\tchildPropsFromStoreUpdate.current = newChildProps;\n\t\t\trenderIsScheduled.current = true;\n\t\t\tadditionalSubscribeListener();\n\t\t}\n\t};\n\tsubscription.onStateChange = checkForUpdates;\n\tsubscription.trySubscribe();\n\tcheckForUpdates();\n\tconst unsubscribeWrapper = () => {\n\t\tdidUnsubscribe = true;\n\t\tsubscription.tryUnsubscribe();\n\t\tsubscription.onStateChange = null;\n\t\tif (lastThrownError) throw lastThrownError;\n\t};\n\treturn unsubscribeWrapper;\n}\nfunction strictEqual(a, b) {\n\treturn a === b;\n}\nlet hasWarnedAboutDeprecatedPureOption = false;\n/**\n* @deprecated\n*\n* **We recommend using the `useSelector` and `useDispatch` hooks instead.**\n* See https://react-redux.js.org/api/hooks\n*\n* If you need to use `connect` without this visual deprecation warning,\n* import `legacy_connect` instead:\n*\n* `import { legacy_connect as connect } from 'react-redux'`\n*\n* Connects a React component to a Redux store.\n*\n* - Without arguments, just wraps the component, without changing the behavior / props\n*\n* - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior\n* is to override ownProps (as stated in the docs), so what remains is everything that's\n* not a state or dispatch prop\n*\n* - When 3rd param is passed, we don't know if ownProps propagate and whether they\n* should be valid component props, because it depends on mergeProps implementation.\n* As such, it is the user's responsibility to extend ownProps interface from state or\n* dispatch props or both when applicable\n*\n* @param mapStateToProps A function that extracts values from state\n* @param mapDispatchToProps Setup for dispatching actions\n* @param mergeProps Optional callback to merge state and dispatch props together\n* @param options Options for configuring the connection\n*\n*/\nfunction _connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areStatesEqual = strictEqual, areOwnPropsEqual = shallowEqual, areStatePropsEqual = shallowEqual, areMergedPropsEqual = shallowEqual, forwardRef = false, context = ReactReduxContext } = {}) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (pure !== void 0 && !hasWarnedAboutDeprecatedPureOption) {\n\t\t\thasWarnedAboutDeprecatedPureOption = true;\n\t\t\twarning(\"The `pure` option has been removed. `connect` is now always a \\\"pure/memoized\\\" component\");\n\t\t}\n\t}\n\tconst Context = context;\n\tconst initMapStateToProps = mapStateToPropsFactory(mapStateToProps);\n\tconst initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);\n\tconst initMergeProps = mergePropsFactory(mergeProps);\n\tconst shouldHandleStateChanges = Boolean(mapStateToProps);\n\tconst wrapWithConnect = (WrappedComponent) => {\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!/* @__PURE__ */ isValidElementType(WrappedComponent)) throw new Error(`You must pass a component to the function returned by connect. Instead received ${stringifyComponent(WrappedComponent)}`);\n\t\t}\n\t\tconst wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n\t\tconst displayName = `Connect(${wrappedComponentName})`;\n\t\tconst selectorFactoryOptions = {\n\t\t\tshouldHandleStateChanges,\n\t\t\tdisplayName,\n\t\t\twrappedComponentName,\n\t\t\tWrappedComponent,\n\t\t\tinitMapStateToProps,\n\t\t\tinitMapDispatchToProps,\n\t\t\tinitMergeProps,\n\t\t\tareStatesEqual,\n\t\t\tareStatePropsEqual,\n\t\t\tareOwnPropsEqual,\n\t\t\tareMergedPropsEqual\n\t\t};\n\t\tfunction ConnectFunction(props) {\n\t\t\tconst [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => {\n\t\t\t\tconst { reactReduxForwardedRef, ...wrapperProps } = props;\n\t\t\t\treturn [\n\t\t\t\t\tprops.context,\n\t\t\t\t\treactReduxForwardedRef,\n\t\t\t\t\twrapperProps\n\t\t\t\t];\n\t\t\t}, [props]);\n\t\t\tconst ContextToUse = React.useMemo(() => {\n\t\t\t\tlet ResultContext = Context;\n\t\t\t\tif (propsContext?.Consumer) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\t\t\tif (!/* @__PURE__ */ isContextConsumer(/* @__PURE__ */ React.createElement(propsContext.Consumer, null))) throw new Error(\"You must pass a valid React context consumer as `props.context`\");\n\t\t\t\t\t}\n\t\t\t\t\tResultContext = propsContext;\n\t\t\t\t}\n\t\t\t\treturn ResultContext;\n\t\t\t}, [propsContext, Context]);\n\t\t\tconst contextValue = React.useContext(ContextToUse);\n\t\t\tconst didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n\t\t\tconst didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\t\t\tif (process.env.NODE_ENV !== \"production\" && !didStoreComeFromProps && !didStoreComeFromContext) throw new Error(`Could not find \"store\" in the context of \"${displayName}\". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${displayName} in connect options.`);\n\t\t\tconst store = didStoreComeFromProps ? props.store : contextValue.store;\n\t\t\tconst getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;\n\t\t\tconst childPropsSelector = React.useMemo(() => {\n\t\t\t\treturn finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);\n\t\t\t}, [store]);\n\t\t\tconst [subscription, notifyNestedSubs] = React.useMemo(() => {\n\t\t\t\tif (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY;\n\t\t\t\tconst subscription = createSubscription(store, didStoreComeFromProps ? void 0 : contextValue.subscription);\n\t\t\t\treturn [subscription, subscription.notifyNestedSubs.bind(subscription)];\n\t\t\t}, [\n\t\t\t\tstore,\n\t\t\t\tdidStoreComeFromProps,\n\t\t\t\tcontextValue\n\t\t\t]);\n\t\t\tconst overriddenContextValue = React.useMemo(() => {\n\t\t\t\tif (didStoreComeFromProps) return contextValue;\n\t\t\t\treturn {\n\t\t\t\t\t...contextValue,\n\t\t\t\t\tsubscription\n\t\t\t\t};\n\t\t\t}, [\n\t\t\t\tdidStoreComeFromProps,\n\t\t\t\tcontextValue,\n\t\t\t\tsubscription\n\t\t\t]);\n\t\t\tconst lastChildProps = React.useRef(void 0);\n\t\t\tconst lastWrapperProps = React.useRef(wrapperProps);\n\t\t\tconst childPropsFromStoreUpdate = React.useRef(void 0);\n\t\t\tconst renderIsScheduled = React.useRef(false);\n\t\t\tconst isMounted = React.useRef(false);\n\t\t\t/**\n\t\t\t* @todo Change this to `React.useRef<Error>(undefined)` after upgrading to React 19.\n\t\t\t*/\n\t\t\tconst latestSubscriptionCallbackError = React.useRef(void 0);\n\t\t\tuseIsomorphicLayoutEffect(() => {\n\t\t\t\tisMounted.current = true;\n\t\t\t\treturn () => {\n\t\t\t\t\tisMounted.current = false;\n\t\t\t\t};\n\t\t\t}, []);\n\t\t\tconst actualChildPropsSelector = React.useMemo(() => {\n\t\t\t\tconst selector = () => {\n\t\t\t\t\tif (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) return childPropsFromStoreUpdate.current;\n\t\t\t\t\treturn childPropsSelector(store.getState(), wrapperProps);\n\t\t\t\t};\n\t\t\t\treturn selector;\n\t\t\t}, [store, wrapperProps]);\n\t\t\tconst subscribeForReact = React.useMemo(() => {\n\t\t\t\tconst subscribe = (reactListener) => {\n\t\t\t\t\tif (!subscription) return () => {};\n\t\t\t\t\treturn subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener, displayName);\n\t\t\t\t};\n\t\t\t\treturn subscribe;\n\t\t\t}, [subscription]);\n\t\t\tuseIsomorphicLayoutEffectWithArgs(captureWrapperProps, [\n\t\t\t\tlastWrapperProps,\n\t\t\t\tlastChildProps,\n\t\t\t\trenderIsScheduled,\n\t\t\t\twrapperProps,\n\t\t\t\tchildPropsFromStoreUpdate,\n\t\t\t\tnotifyNestedSubs\n\t\t\t]);\n\t\t\tlet actualChildProps;\n\t\t\ttry {\n\t\t\t\tactualChildProps = React.useSyncExternalStore(subscribeForReact, actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector);\n\t\t\t} catch (err) {\n\t\t\t\tif (latestSubscriptionCallbackError.current) err.message += `\\nThe error may be correlated with this previous error:\\n${latestSubscriptionCallbackError.current.stack}\\n\\n`;\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tuseIsomorphicLayoutEffect(() => {\n\t\t\t\tlatestSubscriptionCallbackError.current = void 0;\n\t\t\t\tchildPropsFromStoreUpdate.current = void 0;\n\t\t\t\tlastChildProps.current = actualChildProps;\n\t\t\t});\n\t\t\tconst renderedWrappedComponent = React.useMemo(() => {\n\t\t\t\tconst effectiveProps = { ...actualChildProps };\n\t\t\t\tif (forwardRef) effectiveProps.ref = reactReduxForwardedRef;\n\t\t\t\treturn /* @__PURE__ */ React.createElement(WrappedComponent, effectiveProps);\n\t\t\t}, [\n\t\t\t\treactReduxForwardedRef,\n\t\t\t\tWrappedComponent,\n\t\t\t\tactualChildProps\n\t\t\t]);\n\t\t\treturn React.useMemo(() => {\n\t\t\t\tif (shouldHandleStateChanges) return /* @__PURE__ */ React.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent);\n\t\t\t\treturn renderedWrappedComponent;\n\t\t\t}, [\n\t\t\t\tContextToUse,\n\t\t\t\trenderedWrappedComponent,\n\t\t\t\toverriddenContextValue\n\t\t\t]);\n\t\t}\n\t\tconst Connect = React.memo(ConnectFunction);\n\t\tConnect.WrappedComponent = WrappedComponent;\n\t\tConnect.displayName = ConnectFunction.displayName = displayName;\n\t\tif (forwardRef) {\n\t\t\tconst forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n\t\t\t\treturn /* @__PURE__ */ React.createElement(Connect, {\n\t\t\t\t\t...props,\n\t\t\t\t\treactReduxForwardedRef: ref\n\t\t\t\t});\n\t\t\t});\n\t\t\tforwarded.displayName = displayName;\n\t\t\tforwarded.WrappedComponent = WrappedComponent;\n\t\t\treturn /*#__PURE__*/ hoistNonReactStatics(forwarded, WrappedComponent);\n\t\t}\n\t\treturn /*#__PURE__*/ hoistNonReactStatics(Connect, WrappedComponent);\n\t};\n\treturn wrapWithConnect;\n}\n/**\n* * @deprecated\n*\n* **We recommend using the `useSelector` and `useDispatch` hooks instead.**\n* See https://react-redux.js.org/api/hooks\n*\n* If you need to use `connect` without this visual deprecation warning,\n* import `legacy_connect` instead:\n*\n* `import { legacy_connect as connect } from 'react-redux'`\n*/\nconst connect = _connect;\n/**\n* Connects a React component to a Redux store. Same as `connect` but without\n* the deprecation warning.\n*\n* **We recommend using the `useSelector` and `useDispatch` hooks instead.**\n* See https://react-redux.js.org/api/hooks\n*/\nconst legacy_connect = _connect;\n//#endregion\n//#region src/components/Provider.tsx\nfunction Provider(providerProps) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (typeof useIsomorphicLayoutEffect !== \"function\") throw new Error(\"The React Redux `<Provider>` component requires React hooks that are not available in a React Server Component. This usually means you are rendering `<Provider>` in a Server Component. Add the `\\\"use client\\\"` directive to the top of the file that renders `<Provider>` (or a parent that ends up rendering it) so it is treated as a Client Component. See https://react.dev/reference/rsc/use-client for more information.\");\n\t}\n\tconst { children, context, serverState, store } = providerProps;\n\tconst contextValue = React.useMemo(() => {\n\t\tconst subscription = createSubscription(store);\n\t\tconst baseContextValue = {\n\t\t\tstore,\n\t\t\tsubscription,\n\t\t\tgetServerState: serverState != null ? () => serverState : void 0\n\t\t};\n\t\tif (process.env.NODE_ENV === \"production\") return baseContextValue;\n\t\telse {\n\t\t\tconst { identityFunctionCheck = \"once\", stabilityCheck = \"once\" } = providerProps;\n\t\t\treturn /* @__PURE__ */ Object.assign(baseContextValue, {\n\t\t\t\tstabilityCheck,\n\t\t\t\tidentityFunctionCheck\n\t\t\t});\n\t\t}\n\t}, [store, serverState]);\n\tconst previousState = React.useMemo(() => store.getState(), [store]);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconst { subscription } = contextValue;\n\t\tsubscription.onStateChange = subscription.notifyNestedSubs;\n\t\tsubscription.trySubscribe();\n\t\tif (previousState !== store.getState()) subscription.notifyNestedSubs();\n\t\treturn () => {\n\t\t\tsubscription.tryUnsubscribe();\n\t\t\tsubscription.onStateChange = void 0;\n\t\t};\n\t}, [contextValue, previousState]);\n\tconst Context = context || ReactReduxContext;\n\treturn /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children);\n}\n//#endregion\n//#region src/hooks/useReduxContext.ts\n/**\n* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level\n* hook that you should usually not need to call directly.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useReduxContext` hook bound to the specified context.\n*/\nfunction createReduxContextHook(context = ReactReduxContext) {\n\treturn function useReduxContext() {\n\t\tconst contextValue = React.useContext(context);\n\t\tif (process.env.NODE_ENV !== \"production\" && !contextValue) throw new Error(\"could not find react-redux context value; please ensure the component is wrapped in a <Provider>\");\n\t\treturn contextValue;\n\t};\n}\n/**\n* A hook to access the value of the `ReactReduxContext`. This is a low-level\n* hook that you should usually not need to call directly.\n*\n* @returns {any} the value of the `ReactReduxContext`\n*\n* @example\n*\n* import React from 'react'\n* import { useReduxContext } from 'react-redux'\n*\n* export const CounterComponent = () => {\n* const { store } = useReduxContext()\n* return <div>{store.getState()}</div>\n* }\n*/\nconst useReduxContext = /*#__PURE__*/ createReduxContextHook();\n//#endregion\n//#region src/hooks/useStore.ts\n/**\n* Hook factory, which creates a `useStore` hook bound to a given context.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useStore` hook bound to the specified context.\n*/\nfunction createStoreHook(context = ReactReduxContext) {\n\tconst useReduxContext$2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n\tconst useStore = () => {\n\t\tconst { store } = useReduxContext$2();\n\t\treturn store;\n\t};\n\tObject.assign(useStore, { withTypes: () => useStore });\n\treturn useStore;\n}\n/**\n* A hook to access the redux store.\n*\n* @returns {any} the redux store\n*\n* @example\n*\n* import React from 'react'\n* import { useStore } from 'react-redux'\n*\n* export const ExampleComponent = () => {\n* const store = useStore()\n* return <div>{store.getState()}</div>\n* }\n*/\nconst useStore = /*#__PURE__*/ createStoreHook();\n//#endregion\n//#region src/hooks/useDispatch.ts\n/**\n* Hook factory, which creates a `useDispatch` hook bound to a given context.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useDispatch` hook bound to the specified context.\n*/\nfunction createDispatchHook(context = ReactReduxContext) {\n\tconst useStore$1 = context === ReactReduxContext ? useStore : createStoreHook(context);\n\tconst useDispatch = () => {\n\t\treturn useStore$1().dispatch;\n\t};\n\tObject.assign(useDispatch, { withTypes: () => useDispatch });\n\treturn useDispatch;\n}\n/**\n* A hook to access the redux `dispatch` function.\n*\n* @returns {any|function} redux store's `dispatch` function\n*\n* @example\n*\n* import React, { useCallback } from 'react'\n* import { useDispatch } from 'react-redux'\n*\n* export const CounterComponent = ({ value }) => {\n* const dispatch = useDispatch()\n* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\n* return (\n* <div>\n* <span>{value}</span>\n* <button onClick={increaseCounter}>Increase counter</button>\n* </div>\n* )\n* }\n*/\nconst useDispatch = /*#__PURE__*/ createDispatchHook();\n//#endregion\n//#region src/hooks/useSelector.ts\nconst refEquality = (a, b) => a === b;\n/**\n* Hook factory, which creates a `useSelector` hook bound to a given context.\n*\n* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\n* @returns {Function} A `useSelector` hook bound to the specified context.\n*/\nfunction createSelectorHook(context = ReactReduxContext) {\n\tconst useReduxContext$1 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n\tconst useSelector = (selector, equalityFnOrOptions = {}) => {\n\t\tconst { equalityFn = refEquality } = typeof equalityFnOrOptions === \"function\" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!selector) throw new Error(`You must pass a selector to useSelector`);\n\t\t\tif (typeof selector !== \"function\") throw new Error(`You must pass a function as a selector to useSelector`);\n\t\t\tif (typeof equalityFn !== \"function\") throw new Error(`You must pass a function as an equality function to useSelector`);\n\t\t}\n\t\tconst reduxContext = useReduxContext$1();\n\t\tconst { store, subscription, getServerState } = reduxContext;\n\t\tconst firstRun = React.useRef(true);\n\t\tconst wrappedSelector = React.useCallback({ [selector.name](state) {\n\t\t\tconst selected = selector(state);\n\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\tconst { devModeChecks = {} } = typeof equalityFnOrOptions === \"function\" ? {} : equalityFnOrOptions;\n\t\t\t\tconst { identityFunctionCheck, stabilityCheck } = reduxContext;\n\t\t\t\tconst { identityFunctionCheck: finalIdentityFunctionCheck, stabilityCheck: finalStabilityCheck } = {\n\t\t\t\t\tstabilityCheck,\n\t\t\t\t\tidentityFunctionCheck,\n\t\t\t\t\t...devModeChecks\n\t\t\t\t};\n\t\t\t\tif (finalStabilityCheck === \"always\" || finalStabilityCheck === \"once\" && firstRun.current) {\n\t\t\t\t\tconst toCompare = selector(state);\n\t\t\t\t\tif (!equalityFn(selected, toCompare)) {\n\t\t\t\t\t\tlet stack = void 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new Error();\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t({stack} = e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconsole.warn(\"Selector \" + (selector.name || \"unknown\") + \" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization\", {\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tselected,\n\t\t\t\t\t\t\tselected2: toCompare,\n\t\t\t\t\t\t\tstack\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (finalIdentityFunctionCheck === \"always\" || finalIdentityFunctionCheck === \"once\" && firstRun.current) {\n\t\t\t\t\tif (selected === state) {\n\t\t\t\t\t\tlet stack = void 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new Error();\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t({stack} = e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconsole.warn(\"Selector \" + (selector.name || \"unknown\") + \" returned the root state when called. This can lead to unnecessary rerenders.\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.\", { stack });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (firstRun.current) firstRun.current = false;\n\t\t\t}\n\t\t\treturn selected;\n\t\t} }[selector.name], [selector]);\n\t\tconst selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);\n\t\tReact.useDebugValue(selectedState);\n\t\treturn selectedState;\n\t};\n\tObject.assign(useSelector, { withTypes: () => useSelector });\n\treturn useSelector;\n}\n/**\n* A hook to access the redux store's state. This hook takes a selector function\n* as an argument. The selector is called with the store state.\n*\n* This hook takes an optional equality comparison function as the second parameter\n* that allows you to customize the way the selected state is compared to determine\n* whether the component needs to be re-rendered.\n*\n* @param {Function} selector the selector function\n* @param {Function=} equalityFn the function that will be used to determine equality\n*\n* @returns {any} the selected state\n*\n* @example\n*\n* import React from 'react'\n* import { useSelector } from 'react-redux'\n*\n* export const CounterComponent = () => {\n* const counter = useSelector(state => state.counter)\n* return <div>{counter}</div>\n* }\n*/\nconst useSelector = /*#__PURE__*/ createSelectorHook();\n//#endregion\n//#region src/exports.ts\n/**\n* @deprecated As of React 18, batching is enabled by default for ReactDOM and React Native.\n* This is now a no-op that immediately runs the callback.\n*/\nconst batch = defaultNoopBatch;\n//#endregion\nexport { Provider, ReactReduxContext, batch, connect, createDispatchHook, createSelectorHook, createStoreHook, legacy_connect, shallowEqual, useDispatch, useSelector, useStore };\n\n//# sourceMappingURL=react-redux.mjs.map","import { useState, useRef, useEffect } from 'react';\n\n// @flow\nfunction areInputsEqual(newInputs, lastInputs) {\n // no checks needed if the inputs length has changed\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n // Using for loop for speed. It generally performs better than array.every\n // https://github.com/alexreardon/memoize-one/pull/59\n let i = 0;\n for (i; i < newInputs.length; i++) {\n // using shallow equality check\n if (newInputs[i] !== lastInputs[i]) {\n return false;\n }\n }\n return true;\n}\n\n// @flow\nfunction useMemoOne(\n// getResult changes on every call,\ngetResult, \n// the inputs array changes on every call\ninputs) {\n // using useState to generate initial value as it is lazy\n const initial = useState(() => ({\n inputs,\n result: getResult(),\n }))[0];\n const isFirstRun = useRef(true);\n const committed = useRef(initial);\n // persist any uncommitted changes after they have been committed\n const useCache = isFirstRun.current ||\n Boolean(inputs &&\n committed.current.inputs &&\n areInputsEqual(inputs, committed.current.inputs));\n // create a new cache if required\n const cache = useCache\n ? committed.current\n : {\n inputs,\n result: getResult(),\n };\n // commit the cache\n useEffect(() => {\n isFirstRun.current = false;\n committed.current = cache;\n }, [cache]);\n return cache.result;\n}\nfunction useCallbackOne(\n// getResult changes on every call,\ncallback, \n// the inputs array changes on every call\ninputs) {\n return useMemoOne(() => callback, inputs);\n}\n// Aliased exports\n// A drop in replacement for useMemo and useCallback that plays\n// very well with eslint-plugin-react-hooks\nconst useMemo = useMemoOne;\nconst useCallback = useCallbackOne;\n\nexport { useCallback, useCallbackOne, useMemo, useMemoOne };\n","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? \"keys\" : \"key\"} \"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. Expected to find one of the known reducer keys instead: \"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : \"(unknown type)\"}, the slice reducer for key \"${key}\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","// @flow\nimport { type Position } from 'css-box-model';\n\nexport const origin: Position = { x: 0, y: 0 };\n\nexport const add = (point1: Position, point2: Position): Position => ({\n x: point1.x + point2.x,\n y: point1.y + point2.y,\n});\n\nexport const subtract = (point1: Position, point2: Position): Position => ({\n x: point1.x - point2.x,\n y: point1.y - point2.y,\n});\n\nexport const isEqual = (point1: Position, point2: Position): boolean =>\n point1.x === point2.x && point1.y === point2.y;\n\nexport const negate = (point: Position): Position => ({\n // if the value is already 0, do not return -0\n x: point.x !== 0 ? -point.x : 0,\n y: point.y !== 0 ? -point.y : 0,\n});\n\n// Allows you to build a position from values.\n// Really useful when working with the Axis type\n// patch('x', 5) = { x: 5, y: 0 }\n// patch('y', 5, 1) = { x: 1, y: 5 }\nexport const patch = (\n line: 'x' | 'y',\n value: number,\n otherValue: number = 0,\n): Position => {\n const result: Position = {\n x: 0,\n y: 0,\n };\n \n // set the value of 'x', or 'y'\n result[line] = value;\n\n // set the value of the other line\n result[line === 'x' ? 'y' : 'x'] = otherValue;\n return result;\n};\n\n// Returns the distance between two points\n// https://www.mathsisfun.com/algebra/distance-2-points.html\nexport const distance = (point1: Position, point2: Position): number =>\n Math.sqrt(\n Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2),\n );\n\n// When given a list of points, it finds the smallest distance to any point\nexport const closest = (target: Position, points: Position[]): number =>\n Math.min(...points.map((point: Position) => distance(target, point)));\n\n// used to apply any function to both values of a point\n// eg: const floor = apply(Math.floor)(point);\nexport const apply = (fn: (value: number) => number) => (\n point: Position,\n): Position => ({\n x: fn(point.x),\n y: fn(point.y),\n});\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import invariant from 'tiny-invariant';\n\nvar getRect = function getRect(_ref) {\n var top = _ref.top,\n right = _ref.right,\n bottom = _ref.bottom,\n left = _ref.left;\n var width = right - left;\n var height = bottom - top;\n var rect = {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: width,\n height: height,\n x: left,\n y: top,\n center: {\n x: (right + left) / 2,\n y: (bottom + top) / 2\n }\n };\n return rect;\n};\nvar expand = function expand(target, expandBy) {\n return {\n top: target.top - expandBy.top,\n left: target.left - expandBy.left,\n bottom: target.bottom + expandBy.bottom,\n right: target.right + expandBy.right\n };\n};\nvar shrink = function shrink(target, shrinkBy) {\n return {\n top: target.top + shrinkBy.top,\n left: target.left + shrinkBy.left,\n bottom: target.bottom - shrinkBy.bottom,\n right: target.right - shrinkBy.right\n };\n};\n\nvar shift = function shift(target, shiftBy) {\n return {\n top: target.top + shiftBy.y,\n left: target.left + shiftBy.x,\n bottom: target.bottom + shiftBy.y,\n right: target.right + shiftBy.x\n };\n};\n\nvar noSpacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n};\nvar createBox = function createBox(_ref2) {\n var borderBox = _ref2.borderBox,\n _ref2$margin = _ref2.margin,\n margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,\n _ref2$border = _ref2.border,\n border = _ref2$border === void 0 ? noSpacing : _ref2$border,\n _ref2$padding = _ref2.padding,\n padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;\n var marginBox = getRect(expand(borderBox, margin));\n var paddingBox = getRect(shrink(borderBox, border));\n var contentBox = getRect(shrink(paddingBox, padding));\n return {\n marginBox: marginBox,\n borderBox: getRect(borderBox),\n paddingBox: paddingBox,\n contentBox: contentBox,\n margin: margin,\n border: border,\n padding: padding\n };\n};\n\nvar parse = function parse(raw) {\n var value = raw.slice(0, -2);\n var suffix = raw.slice(-2);\n\n if (suffix !== 'px') {\n return 0;\n }\n\n var result = Number(value);\n !!isNaN(result) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not parse value [raw: \" + raw + \", without suffix: \" + value + \"]\") : invariant(false) : void 0;\n return result;\n};\n\nvar getWindowScroll = function getWindowScroll() {\n return {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n};\n\nvar offset = function offset(original, change) {\n var borderBox = original.borderBox,\n border = original.border,\n margin = original.margin,\n padding = original.padding;\n var shifted = shift(borderBox, change);\n return createBox({\n borderBox: shifted,\n border: border,\n margin: margin,\n padding: padding\n });\n};\nvar withScroll = function withScroll(original, scroll) {\n if (scroll === void 0) {\n scroll = getWindowScroll();\n }\n\n return offset(original, scroll);\n};\nvar calculateBox = function calculateBox(borderBox, styles) {\n var margin = {\n top: parse(styles.marginTop),\n right: parse(styles.marginRight),\n bottom: parse(styles.marginBottom),\n left: parse(styles.marginLeft)\n };\n var padding = {\n top: parse(styles.paddingTop),\n right: parse(styles.paddingRight),\n bottom: parse(styles.paddingBottom),\n left: parse(styles.paddingLeft)\n };\n var border = {\n top: parse(styles.borderTopWidth),\n right: parse(styles.borderRightWidth),\n bottom: parse(styles.borderBottomWidth),\n left: parse(styles.borderLeftWidth)\n };\n return createBox({\n borderBox: borderBox,\n margin: margin,\n padding: padding,\n border: border\n });\n};\nvar getBox = function getBox(el) {\n var borderBox = el.getBoundingClientRect();\n var styles = window.getComputedStyle(el);\n return calculateBox(borderBox, styles);\n};\n\nexport { calculateBox, createBox, expand, getBox, getRect, offset, shrink, withScroll };\n","// @flow\nimport { getRect, type Rect, type Spacing } from 'css-box-model';\n\nexport default (frame: Spacing, subject: Spacing): Rect | null => {\n const result: Rect = getRect({\n top: Math.max(subject.top, frame.top),\n right: Math.min(subject.right, frame.right),\n bottom: Math.min(subject.bottom, frame.bottom),\n left: Math.max(subject.left, frame.left),\n });\n\n if (result.width <= 0 || result.height <= 0) {\n return null;\n }\n\n return result;\n};\n","// @flow\nimport type { Spacing, Position } from 'css-box-model';\n\n// TODO add test\nexport const isEqual = (first: Spacing, second: Spacing): boolean =>\n first.top === second.top &&\n first.right === second.right &&\n first.bottom === second.bottom &&\n first.left === second.left;\n\nexport const offsetByPosition = (\n spacing: Spacing,\n point: Position,\n): Spacing => ({\n top: spacing.top + point.y,\n left: spacing.left + point.x,\n bottom: spacing.bottom + point.y,\n right: spacing.right + point.x,\n});\n\nexport const expandByPosition = (\n spacing: Spacing,\n position: Position,\n): Spacing => ({\n // pulling back to increase size\n top: spacing.top - position.y,\n left: spacing.left - position.x,\n // pushing forward to increase size\n right: spacing.right + position.x,\n bottom: spacing.bottom + position.y,\n});\n\nexport const getCorners = (spacing: Spacing): Position[] => [\n { x: spacing.left, y: spacing.top },\n { x: spacing.right, y: spacing.top },\n { x: spacing.left, y: spacing.bottom },\n { x: spacing.right, y: spacing.bottom },\n];\n\nexport const noSpacing: Spacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n};\n","// @flow\nimport { getRect, type Rect, type Spacing, type BoxModel } from 'css-box-model';\nimport type {\n Axis,\n Scrollable,\n DroppableSubject,\n PlaceholderInSubject,\n} from '../../../types';\nimport executeClip from './clip';\nimport { offsetByPosition } from '../../spacing';\n\nconst scroll = (target: Spacing, frame: Scrollable | null): Spacing => {\n if (!frame) {\n return target;\n }\n\n return offsetByPosition(target, frame.scroll.diff.displacement);\n};\n\nconst increase = (\n target: Spacing,\n axis: Axis,\n withPlaceholder: PlaceholderInSubject | null,\n): Spacing => {\n if (withPlaceholder && withPlaceholder.increasedBy) {\n return {\n ...target,\n [axis.end]: target[axis.end] + withPlaceholder.increasedBy[axis.line],\n };\n }\n return target;\n};\n\nconst clip = (target: Spacing, frame: Scrollable | null): Rect | null => {\n if (frame && frame.shouldClipSubject) {\n return executeClip(frame.pageMarginBox, target);\n }\n return getRect(target);\n};\n\ntype Args = {\n page: BoxModel,\n withPlaceholder: PlaceholderInSubject | null,\n axis: Axis,\n frame: Scrollable | null,\n};\n\nexport default ({\n page,\n withPlaceholder,\n axis,\n frame,\n}: Args): DroppableSubject => {\n const scrolled: Spacing = scroll(page.marginBox, frame);\n const increased: Spacing = increase(scrolled, axis, withPlaceholder);\n const clipped: Rect | null = clip(increased, frame);\n\n return {\n page,\n withPlaceholder,\n active: clipped,\n };\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport type {\n DroppableDimension,\n Scrollable,\n DroppableSubject,\n} from '../../types';\nimport { negate, subtract } from '../position';\nimport getSubject from './util/get-subject';\n\nexport default (\n droppable: DroppableDimension,\n newScroll: Position,\n): DroppableDimension => {\n invariant(droppable.frame);\n const scrollable: Scrollable = droppable.frame;\n\n const scrollDiff: Position = subtract(newScroll, scrollable.scroll.initial);\n // a positive scroll difference leads to a negative displacement\n // (scrolling down pulls an item upwards)\n const scrollDisplacement: Position = negate(scrollDiff);\n\n // Sometimes it is possible to scroll beyond the max point.\n // This can occur when scrolling a foreign list that now has a placeholder.\n\n const frame: Scrollable = {\n ...scrollable,\n scroll: {\n initial: scrollable.scroll.initial,\n current: newScroll,\n diff: {\n value: scrollDiff,\n displacement: scrollDisplacement,\n },\n // TODO: rename 'softMax?'\n max: scrollable.scroll.max,\n },\n };\n\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: droppable.subject.withPlaceholder,\n axis: droppable.axis,\n frame,\n });\n const result: DroppableDimension = {\n ...droppable,\n frame,\n subject,\n };\n return result;\n};\n","var safeIsNaN = Number.isNaN ||\n function ponyfill(value) {\n return typeof value === 'number' && value !== value;\n };\nfunction isEqual(first, second) {\n if (first === second) {\n return true;\n }\n if (safeIsNaN(first) && safeIsNaN(second)) {\n return true;\n }\n return false;\n}\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) { isEqual = areInputsEqual; }\n var cache = null;\n function memoized() {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {\n return cache.lastResult;\n }\n var lastResult = resultFn.apply(this, newArgs);\n cache = {\n lastResult: lastResult,\n lastArgs: newArgs,\n lastThis: this,\n };\n return lastResult;\n }\n memoized.clear = function clear() {\n cache = null;\n };\n return memoized;\n}\n\nexport { memoizeOne as default };\n","// @flow\n/* eslint-disable es5/no-es6-methods */\n/* eslint-disable es5/no-es6-static-methods */\n/* eslint-disable no-restricted-globals */\n\ntype Map<T> = {\n [key: string]: T,\n};\n\nexport function isInteger(value: unknown): boolean {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return (\n typeof value === 'number' && isFinite(value) && Math.floor(value) === value\n );\n}\n\n// Using this helper to ensure there are correct flow types\n// https://github.com/facebook/flow/issues/2221\nexport function values<T>(map: Map<T>): T[] {\n if (Object.values) {\n // $FlowFixMe - Object.values currently does not have good flow support\n return Object.values(map);\n }\n\n return Object.keys(map).map((key) => map[key]);\n}\n\n// Could also extend to pass index and list\ntype PredicateFn<T> = (value: T) => boolean;\n\n// TODO: swap order\nexport function findIndex<T>(\n list: Array<T>,\n predicate: PredicateFn<T>,\n): number {\n if (list.findIndex) {\n return list.findIndex(predicate);\n }\n\n // Using a for loop so that we can exit early\n for (let i = 0; i < list.length; i++) {\n if (predicate(list[i])) {\n return i;\n }\n }\n // Array.prototype.find returns -1 when nothing is found\n return -1;\n}\n\nexport function find<T>(list: Array<T>, predicate: PredicateFn<T>): T | undefined {\n if (list.find) {\n return list.find(predicate);\n }\n const index: number = findIndex(list, predicate);\n if (index !== -1) {\n return list[index];\n }\n // Array.prototype.find returns undefined when nothing is found\n return undefined;\n}\n\n// Using this rather than Array.from as Array.from adds 2kb to the gzip\n// document.querySelector actually returns Element[], but flow thinks it is HTMLElement[]\n// So we downcast the result to Element[]\nexport function toArray(list: NodeListOf<HTMLElement>): Element[] {\n return Array.prototype.slice.call(list);\n}\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { values } from '../native-with-fallback';\nimport type {\n DroppableDimension,\n DroppableDimensionMap,\n DraggableDimension,\n DraggableDimensionMap,\n} from '../types';\n\nexport const toDroppableMap = memoizeOne(\n (droppables: DroppableDimension[]): DroppableDimensionMap =>\n droppables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n }, {} as DroppableDimensionMap),\n);\n\nexport const toDraggableMap = memoizeOne(\n (draggables: DraggableDimension[]): DraggableDimensionMap =>\n draggables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n }, {} as DraggableDimensionMap),\n);\n\nexport const toDroppableList = memoizeOne(\n (droppables: DroppableDimensionMap): DroppableDimension[] =>\n values(droppables),\n);\n\nexport const toDraggableList = memoizeOne(\n (draggables: DraggableDimensionMap): DraggableDimension[] =>\n values(draggables),\n);\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { toDraggableList } from './dimension-structures';\nimport type {\n DraggableDimension,\n DroppableId,\n DraggableDimensionMap,\n} from '../types';\n\nexport default memoizeOne(\n (\n // using droppableId to avoid cache busted when we\n // update the droppable (such as when it scrolls)\n droppableId: DroppableId,\n draggables: DraggableDimensionMap,\n ): DraggableDimension[] => {\n const result = toDraggableList(draggables)\n .filter(\n (draggable: DraggableDimension): boolean =>\n droppableId === draggable.descriptor.droppableId,\n )\n // Dimensions are not guarenteed to be ordered in the same order as keys\n // So we need to sort them so they are in the correct order\n .sort(\n (a: DraggableDimension, b: DraggableDimension): number =>\n a.descriptor.index - b.descriptor.index,\n );\n\n return result;\n },\n);\n","// @flow\nimport type { DragImpact, DraggableLocation, Combine } from '../types';\n\nexport function tryGetDestination(impact: DragImpact): DraggableLocation | null {\n if (impact.at && impact.at.type === 'REORDER') {\n return impact.at.destination;\n }\n return null;\n}\n\nexport function tryGetCombine(impact: DragImpact): Combine | null {\n if (impact.at && impact.at.type === 'COMBINE') {\n return impact.at.combine;\n }\n return null;\n}\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport type { DraggableDimension } from '../types';\n\nexport default memoizeOne(\n (\n remove: DraggableDimension,\n list: DraggableDimension[],\n ): DraggableDimension[] =>\n list.filter(\n (item: DraggableDimension) => item.descriptor.id !== remove.descriptor.id,\n ),\n);\n","// @flow\nimport { invariant } from '../../../../invariant';\nimport type {\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n CombineImpact,\n DraggableLocation,\n DraggableId,\n} from '../../../../types';\nimport { tryGetDestination } from '../../../get-impact-location';\nimport { findIndex } from '../../../../native-with-fallback';\nimport removeDraggableFromList from '../../../remove-draggable-from-list';\n\n// Exact\nexport type Args = {\n isMovingForward: boolean,\n draggable: DraggableDimension,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n previousImpact: DragImpact,\n};\n\nexport default ({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact,\n}: Args): DragImpact | null => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n\n const location: DraggableLocation | null = tryGetDestination(previousImpact);\n\n if (!location) {\n return null;\n }\n\n function getImpact(target: DraggableId) {\n const at: CombineImpact = {\n type: 'COMBINE',\n combine: {\n draggableId: target,\n droppableId: destination.descriptor.id,\n },\n };\n return {\n ...previousImpact,\n at,\n };\n }\n\n const all: DraggableId[] = previousImpact.displaced.all;\n const closestId: DraggableId | null = all.length ? all[0] : null;\n\n if (isMovingForward) {\n return closestId ? getImpact(closestId) : null;\n }\n\n const withoutDraggable = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n // Moving backwards\n\n // if nothing is displaced - move backwards onto the last item\n if (!closestId) {\n if (!withoutDraggable.length) {\n return null;\n }\n const last: DraggableDimension =\n withoutDraggable[withoutDraggable.length - 1];\n return getImpact(last.descriptor.id);\n }\n\n // We are moving from being between two displaced items\n // backwards onto the first one\n\n // need to find the first item before the closest\n const indexOfClosest: number = findIndex(\n withoutDraggable,\n (d) => d.descriptor.id === closestId,\n );\n invariant(indexOfClosest !== -1, 'Could not find displaced item in set');\n\n const proposedIndex: number = indexOfClosest - 1;\n\n // There is no displaced item before\n if (proposedIndex < 0) {\n return null;\n }\n\n const before: DraggableDimension = withoutDraggable[proposedIndex];\n return getImpact(before.descriptor.id);\n};\n","// @flow\nimport type { DraggableDimension, DroppableDimension } from '../../types';\n\nexport default (\n draggable: DraggableDimension,\n destination: DroppableDimension,\n): boolean => draggable.descriptor.droppableId === destination.descriptor.id;\n","// @flow\nimport type {\n DisplacementGroups,\n DragImpact,\n DisplacedBy,\n LiftEffect,\n} from '../types';\nimport { origin } from './position';\n\nexport const noDisplacedBy: DisplacedBy = {\n point: origin,\n value: 0,\n};\n\nexport const emptyGroups: DisplacementGroups = {\n invisible: {},\n visible: {},\n all: [],\n};\n\nconst noImpact: DragImpact = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: null,\n};\n\nexport default noImpact;\n\nexport const noAfterCritical: LiftEffect = {\n inVirtualList: false,\n effected: {},\n displacedBy: noDisplacedBy,\n};\n","// @flow\n\n// is a value between two other values\n\nexport default (\n lowerBound: number,\n upperBound: number,\n): ((arg: number) => boolean) => (value: number): boolean =>\n lowerBound <= value && value <= upperBound;\n","// @flow\nimport { type Spacing } from 'css-box-model';\nimport isWithin from '../is-within';\n\nexport default (frame: Spacing) => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return (subject: Spacing) => {\n // situations where target is visible:\n // 1. is completely contained within frame\n // 2. is partially visible on both axis within frame\n // 3. is bigger than frame on both axis\n // 4. is bigger than frame on one axis and is partially visible on the other\n\n // completely contained\n const isContained: boolean =\n isWithinVertical(subject.top) &&\n isWithinVertical(subject.bottom) &&\n isWithinHorizontal(subject.left) &&\n isWithinHorizontal(subject.right);\n\n if (isContained) {\n return true;\n }\n\n const isPartiallyVisibleVertically: boolean =\n isWithinVertical(subject.top) || isWithinVertical(subject.bottom);\n const isPartiallyVisibleHorizontally: boolean =\n isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right);\n\n // partially visible on both axis\n const isPartiallyContained: boolean =\n isPartiallyVisibleVertically && isPartiallyVisibleHorizontally;\n\n if (isPartiallyContained) {\n return true;\n }\n\n const isBiggerVertically: boolean =\n subject.top < frame.top && subject.bottom > frame.bottom;\n const isBiggerHorizontally: boolean =\n subject.left < frame.left && subject.right > frame.right;\n\n // is bigger than frame on both axis\n const isTargetBiggerThanFrame: boolean =\n isBiggerVertically && isBiggerHorizontally;\n\n if (isTargetBiggerThanFrame) {\n return true;\n }\n\n // is bigger on one axis, and partially visible on another\n const isTargetBiggerOnOneAxis: boolean =\n (isBiggerVertically && isPartiallyVisibleHorizontally) ||\n (isBiggerHorizontally && isPartiallyVisibleVertically);\n\n return isTargetBiggerOnOneAxis;\n };\n};\n","// @flow\nimport { type Spacing } from 'css-box-model';\nimport isWithin from '../is-within';\n\nexport default (frame: Spacing) => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return (subject: Spacing) => {\n const isContained: boolean =\n isWithinVertical(subject.top) &&\n isWithinVertical(subject.bottom) &&\n isWithinHorizontal(subject.left) &&\n isWithinHorizontal(subject.right);\n\n return isContained;\n };\n};\n","// @flow\nimport type { HorizontalAxis, VerticalAxis } from '../types';\n\nexport const vertical: VerticalAxis = {\n direction: 'vertical',\n line: 'y',\n crossAxisLine: 'x',\n start: 'top',\n end: 'bottom',\n size: 'height',\n crossAxisStart: 'left',\n crossAxisEnd: 'right',\n crossAxisSize: 'width',\n};\n\nexport const horizontal: HorizontalAxis = {\n direction: 'horizontal',\n line: 'x',\n crossAxisLine: 'y',\n start: 'left',\n end: 'right',\n size: 'width',\n crossAxisStart: 'top',\n crossAxisEnd: 'bottom',\n crossAxisSize: 'height',\n};\n","// @flow\nimport { type Spacing } from 'css-box-model';\nimport type { Axis } from '../../types';\nimport isWithin from '../is-within';\nimport { vertical } from '../axis';\n\nexport default (axis: Axis) => (frame: Spacing) => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return (subject: Spacing) => {\n if (axis === vertical) {\n return isWithinVertical(subject.top) && isWithinVertical(subject.bottom);\n }\n return (\n isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right)\n );\n };\n};\n","// @flow\nimport { type Position, type Spacing, type Rect } from 'css-box-model';\nimport type { DroppableDimension } from '../../types';\nimport isPartiallyVisibleThroughFrame from './is-partially-visible-through-frame';\nimport isTotallyVisibleThroughFrame from './is-totally-visible-through-frame';\nimport isTotallyVisibleThroughFrameOnAxis from './is-totally-visible-through-frame-on-axis';\nimport { offsetByPosition } from '../spacing';\nimport { origin } from '../position';\n\n// Exact\nexport type Args = {\n target: Spacing,\n destination: DroppableDimension,\n viewport: Rect,\n withDroppableDisplacement: boolean,\n shouldCheckDroppable?: boolean,\n shouldCheckViewport?: boolean,\n};\n\ntype IsVisibleThroughFrameFn = (\n frame: Spacing,\n) => (subject: Spacing) => boolean;\n\ntype InternalArgs = Args & {\n isVisibleThroughFrameFn: IsVisibleThroughFrameFn,\n};\n\nconst getDroppableDisplaced = (\n target: Spacing,\n destination: DroppableDimension,\n): Spacing => {\n const displacement: Position = destination.frame\n ? destination.frame.scroll.diff.displacement\n : origin;\n\n return offsetByPosition(target, displacement);\n};\n\nconst isVisibleInDroppable = (\n target: Spacing,\n destination: DroppableDimension,\n isVisibleThroughFrameFn: IsVisibleThroughFrameFn,\n): boolean => {\n // destination subject is totally hidden by frame\n // this should never happen - but just guarding against it\n if (!destination.subject.active) {\n return false;\n }\n\n // When considering if the target is visible in the droppable we need\n // to consider the change in scroll of the droppable. We need to\n // adjust for the scroll as the clipped viewport takes into account\n // the scroll of the droppable.\n\n return isVisibleThroughFrameFn(destination.subject.active)(target);\n};\n\nconst isVisibleInViewport = (\n target: Spacing,\n viewport: Rect,\n isVisibleThroughFrameFn: IsVisibleThroughFrameFn,\n): boolean => isVisibleThroughFrameFn(viewport)(target);\n\nconst isVisible = ({\n target: toBeDisplaced,\n destination,\n viewport,\n withDroppableDisplacement,\n isVisibleThroughFrameFn,\n}: InternalArgs): boolean => {\n const displacedTarget: Spacing = withDroppableDisplacement\n ? getDroppableDisplaced(toBeDisplaced, destination)\n : toBeDisplaced;\n\n return (\n isVisibleInDroppable(\n displacedTarget,\n destination,\n isVisibleThroughFrameFn,\n ) && isVisibleInViewport(displacedTarget, viewport, isVisibleThroughFrameFn)\n );\n};\n\nexport const isPartiallyVisible = (args: Args): boolean =>\n isVisible({\n ...args,\n isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame,\n });\n\nexport const isTotallyVisible = (args: Args): boolean =>\n isVisible({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrame,\n });\n\nexport const isTotallyVisibleOnAxis = (args: Args): boolean =>\n isVisible({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrameOnAxis(\n args.destination.axis,\n ),\n });\n","// @flow\nimport { type Rect, type Spacing, expand, getRect } from 'css-box-model';\nimport type {\n DraggableId,\n Displacement,\n DraggableDimension,\n DroppableDimension,\n DisplacementGroups,\n DisplacedBy,\n} from '../types';\nimport { isPartiallyVisible } from './visibility/is-visible';\n\n// Exact\ntype Args = {\n afterDragging: DraggableDimension[],\n destination: DroppableDimension,\n displacedBy: DisplacedBy,\n last: DisplacementGroups | null,\n viewport: Rect,\n forceShouldAnimate?: boolean,\n};\n\nconst getShouldAnimate = (\n id: any,\n last: DisplacementGroups | null,\n forceShouldAnimate?: boolean,\n) => {\n // Use a forced value if provided\n if (typeof forceShouldAnimate === 'boolean') {\n return forceShouldAnimate;\n }\n\n // nothing to gauge animation from\n if (!last) {\n return true;\n }\n\n const { invisible, visible } = last;\n\n // it was previously invisible - no animation\n if (invisible[id]) {\n return false;\n }\n\n const previous: Displacement | null = visible[id];\n\n return previous ? previous.shouldAnimate : true;\n};\n\n// Note: it is also an optimisation to not render the displacement on\n// items when they are not longer visible.\n// This prevents a lot of .render() calls when leaving / entering a list\n\nfunction getTarget(\n draggable: DraggableDimension,\n displacedBy: DisplacedBy,\n): Rect {\n const marginBox: Rect = draggable.page.marginBox;\n\n // ## Visibility overscanning\n // We are expanding rather than offsetting the marginBox.\n // In some cases we want\n // - the target based on the starting position (such as when dropping outside of any list)\n // - the target based on the items position without starting displacement (such as when moving inside a list)\n // To keep things simple we just expand the whole area for this check\n // The worst case is some minor redundant offscreen movements\n const expandBy: Spacing = {\n // pull backwards into viewport\n top: displacedBy.point.y,\n right: 0,\n bottom: 0,\n // pull backwards into viewport\n left: displacedBy.point.x,\n };\n\n return getRect(expand(marginBox, expandBy));\n}\n\nexport default function getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy,\n viewport,\n forceShouldAnimate,\n last,\n}: Args): DisplacementGroups {\n return afterDragging.reduce(\n function process(\n groups: DisplacementGroups,\n draggable: DraggableDimension,\n ): DisplacementGroups {\n const target: Rect = getTarget(draggable, displacedBy);\n const id: DraggableId = draggable.descriptor.id;\n\n groups.all.push(id);\n\n const isVisible: boolean = isPartiallyVisible({\n target,\n destination,\n viewport,\n withDroppableDisplacement: true,\n });\n\n if (!isVisible) {\n groups.invisible[draggable.descriptor.id] = true;\n return groups;\n }\n\n // item is visible\n\n const shouldAnimate: boolean = getShouldAnimate(\n id,\n last,\n forceShouldAnimate,\n );\n\n const displacement: Displacement = {\n draggableId: id,\n shouldAnimate,\n };\n\n groups.visible[id] = displacement;\n return groups;\n },\n {\n all: [],\n visible: {},\n invisible: {},\n },\n );\n}\n","// @flow\nimport type {\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n DisplacementGroups,\n Viewport,\n DisplacedBy,\n} from '../../types';\nimport removeDraggableFromList from '../remove-draggable-from-list';\nimport isHomeOf from '../droppable/is-home-of';\nimport { emptyGroups } from '../no-impact';\nimport { find } from '../../native-with-fallback';\nimport getDisplacementGroups from '../get-displacement-groups';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n insideDestination: DraggableDimension[],\n destination: DroppableDimension,\n viewport: Viewport,\n displacedBy: DisplacedBy,\n last: DisplacementGroups,\n index: number | null,\n forceShouldAnimate?: boolean,\n};\n\nfunction getIndexOfLastItem(\n draggables: DraggableDimension[],\n options: { inHomeList: boolean }, // Exact\n): number {\n if (!draggables.length) {\n return 0;\n }\n\n const indexOfLastItem: number =\n draggables[draggables.length - 1].descriptor.index;\n\n // When in a foreign list there will be an additional one item in the list\n return options.inHomeList ? indexOfLastItem : indexOfLastItem + 1;\n}\n\n// Exact\ntype GoAtEndArgs = {\n insideDestination: DraggableDimension[],\n inHomeList: boolean,\n displacedBy: DisplacedBy,\n destination: DroppableDimension,\n};\n\nfunction goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination,\n}: GoAtEndArgs): DragImpact {\n const newIndex: number = getIndexOfLastItem(insideDestination, {\n inHomeList,\n });\n\n return {\n displaced: emptyGroups,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: newIndex,\n },\n },\n };\n}\n\nexport default function calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n last,\n index,\n forceShouldAnimate,\n}: Args): DragImpact {\n const inHomeList: boolean = isHomeOf(draggable, destination);\n\n // Go into last spot of list\n if (index == null) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination,\n });\n }\n\n // this might be the dragging item\n const match: DraggableDimension | null | undefined = find(\n insideDestination,\n (item: DraggableDimension) => item.descriptor.index === index,\n );\n\n if (!match) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination,\n });\n }\n const withoutDragging: DraggableDimension[] = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n const sliceFrom: number = insideDestination.indexOf(match);\n const impacted: DraggableDimension[] = withoutDragging.slice(sliceFrom);\n\n const displaced: DisplacementGroups = getDisplacementGroups({\n afterDragging: impacted,\n destination,\n displacedBy,\n last,\n viewport: viewport.frame,\n forceShouldAnimate,\n });\n\n return {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index,\n },\n },\n };\n}\n","// @flow\nimport type { DraggableId, LiftEffect } from '../types';\n\nexport default function didStartAfterCritical(\n draggableId: DraggableId,\n afterCritical: LiftEffect,\n): boolean {\n return Boolean(afterCritical.effected[draggableId]);\n}\n","// @flow\nimport type {\n DroppableDimension,\n Combine,\n DraggableDimension,\n DraggableDimensionMap,\n DisplacementGroups,\n DraggableId,\n LiftEffect,\n} from '../../../../types';\nimport didStartAfterCritical from '../../../did-start-after-critical';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n destination: DroppableDimension,\n displaced: DisplacementGroups,\n draggables: DraggableDimensionMap,\n combine: Combine,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n destination,\n draggables,\n combine,\n afterCritical,\n}: Args): number | null => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const combineId: DraggableId = combine.draggableId;\n const combineWith: DraggableDimension = draggables[combineId];\n const combineWithIndex: number = combineWith.descriptor.index;\n const didCombineWithStartAfterCritical: boolean = didStartAfterCritical(\n combineId,\n afterCritical,\n );\n\n if (didCombineWithStartAfterCritical) {\n if (isMovingForward) {\n return combineWithIndex;\n }\n return combineWithIndex - 1;\n }\n\n if (isMovingForward) {\n return combineWithIndex + 1;\n }\n\n return combineWithIndex;\n};\n","// @flow\nimport type { DraggableDimension, DraggableLocation } from '../../../../types';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n isInHomeList: boolean,\n location: DraggableLocation,\n insideDestination: DraggableDimension[],\n};\n\nexport default ({\n isMovingForward,\n isInHomeList,\n insideDestination,\n location,\n}: Args): number | null => {\n // cannot move in the list\n if (!insideDestination.length) {\n return null;\n }\n\n const currentIndex: number = location.index;\n const proposedIndex: number = isMovingForward\n ? currentIndex + 1\n : currentIndex - 1;\n\n // Accounting for lists that might not start with an index of 0\n const firstIndex: number = insideDestination[0].descriptor.index;\n const lastIndex: number =\n insideDestination[insideDestination.length - 1].descriptor.index;\n\n // When in foreign list we allow movement after the last item\n const upperBound: number = isInHomeList ? lastIndex : lastIndex + 1;\n\n if (proposedIndex < firstIndex) {\n return null;\n }\n if (proposedIndex > upperBound) {\n return null;\n }\n\n return proposedIndex;\n};\n","// @flow\nimport { invariant } from '../../../../invariant';\nimport type {\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DragImpact,\n LiftEffect,\n Viewport,\n ImpactLocation,\n} from '../../../../types';\nimport calculateReorderImpact from '../../../calculate-drag-impact/calculate-reorder-impact';\nimport fromCombine from './from-combine';\nimport fromReorder from './from-reorder';\n\n// Exact\nexport type Args = {\n isMovingForward: boolean,\n isInHomeList: boolean,\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n previousImpact: DragImpact,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical,\n}: Args): DragImpact | null => {\n const wasAt: ImpactLocation | null = previousImpact.at;\n invariant(wasAt, 'Cannot move in direction without previous impact location');\n\n if (wasAt.type === 'REORDER') {\n const newIndex: number | null = fromReorder({\n isMovingForward,\n isInHomeList,\n location: wasAt.destination,\n insideDestination,\n });\n // TODO: can we just pass new index on?\n if (newIndex == null) {\n return null;\n }\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex,\n });\n }\n\n // COMBINE\n const newIndex: number | null = fromCombine({\n isMovingForward,\n destination,\n displaced: previousImpact.displaced,\n draggables,\n combine: wasAt.combine,\n afterCritical,\n });\n if (newIndex == null) {\n return null;\n }\n\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex,\n });\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DisplacementGroups,\n LiftEffect,\n DraggableId,\n DisplacedBy,\n} from '../types';\nimport { origin, negate } from './position';\nimport didStartAfterCritical from './did-start-after-critical';\n\n// Exact\ntype Args = {\n displaced: DisplacementGroups,\n afterCritical: LiftEffect,\n combineWith: DraggableId,\n displacedBy: DisplacedBy,\n};\n\nexport default ({\n displaced,\n afterCritical,\n combineWith,\n displacedBy,\n}: Args): Position => {\n const isDisplaced: boolean = Boolean(\n displaced.visible[combineWith] || displaced.invisible[combineWith],\n );\n\n if (didStartAfterCritical(combineWith, afterCritical)) {\n return isDisplaced ? origin : negate(displacedBy.point);\n }\n\n return isDisplaced ? displacedBy.point : origin;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport type {\n DraggableDimensionMap,\n DraggableId,\n Combine,\n LiftEffect,\n DragImpact,\n} from '../../../types';\nimport { add } from '../../position';\nimport getCombinedItemDisplacement from '../../get-combined-item-displacement';\nimport { tryGetCombine } from '../../get-impact-location';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n // all draggables in the system\n draggables: DraggableDimensionMap,\n afterCritical: LiftEffect,\n};\n\n// Returns the client offset required to move an item from its\n// original client position to its final resting position\nexport default ({ afterCritical, impact, draggables }: Args): Position => {\n const combine: Combine | null = tryGetCombine(impact);\n invariant(combine);\n\n const combineWith: DraggableId = combine.draggableId;\n const center: Position = draggables[combineWith].page.borderBox.center;\n\n const displaceBy: Position = getCombinedItemDisplacement({\n displaced: impact.displaced,\n afterCritical,\n combineWith,\n displacedBy: impact.displacedBy,\n });\n\n return add(center, displaceBy);\n};\n","// @flow\nimport type { Position, BoxModel, Rect } from 'css-box-model';\nimport { patch } from '../position';\nimport type { Axis } from '../../types';\n\ntype Args = {\n axis: Axis,\n moveRelativeTo: BoxModel,\n isMoving: BoxModel,\n};\n\nconst distanceFromStartToBorderBoxCenter = (\n axis: Axis,\n box: BoxModel,\n): number => box.margin[axis.start] + box.borderBox[axis.size] / 2;\n\nconst distanceFromEndToBorderBoxCenter = (axis: Axis, box: BoxModel): number =>\n box.margin[axis.end] + box.borderBox[axis.size] / 2;\n\n// We align the moving item against the cross axis start of the target\n// We used to align the moving item cross axis center with the cross axis center of the target.\n// However, this leads to a bad experience when reordering columns\nconst getCrossAxisBorderBoxCenter = (\n axis: Axis,\n target: Rect,\n isMoving: BoxModel,\n): number =>\n target[axis.crossAxisStart] +\n isMoving.margin[axis.crossAxisStart] +\n isMoving.borderBox[axis.crossAxisSize] / 2;\n\nexport const goAfter = ({ axis, moveRelativeTo, isMoving }: Args): Position =>\n patch(\n axis.line,\n // start measuring from the end of the target\n moveRelativeTo.marginBox[axis.end] +\n distanceFromStartToBorderBoxCenter(axis, isMoving),\n getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving),\n );\n\nexport const goBefore = ({ axis, moveRelativeTo, isMoving }: Args): Position =>\n patch(\n axis.line,\n // start measuring from the start of the target\n moveRelativeTo.marginBox[axis.start] -\n distanceFromEndToBorderBoxCenter(axis, isMoving),\n getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving),\n );\n\n// Exact\ntype GoIntoArgs = {\n axis: Axis,\n moveInto: BoxModel,\n isMoving: BoxModel,\n};\n\n// moves into the content box\nexport const goIntoStart = ({\n axis,\n moveInto,\n isMoving,\n}: GoIntoArgs): Position =>\n patch(\n axis.line,\n moveInto.contentBox[axis.start] +\n distanceFromStartToBorderBoxCenter(axis, isMoving),\n getCrossAxisBorderBoxCenter(axis, moveInto.contentBox, isMoving),\n );\n","// @flow\nimport { offset, type Position, type BoxModel } from 'css-box-model';\nimport type {\n Axis,\n DragImpact,\n DraggableId,\n DraggableDimension,\n DraggableDimensionMap,\n DroppableDimension,\n LiftEffect,\n} from '../../../types';\nimport { goBefore, goAfter, goIntoStart } from '../move-relative-to';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport { negate } from '../../position';\nimport didStartAfterCritical from '../../did-start-after-critical';\n\n// Exact\ntype NewHomeArgs = {\n impact: DragImpact,\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n droppable: DroppableDimension,\n afterCritical: LiftEffect,\n};\n\n// Returns the client offset required to move an item from its\n// original client position to its final resting position\nexport default ({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical,\n}: NewHomeArgs): Position => {\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n droppable.descriptor.id,\n draggables,\n );\n\n const draggablePage: BoxModel = draggable.page;\n const axis: Axis = droppable.axis;\n\n // this will only happen in a foreign list\n if (!insideDestination.length) {\n return goIntoStart({\n axis,\n moveInto: droppable.page,\n isMoving: draggablePage,\n });\n }\n\n const { displaced, displacedBy } = impact;\n const closestAfter: DraggableId | null = displaced.all[0];\n\n // go before the first displaced item\n // items can only be displaced forwards\n if (closestAfter) {\n const closest: DraggableDimension = draggables[closestAfter];\n // want to go before where it would be with the displacement\n\n // target is displaced and is already in it's starting position\n if (didStartAfterCritical(closestAfter, afterCritical)) {\n return goBefore({\n axis,\n moveRelativeTo: closest.page,\n isMoving: draggablePage,\n });\n }\n\n // target has been displaced during the drag and it is not in its starting position\n // we need to account for the displacement\n const withDisplacement: BoxModel = offset(closest.page, displacedBy.point);\n\n return goBefore({\n axis,\n moveRelativeTo: withDisplacement,\n isMoving: draggablePage,\n });\n }\n\n // Nothing in list is displaced, we should go after the last item\n\n const last: DraggableDimension =\n insideDestination[insideDestination.length - 1];\n\n // we can just go into our original position if the last item\n // is the dragging item\n if (last.descriptor.id === draggable.descriptor.id) {\n return draggablePage.borderBox.center;\n }\n\n if (didStartAfterCritical(last.descriptor.id, afterCritical)) {\n // if the item started displaced and it is no longer displaced then\n // we need to go after it it's non-displaced position\n\n const page: BoxModel = offset(\n last.page,\n negate(afterCritical.displacedBy.point),\n );\n return goAfter({\n axis,\n moveRelativeTo: page,\n isMoving: draggablePage,\n });\n }\n\n // item is in its resting spot. we can go straight after it\n return goAfter({\n axis,\n moveRelativeTo: last.page,\n isMoving: draggablePage,\n });\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { add } from '../position';\nimport type { Scrollable, DroppableDimension } from '../../types';\n\nexport default (droppable: DroppableDimension, point: Position): Position => {\n const frame: Scrollable | null = droppable.frame;\n if (!frame) {\n return point;\n }\n\n return add(point, frame.scroll.diff.displacement);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DragImpact,\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n ImpactLocation,\n LiftEffect,\n} from '../../../types';\nimport whenCombining from './when-combining';\nimport whenReordering from './when-reordering';\nimport withDroppableDisplacement from '../../with-scroll-change/with-droppable-displacement';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n afterCritical: LiftEffect,\n draggable: DraggableDimension,\n droppable: DroppableDimension | null,\n draggables: DraggableDimensionMap,\n};\n\nconst getResultWithoutDroppableDisplacement = ({\n impact,\n draggable,\n droppable,\n draggables,\n afterCritical,\n}: Args): Position => {\n const original: Position = draggable.page.borderBox.center;\n const at: ImpactLocation | null = impact.at;\n\n if (!droppable) {\n return original;\n }\n\n if (!at) {\n return original;\n }\n\n if (at.type === 'REORDER') {\n return whenReordering({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical,\n });\n }\n\n return whenCombining({\n impact,\n draggables,\n afterCritical,\n });\n};\n\nexport default (args: Args): Position => {\n const withoutDisplacement: Position = getResultWithoutDroppableDisplacement(\n args,\n );\n\n const droppable: DroppableDimension | null = args.droppable;\n\n const withDisplacement: Position = droppable\n ? withDroppableDisplacement(droppable, withoutDisplacement)\n : withoutDisplacement;\n\n return withDisplacement;\n};\n","// @flow\nimport { getRect, type Rect } from 'css-box-model';\nimport type { Position } from 'css-box-model';\nimport { subtract, negate } from './position';\nimport type { Viewport } from '../types';\n\nexport default (viewport: Viewport, newScroll: Position): Viewport => {\n const diff: Position = subtract(newScroll, viewport.scroll.initial);\n const displacement: Position = negate(diff);\n\n // We need to update the frame so that it is always a live value\n // The top / left of the frame should always match the newScroll position\n const frame: Rect = getRect({\n top: newScroll.y,\n bottom: newScroll.y + viewport.frame.height,\n left: newScroll.x,\n right: newScroll.x + viewport.frame.width,\n });\n\n const updated: Viewport = {\n frame,\n scroll: {\n initial: viewport.scroll.initial,\n max: viewport.scroll.max,\n current: newScroll,\n diff: {\n value: diff,\n displacement,\n },\n },\n };\n\n return updated;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DraggableId,\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n DragImpact,\n Displacement,\n DisplacementGroups,\n DraggableIdMap,\n DisplacementMap,\n Viewport,\n} from '../../types';\nimport scrollViewport from '../scroll-viewport';\nimport scrollDroppable from '../droppable/scroll-droppable';\nimport { add } from '../position';\nimport getDisplacementGroups from '../get-displacement-groups';\n\n// Exact\ntype SpeculativeArgs = {\n impact: DragImpact,\n destination: DroppableDimension,\n viewport: Viewport,\n draggables: DraggableDimensionMap,\n maxScrollChange: Position,\n};\n\nfunction getDraggables(\n ids: DraggableId[],\n draggables: DraggableDimensionMap,\n): DraggableDimension[] {\n return ids.map((id: DraggableId): DraggableDimension => draggables[id]);\n}\n\nfunction tryGetVisible(\n id: DraggableId,\n groups: DisplacementGroups[],\n): Displacement | null {\n for (let i = 0; i < groups.length; i++) {\n const displacement: Displacement | null = groups[i].visible[id];\n if (displacement) {\n return displacement;\n }\n }\n return null;\n}\n\nexport default ({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange,\n}: SpeculativeArgs): DragImpact => {\n const scrolledViewport: Viewport = scrollViewport(\n viewport,\n add(viewport.scroll.current, maxScrollChange),\n );\n const scrolledDroppable: DroppableDimension = destination.frame\n ? scrollDroppable(\n destination,\n add(destination.frame.scroll.current, maxScrollChange),\n )\n : destination;\n\n const last: DisplacementGroups = impact.displaced;\n const withViewportScroll: DisplacementGroups = getDisplacementGroups({\n afterDragging: getDraggables(last.all, draggables),\n destination,\n displacedBy: impact.displacedBy,\n viewport: scrolledViewport.frame,\n last,\n // we want the addition to be animated\n forceShouldAnimate: false,\n });\n const withDroppableScroll: DisplacementGroups = getDisplacementGroups({\n afterDragging: getDraggables(last.all, draggables),\n destination: scrolledDroppable,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n last,\n // we want the addition to be animated\n forceShouldAnimate: false,\n });\n\n const invisible: DraggableIdMap = {};\n const visible: DisplacementMap = {};\n const groups: DisplacementGroups[] = [\n // this will populate the previous entries with the correct animation values\n last,\n withViewportScroll,\n withDroppableScroll,\n ];\n\n last.all.forEach((id: DraggableId) => {\n const displacement: Displacement | null = tryGetVisible(id, groups);\n\n if (displacement) {\n visible[id] = displacement;\n return;\n }\n invisible[id] = true;\n });\n\n const newImpact: DragImpact = {\n ...impact,\n displaced: { all: last.all, invisible, visible },\n };\n\n return newImpact;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type { Viewport } from '../../types';\nimport { add } from '../position';\n\nexport default (viewport: Viewport, point: Position): Position =>\n add(viewport.scroll.diff.displacement, point);\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type { Viewport, DraggableDimension } from '../../../types';\nimport { add, subtract } from '../../position';\nimport withViewportDisplacement from '../../with-scroll-change/with-viewport-displacement';\n\n// Exact\ntype Args = {\n pageBorderBoxCenter: Position,\n draggable: DraggableDimension,\n viewport: Viewport,\n};\n\nexport default ({\n pageBorderBoxCenter,\n draggable,\n viewport,\n}: Args): Position => {\n const withoutPageScrollChange: Position = withViewportDisplacement(\n viewport,\n pageBorderBoxCenter,\n );\n\n const offset: Position = subtract(\n withoutPageScrollChange,\n draggable.page.borderBox.center,\n );\n\n return add(draggable.client.borderBox.center, offset);\n};\n","// @flow\nimport { type Position, type Rect, type Spacing } from 'css-box-model';\nimport { subtract } from '../../position';\nimport { offsetByPosition } from '../../spacing';\nimport {\n isTotallyVisible,\n isTotallyVisibleOnAxis,\n type Args as IsVisibleArgs,\n} from '../../visibility/is-visible';\nimport type { DraggableDimension, DroppableDimension } from '../../../types';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n destination: DroppableDimension,\n newPageBorderBoxCenter: Position,\n viewport: Rect,\n // only allowing a 'false' value. Being super clear\n withDroppableDisplacement: false,\n onlyOnMainAxis?: boolean,\n};\n\nexport default ({\n draggable,\n destination,\n newPageBorderBoxCenter,\n viewport,\n withDroppableDisplacement,\n onlyOnMainAxis = false,\n}: Args): boolean => {\n // What would the location of the Draggable be once the move is completed?\n // We are not considering margins for this calculation.\n // This is because a move might move a Draggable slightly outside of the bounds\n // of a Droppable (which is okay)\n const changeNeeded: Position = subtract(\n newPageBorderBoxCenter,\n draggable.page.borderBox.center,\n );\n const shifted: Spacing = offsetByPosition(\n draggable.page.borderBox,\n changeNeeded,\n );\n\n // Must be totally visible, not just partially visible.\n const args: IsVisibleArgs = {\n target: shifted,\n destination,\n withDroppableDisplacement,\n viewport,\n };\n\n return onlyOnMainAxis ? isTotallyVisibleOnAxis(args) : isTotallyVisible(args);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n DragImpact,\n Viewport,\n LiftEffect,\n} from '../../../types';\nimport type { PublicResult } from '../move-in-direction-types';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport moveToNextCombine from './move-to-next-combine';\nimport moveToNextIndex from './move-to-next-index';\nimport isHomeOf from '../../droppable/is-home-of';\nimport getPageBorderBoxCenter from '../../get-center-from-impact/get-page-border-box-center';\nimport speculativelyIncrease from '../../update-displacement-visibility/speculatively-increase';\nimport getClientFromPageBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center';\nimport { subtract } from '../../position';\nimport isTotallyVisibleInNewLocation from './is-totally-visible-in-new-location';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n draggable: DraggableDimension,\n destination: DroppableDimension,\n draggables: DraggableDimensionMap,\n previousImpact: DragImpact,\n viewport: Viewport,\n previousClientSelection: Position,\n previousPageBorderBoxCenter: Position,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n draggable,\n destination,\n draggables,\n previousImpact,\n viewport,\n previousPageBorderBoxCenter,\n previousClientSelection,\n afterCritical,\n}: Args): PublicResult | null => {\n if (!destination.isEnabled) {\n return null;\n }\n\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n destination.descriptor.id,\n draggables,\n );\n const isInHomeList: boolean = isHomeOf(draggable, destination);\n\n const impact: DragImpact | null =\n moveToNextCombine({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact,\n }) ||\n moveToNextIndex({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical,\n });\n\n if (!impact) {\n return null;\n }\n\n const pageBorderBoxCenter: Position = getPageBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical,\n });\n\n const isVisibleInNewLocation: boolean = isTotallyVisibleInNewLocation({\n draggable,\n destination,\n newPageBorderBoxCenter: pageBorderBoxCenter,\n viewport: viewport.frame,\n // already taken into account by getPageBorderBoxCenter\n withDroppableDisplacement: false,\n // we only care about it being visible relative to the main axis\n // this is important with dynamic changes as scroll bar and toggle\n // on the cross axis during a drag\n onlyOnMainAxis: true,\n });\n\n if (isVisibleInNewLocation) {\n // using the client center as the selection point\n const clientSelection: Position = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport,\n });\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null,\n };\n }\n\n const distance: Position = subtract(\n pageBorderBoxCenter,\n previousPageBorderBoxCenter,\n );\n\n const cautious: DragImpact = speculativelyIncrease({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange: distance,\n });\n\n return {\n clientSelection: previousClientSelection,\n impact: cautious,\n scrollJumpRequest: distance,\n };\n};\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport { closest } from '../../position';\nimport isWithin from '../../is-within';\nimport { getCorners } from '../../spacing';\nimport isPartiallyVisibleThroughFrame from '../../visibility/is-partially-visible-through-frame';\nimport { toDroppableList } from '../../dimension-structures';\nimport type {\n Axis,\n DroppableDimension,\n DroppableDimensionMap,\n Viewport,\n} from '../../../types';\n\n// Exact\ntype GetBestDroppableArgs = {\n isMovingForward: boolean,\n // the current position of the dragging item\n pageBorderBoxCenter: Position,\n // the home of the draggable\n source: DroppableDimension,\n // all the droppables in the system\n droppables: DroppableDimensionMap,\n viewport: Viewport,\n};\n\nconst getKnownActive = (droppable: DroppableDimension): Rect => {\n const rect: Rect | null = droppable.subject.active;\n\n invariant(rect, 'Cannot get clipped area from droppable');\n\n return rect;\n};\n\nexport default ({\n isMovingForward,\n pageBorderBoxCenter,\n source,\n droppables,\n viewport,\n}: GetBestDroppableArgs): DroppableDimension | null => {\n const active: Rect | null = source.subject.active;\n\n if (!active) {\n return null;\n }\n\n const axis: Axis = source.axis;\n const isBetweenSourceClipped = isWithin(active[axis.start], active[axis.end]);\n const candidates: DroppableDimension[] = toDroppableList(droppables)\n // Remove the source droppable from the list\n .filter((droppable: DroppableDimension): boolean => droppable !== source)\n // Remove any options that are not enabled\n .filter((droppable: DroppableDimension): boolean => droppable.isEnabled)\n // Remove any droppables that do not have a visible subject\n .filter((droppable: DroppableDimension): boolean =>\n Boolean(droppable.subject.active),\n )\n // Remove any that are not visible in the window\n .filter((droppable: DroppableDimension): boolean =>\n isPartiallyVisibleThroughFrame(viewport.frame)(getKnownActive(droppable)),\n )\n .filter((droppable: DroppableDimension): boolean => {\n const activeOfTarget: Rect = getKnownActive(droppable);\n\n // is the target in front of the source on the cross axis?\n if (isMovingForward) {\n return active[axis.crossAxisEnd] < activeOfTarget[axis.crossAxisEnd];\n }\n // is the target behind the source on the cross axis?\n return activeOfTarget[axis.crossAxisStart] < active[axis.crossAxisStart];\n })\n // Must have some overlap on the main axis\n .filter((droppable: DroppableDimension): boolean => {\n const activeOfTarget: Rect = getKnownActive(droppable);\n\n const isBetweenDestinationClipped = isWithin(\n activeOfTarget[axis.start],\n activeOfTarget[axis.end],\n );\n\n return (\n isBetweenSourceClipped(activeOfTarget[axis.start]) ||\n isBetweenSourceClipped(activeOfTarget[axis.end]) ||\n isBetweenDestinationClipped(active[axis.start]) ||\n isBetweenDestinationClipped(active[axis.end])\n );\n })\n // Sort on the cross axis\n .sort((a: DroppableDimension, b: DroppableDimension) => {\n const first: number = getKnownActive(a)[axis.crossAxisStart];\n const second: number = getKnownActive(b)[axis.crossAxisStart];\n\n if (isMovingForward) {\n return first - second;\n }\n return second - first;\n })\n // Find the droppables that have the same cross axis value as the first item\n .filter(\n (\n droppable: DroppableDimension,\n _index: number,\n array: DroppableDimension[],\n ): boolean =>\n getKnownActive(droppable)[axis.crossAxisStart] ===\n getKnownActive(array[0])[axis.crossAxisStart],\n );\n\n // no possible candidates\n if (!candidates.length) {\n return null;\n }\n\n // only one result - all done!\n if (candidates.length === 1) {\n return candidates[0];\n }\n\n // At this point we have a number of candidates that\n // all have the same axis.crossAxisStart value.\n\n // Check to see if the center position is within the size of a Droppable on the main axis\n const contains: DroppableDimension[] = candidates.filter(\n (droppable: DroppableDimension) => {\n const isWithinDroppable = isWithin(\n getKnownActive(droppable)[axis.start],\n getKnownActive(droppable)[axis.end],\n );\n return isWithinDroppable(pageBorderBoxCenter[axis.line]);\n },\n );\n\n if (contains.length === 1) {\n return contains[0];\n }\n\n // The center point of the draggable falls on the boundary between two droppables\n if (contains.length > 1) {\n // sort on the main axis and choose the first\n return contains.sort(\n (a: DroppableDimension, b: DroppableDimension): number =>\n getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start],\n )[0];\n }\n\n // The center is not contained within any droppable\n // 1. Find the candidate that has the closest corner\n // 2. If there is a tie - choose the one that is first on the main axis\n return candidates.sort(\n (a: DroppableDimension, b: DroppableDimension): number => {\n const first = closest(pageBorderBoxCenter, getCorners(getKnownActive(a)));\n const second = closest(\n pageBorderBoxCenter,\n getCorners(getKnownActive(b)),\n );\n\n // if the distances are not equal - choose the shortest\n if (first !== second) {\n return first - second;\n }\n\n // They both have the same distance -\n // choose the one that is first on the main axis\n return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];\n },\n )[0];\n};\n","// @flow\nimport type { Position, Rect, Spacing } from 'css-box-model';\nimport type { DraggableDimension, LiftEffect } from '../../../types';\nimport { negate, subtract } from '../../position';\nimport { offsetByPosition } from '../../spacing';\nimport didStartAfterCritical from '../../did-start-after-critical';\n\nexport const getCurrentPageBorderBoxCenter = (\n draggable: DraggableDimension,\n afterCritical: LiftEffect,\n): Position => {\n // If an item started displaced it is now resting\n // in a non-displaced location\n const original: Position = draggable.page.borderBox.center;\n return didStartAfterCritical(draggable.descriptor.id, afterCritical)\n ? subtract(original, afterCritical.displacedBy.point)\n : original;\n};\n\nexport const getCurrentPageBorderBox = (\n draggable: DraggableDimension,\n afterCritical: LiftEffect,\n): Spacing => {\n // If an item started displaced it is now resting\n // in a non-displaced location\n const original: Rect = draggable.page.borderBox;\n\n return didStartAfterCritical(draggable.descriptor.id, afterCritical)\n ? offsetByPosition(original, negate(afterCritical.displacedBy.point))\n : original;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type {\n Viewport,\n DraggableDimension,\n DroppableDimension,\n LiftEffect,\n} from '../../../types';\nimport { distance } from '../../position';\nimport { isTotallyVisible } from '../../visibility/is-visible';\nimport withDroppableDisplacement from '../../with-scroll-change/with-droppable-displacement';\nimport {\n getCurrentPageBorderBox,\n getCurrentPageBorderBoxCenter,\n} from './without-starting-displacement';\n\n// Exact\ntype Args = {\n pageBorderBoxCenter: Position,\n viewport: Viewport,\n // the droppable that is being moved to\n destination: DroppableDimension,\n // the droppables inside the destination\n insideDestination: DraggableDimension[],\n afterCritical: LiftEffect,\n};\n\nexport default ({\n pageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical,\n}: Args): DraggableDimension | null => {\n const sorted: DraggableDimension[] = insideDestination\n .filter((draggable: DraggableDimension): boolean =>\n // Allowing movement to draggables that are not visible in the viewport\n // but must be visible in the droppable\n // We can improve this, but this limitation is easier for now\n isTotallyVisible({\n target: getCurrentPageBorderBox(draggable, afterCritical),\n destination,\n viewport: viewport.frame,\n withDroppableDisplacement: true,\n }),\n )\n .sort((a: DraggableDimension, b: DraggableDimension): number => {\n // Need to consider the change in scroll in the destination\n const distanceToA = distance(\n pageBorderBoxCenter,\n withDroppableDisplacement(\n destination,\n getCurrentPageBorderBoxCenter(a, afterCritical),\n ),\n );\n const distanceToB = distance(\n pageBorderBoxCenter,\n withDroppableDisplacement(\n destination,\n getCurrentPageBorderBoxCenter(b, afterCritical),\n ),\n );\n\n // if a is closer - return a\n if (distanceToA < distanceToB) {\n return -1;\n }\n\n // if b is closer - return b\n if (distanceToB < distanceToA) {\n return 1;\n }\n\n // if the distance to a and b are the same:\n // return the one with the lower index (it will be higher on the main axis)\n return a.descriptor.index - b.descriptor.index;\n });\n\n return sorted[0] || null;\n};\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { type Position } from 'css-box-model';\nimport type { Axis, DisplacedBy } from '../types';\nimport { patch } from './position';\n\n// TODO: memoization needed?\nexport default memoizeOne(function getDisplacedBy(\n axis: Axis,\n displaceBy: Position,\n): DisplacedBy {\n const displacement: number = displaceBy[axis.line];\n return {\n value: displacement,\n point: patch(axis.line, displacement),\n };\n});\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport type {\n Axis,\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n Scrollable,\n DroppableSubject,\n PlaceholderInSubject,\n} from '../../types';\nimport getDraggablesInsideDroppable from '../get-draggables-inside-droppable';\nimport { add, patch } from '../position';\nimport getSubject from './util/get-subject';\nimport isHomeOf from './is-home-of';\nimport getDisplacedBy from '../get-displaced-by';\n\nconst getRequiredGrowthForPlaceholder = (\n droppable: DroppableDimension,\n placeholderSize: Position,\n draggables: DraggableDimensionMap,\n): Position | null => {\n const axis: Axis = droppable.axis;\n\n // A virtual list will most likely not contain all of the Draggables\n // so counting them does not help.\n if (droppable.descriptor.mode === 'virtual') {\n return patch(axis.line, placeholderSize[axis.line]);\n }\n\n // TODO: consider margin collapsing?\n // Using contentBox as that is where the Draggables will sit\n const availableSpace: number = droppable.subject.page.contentBox[axis.size];\n const insideDroppable: DraggableDimension[] = getDraggablesInsideDroppable(\n droppable.descriptor.id,\n draggables,\n );\n const spaceUsed: number = insideDroppable.reduce(\n (sum: number, dimension: DraggableDimension): number =>\n sum + dimension.client.marginBox[axis.size],\n 0,\n );\n const requiredSpace: number = spaceUsed + placeholderSize[axis.line];\n const needsToGrowBy: number = requiredSpace - availableSpace;\n\n // nothing to do here\n if (needsToGrowBy <= 0) {\n return null;\n }\n\n return patch(axis.line, needsToGrowBy);\n};\n\nconst withMaxScroll = (frame: Scrollable, max: Position): Scrollable => ({\n ...frame,\n scroll: {\n ...frame.scroll,\n max,\n },\n});\n\nexport const addPlaceholder = (\n droppable: DroppableDimension,\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n): DroppableDimension => {\n const frame: Scrollable | null = droppable.frame;\n\n invariant(\n !isHomeOf(draggable, droppable),\n 'Should not add placeholder space to home list',\n );\n\n invariant(\n !droppable.subject.withPlaceholder,\n 'Cannot add placeholder size to a subject when it already has one',\n );\n\n const placeholderSize: Position = getDisplacedBy(\n droppable.axis,\n draggable.displaceBy,\n ).point;\n\n const requiredGrowth: Position | null = getRequiredGrowthForPlaceholder(\n droppable,\n placeholderSize,\n draggables,\n );\n\n const added: PlaceholderInSubject = {\n placeholderSize,\n increasedBy: requiredGrowth,\n oldFrameMaxScroll: droppable.frame ? droppable.frame.scroll.max : null,\n };\n\n if (!frame) {\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: droppable.frame,\n });\n return {\n ...droppable,\n subject,\n };\n }\n\n const maxScroll: Position = requiredGrowth\n ? add(frame.scroll.max, requiredGrowth)\n : frame.scroll.max;\n\n const newFrame: Scrollable = withMaxScroll(frame, maxScroll);\n\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: newFrame,\n });\n return {\n ...droppable,\n subject,\n frame: newFrame,\n };\n};\n\nexport const removePlaceholder = (\n droppable: DroppableDimension,\n): DroppableDimension => {\n const added: PlaceholderInSubject | null = droppable.subject.withPlaceholder;\n invariant(\n added,\n 'Cannot remove placeholder form subject when there was none',\n );\n\n const frame: Scrollable | null = droppable.frame;\n\n if (!frame) {\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: null,\n // cleared\n withPlaceholder: null,\n });\n return {\n ...droppable,\n subject,\n };\n }\n\n const oldMaxScroll: Position | null = added.oldFrameMaxScroll;\n invariant(\n oldMaxScroll,\n 'Expected droppable with frame to have old max frame scroll when removing placeholder',\n );\n\n const newFrame: Scrollable = withMaxScroll(frame, oldMaxScroll);\n\n const subject: DroppableSubject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: newFrame,\n // cleared\n withPlaceholder: null,\n });\n return {\n ...droppable,\n subject,\n frame: newFrame,\n };\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DragImpact,\n DraggableDimension,\n DraggableDimensionMap,\n DroppableDimension,\n Viewport,\n DisplacedBy,\n LiftEffect,\n} from '../../../types';\nimport getDisplacedBy from '../../get-displaced-by';\nimport { emptyGroups, noDisplacedBy } from '../../no-impact';\nimport getPageBorderBoxCenter from '../../get-center-from-impact/get-page-border-box-center';\nimport isTotallyVisibleInNewLocation from '../move-to-next-place/is-totally-visible-in-new-location';\nimport { addPlaceholder } from '../../droppable/with-placeholder';\nimport isHomeOf from '../../droppable/is-home-of';\nimport calculateReorderImpact from '../../calculate-drag-impact/calculate-reorder-impact';\n\n// Exact\ntype Args = {\n previousPageBorderBoxCenter: Position,\n moveRelativeTo: DraggableDimension | null,\n insideDestination: DraggableDimension[],\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n destination: DroppableDimension,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n previousPageBorderBoxCenter,\n moveRelativeTo,\n insideDestination,\n draggable,\n draggables,\n destination,\n viewport,\n afterCritical,\n}: Args): DragImpact | null => {\n if (!moveRelativeTo) {\n // Draggables available, but none are candidates for movement\n if (insideDestination.length) {\n return null;\n }\n\n // Try move to top of empty list if it is visible\n const proposed: DragImpact = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: 0,\n },\n },\n };\n const proposedPageBorderBoxCenter: Position = getPageBorderBoxCenter({\n impact: proposed,\n draggable,\n droppable: destination,\n draggables,\n afterCritical,\n });\n\n // need to add room for a placeholder in a foreign list\n const withPlaceholder: DroppableDimension = isHomeOf(draggable, destination)\n ? destination\n : addPlaceholder(destination, draggable, draggables);\n\n const isVisibleInNewLocation: boolean = isTotallyVisibleInNewLocation({\n draggable,\n destination: withPlaceholder,\n newPageBorderBoxCenter: proposedPageBorderBoxCenter,\n viewport: viewport.frame,\n // already taken into account by getPageBorderBoxCenter\n withDroppableDisplacement: false,\n onlyOnMainAxis: true,\n });\n\n return isVisibleInNewLocation ? proposed : null;\n }\n\n const isGoingBeforeTarget: boolean = Boolean(\n // Using <= as we optimise slightly for moving before items in a new list\n // This is nicer in lists with fixed height items\n previousPageBorderBoxCenter[destination.axis.line] <=\n moveRelativeTo.page.borderBox.center[destination.axis.line],\n );\n\n const proposedIndex: number = (() => {\n const relativeTo: number = moveRelativeTo.descriptor.index;\n\n if (moveRelativeTo.descriptor.id === draggable.descriptor.id) {\n return relativeTo;\n }\n\n if (isGoingBeforeTarget) {\n return relativeTo;\n }\n\n return relativeTo + 1;\n })();\n\n const displacedBy: DisplacedBy = getDisplacedBy(\n destination.axis,\n draggable.displaceBy,\n );\n\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n // last groups won't be relevant\n last: emptyGroups,\n index: proposedIndex,\n });\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type { PublicResult } from '../move-in-direction-types';\nimport type {\n DroppableDimension,\n DraggableDimension,\n DraggableDimensionMap,\n DroppableDimensionMap,\n DragImpact,\n Viewport,\n LiftEffect,\n} from '../../../types';\nimport getBestCrossAxisDroppable from './get-best-cross-axis-droppable';\nimport getClosestDraggable from './get-closest-draggable';\n// import moveToNewDroppable from './move-to-new-droppable';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport getClientFromPageBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center';\nimport getPageBorderBoxCenter from '../../get-center-from-impact/get-page-border-box-center';\nimport moveToNewDroppable from './move-to-new-droppable';\n\n// Exact\ntype Args = {\n isMovingForward: boolean,\n // the current page center of the dragging item\n previousPageBorderBoxCenter: Position,\n // the dragging item\n draggable: DraggableDimension,\n // the droppable the dragging item is in\n isOver: DroppableDimension,\n // all the dimensions in the system\n draggables: DraggableDimensionMap,\n droppables: DroppableDimensionMap,\n // the current viewport\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport,\n afterCritical,\n}: Args): PublicResult | null => {\n // not considering the container scroll changes as container scrolling cancels a keyboard drag\n\n const destination: DroppableDimension | null = getBestCrossAxisDroppable({\n isMovingForward,\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n source: isOver,\n droppables,\n viewport,\n });\n\n // nothing available to move to\n if (!destination) {\n return null;\n }\n\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n destination.descriptor.id,\n draggables,\n );\n\n const moveRelativeTo: DraggableDimension | null= getClosestDraggable({\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical,\n });\n\n const impact: DragImpact | null = moveToNewDroppable({\n previousPageBorderBoxCenter,\n destination,\n draggable,\n draggables,\n moveRelativeTo,\n insideDestination,\n viewport,\n afterCritical,\n });\n\n if (!impact) {\n return null;\n }\n\n const pageBorderBoxCenter: Position = getPageBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical,\n });\n\n const clientSelection: Position = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport,\n });\n\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null,\n };\n};\n","// @flow\nimport type { ImpactLocation, DroppableId, DragImpact } from '../../types';\n\nexport default (impact: DragImpact): DroppableId | null => {\n const at: ImpactLocation | null = impact.at;\n\n if (!at) {\n return null;\n }\n\n if (at.type === 'REORDER') {\n return at.destination.droppableId;\n }\n\n return at.combine.droppableId;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type { PublicResult } from './move-in-direction-types';\nimport type {\n DroppableId,\n DraggingState,\n Direction,\n DroppableDimension,\n DraggableDimension,\n DroppableDimensionMap,\n DragImpact,\n} from '../../types';\nimport moveToNextPlace from './move-to-next-place';\nimport moveCrossAxis from './move-cross-axis';\nimport whatIsDraggedOver from '../droppable/what-is-dragged-over';\n\n// Exact\ntype Args = {\n state: DraggingState,\n type: 'MOVE_UP' | 'MOVE_RIGHT' | 'MOVE_DOWN' | 'MOVE_LEFT',\n};\n\nconst getDroppableOver = (\n impact: DragImpact,\n droppables: DroppableDimensionMap,\n): DroppableDimension | null => {\n const id: DroppableId | null = whatIsDraggedOver(impact);\n return id ? droppables[id] : null;\n};\n\nexport default ({ state, type }: Args): PublicResult | null => {\n const isActuallyOver: DroppableDimension | null = getDroppableOver(\n state.impact,\n state.dimensions.droppables,\n );\n const isMainAxisMovementAllowed: boolean = Boolean(isActuallyOver);\n const home: DroppableDimension =\n state.dimensions.droppables[state.critical.droppable.id];\n // use home when not actually over a droppable (can happen when move is disabled)\n const isOver: DroppableDimension = isActuallyOver || home;\n\n const direction: Direction = isOver.axis.direction;\n const isMovingOnMainAxis: boolean =\n (direction === 'vertical' &&\n (type === 'MOVE_UP' || type === 'MOVE_DOWN')) ||\n (direction === 'horizontal' &&\n (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT'));\n\n // This movement is not permitted right now\n if (isMovingOnMainAxis && !isMainAxisMovementAllowed) {\n return null;\n }\n\n const isMovingForward: boolean =\n type === 'MOVE_DOWN' || type === 'MOVE_RIGHT';\n\n const draggable: DraggableDimension =\n state.dimensions.draggables[state.critical.draggable.id];\n const previousPageBorderBoxCenter: Position =\n state.current.page.borderBoxCenter;\n const { draggables, droppables } = state.dimensions;\n\n return isMovingOnMainAxis\n ? moveToNextPlace({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n destination: isOver,\n draggables,\n viewport: state.viewport,\n previousClientSelection: state.current.client.selection,\n previousImpact: state.impact,\n afterCritical: state.afterCritical,\n })\n : moveCrossAxis({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport: state.viewport,\n afterCritical: state.afterCritical,\n });\n};\n","// @flow\nimport type { CollectingState, DraggingState, State } from '../types';\n\nexport default function isMovementAllowed(\n state: State,\n): state is DraggingState | CollectingState {\n return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';\n}\n\n// Using function declaration as arrow function does not play well with the %checks syntax\n// export default function isMovementAllowed(state: State): boolean %checks {\n// return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';\n// }\n","// @flow\nimport { type Position, type Spacing } from 'css-box-model';\nimport isWithin from '../is-within';\n\nexport default function isPositionInFrame(frame: Spacing) {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n\n return function run(point: Position) {\n return isWithinVertical(point.y) && isWithinHorizontal(point.x);\n };\n}\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport type {\n DroppableDimension,\n DroppableDimensionMap,\n DroppableId,\n DraggableDimension,\n Axis,\n} from '../types';\nimport { toDroppableList } from './dimension-structures';\nimport isPositionInFrame from './visibility/is-position-in-frame';\nimport { distance, patch } from './position';\nimport isWithin from './is-within';\n\n// https://stackoverflow.com/questions/306316/determine-if-two-rectangles-overlap-each-other\n// https://silentmatt.com/rectangle-intersection/\nfunction getHasOverlap(first: Rect, second: Rect): boolean {\n return (\n first.left < second.right &&\n first.right > second.left &&\n first.top < second.bottom &&\n first.bottom > second.top\n );\n}\n\n// Exact\ntype Args = {\n pageBorderBox: Rect,\n draggable: DraggableDimension,\n droppables: DroppableDimensionMap,\n};\n\n// Exact\ntype WithDistance = {\n distance: number,\n id: DroppableId,\n};\n\n// Exact\ntype GetFurthestArgs = {\n pageBorderBox: Rect,\n draggable: DraggableDimension,\n candidates: DroppableDimension[],\n};\n\nfunction getFurthestAway({\n pageBorderBox,\n draggable,\n candidates,\n}: GetFurthestArgs): DroppableId | null {\n // We are not comparing the center of the home list with the target list as it would\n // give preference to giant lists\n\n // We are measuring the distance from where the draggable started\n // to where it is *hitting* the candidate\n // Note: The hit point might technically not be in the bounds of the candidate\n\n const startCenter: Position = draggable.page.borderBox.center;\n const sorted: WithDistance[] = candidates\n .map((candidate: DroppableDimension): WithDistance => {\n const axis: Axis = candidate.axis;\n const target: Position = patch(\n candidate.axis.line,\n // use the current center of the dragging item on the main axis\n pageBorderBox.center[axis.line],\n // use the center of the list on the cross axis\n candidate.page.borderBox.center[axis.crossAxisLine],\n );\n\n return {\n id: candidate.descriptor.id,\n distance: distance(startCenter, target),\n };\n })\n // largest value will be first\n .sort((a: WithDistance, b: WithDistance) => b.distance - a.distance);\n\n // just being safe\n return sorted[0] ? sorted[0].id : null;\n}\n\nexport default function getDroppableOver({\n pageBorderBox,\n draggable,\n droppables,\n}: Args): DroppableId | null {\n // We know at this point that some overlap has to exist\n const candidates: DroppableDimension[] = toDroppableList(droppables).filter(\n (item: DroppableDimension): boolean => {\n // Cannot be a candidate when disabled\n if (!item.isEnabled) {\n return false;\n }\n\n // Cannot be a candidate when there is no visible area\n const active: Rect | null = item.subject.active;\n if (!active) {\n return false;\n }\n\n // Cannot be a candidate when dragging item is not over the droppable at all\n if (!getHasOverlap(pageBorderBox, active)) {\n return false;\n }\n\n // 1. Candidate if the center position is over a droppable\n if (isPositionInFrame(active)(pageBorderBox.center)) {\n return true;\n }\n\n // 2. Candidate if an edge is over the cross axis half way point\n // 3. Candidate if dragging item is totally over droppable on cross axis\n\n const axis: Axis = item.axis;\n const childCenter: number = active.center[axis.crossAxisLine];\n const crossAxisStart: number = pageBorderBox[axis.crossAxisStart];\n const crossAxisEnd: number = pageBorderBox[axis.crossAxisEnd];\n\n const isContained = isWithin(\n active[axis.crossAxisStart],\n active[axis.crossAxisEnd],\n );\n\n const isStartContained: boolean = isContained(crossAxisStart);\n const isEndContained: boolean = isContained(crossAxisEnd);\n\n // Dragging item is totally covering the active area\n if (!isStartContained && !isEndContained) {\n return true;\n }\n\n /**\n * edges must go beyond the center line in order to avoid\n * cases were both conditions are satisfied.\n */\n if (isStartContained) {\n return crossAxisStart < childCenter;\n }\n\n return crossAxisEnd > childCenter;\n },\n );\n\n if (!candidates.length) {\n return null;\n }\n\n // Only one candidate - use that!\n if (candidates.length === 1) {\n return candidates[0].descriptor.id;\n }\n\n // Multiple options returned\n // Should only occur with really large items\n // Going to use fallback: distance from home\n return getFurthestAway({\n pageBorderBox,\n draggable,\n candidates,\n });\n}\n","// @flow\nimport { getRect } from 'css-box-model';\nimport type { Rect, Position } from 'css-box-model';\nimport { offsetByPosition } from './spacing';\n\nexport const offsetRectByPosition = (rect: Rect, point: Position): Rect =>\n getRect(offsetByPosition(rect, point));\n","// @flow\nimport { type Rect } from 'css-box-model';\nimport type { Scrollable, DroppableDimension } from '../../types';\nimport { offsetRectByPosition } from '../rect';\n\nexport default (droppable: DroppableDimension, area: Rect): Rect => {\n const frame: Scrollable | null = droppable.frame;\n if (!frame) {\n return area;\n }\n\n return offsetRectByPosition(area, frame.scroll.diff.value);\n};\n","// @flow\nimport type { DisplacementGroups, DraggableId } from '../types';\n\n// Exact\ntype Args = {\n displaced: DisplacementGroups,\n id: DraggableId,\n};\n\nexport default function getIsDisplaced({ displaced, id }: Args): boolean {\n return Boolean(displaced.visible[id] || displaced.invisible[id]);\n}\n","// @flow\nimport { type Rect } from 'css-box-model';\nimport type {\n DraggableId,\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n Axis,\n DisplacementGroups,\n Viewport,\n DisplacedBy,\n LiftEffect,\n} from '../../types';\nimport getDisplacedBy from '../get-displaced-by';\nimport removeDraggableFromList from '../remove-draggable-from-list';\nimport isHomeOf from '../droppable/is-home-of';\nimport { find } from '../../native-with-fallback';\nimport getDidStartAfterCritical from '../did-start-after-critical';\nimport calculateReorderImpact from '../calculate-drag-impact/calculate-reorder-impact';\nimport getIsDisplaced from '../get-is-displaced';\n\n// Exact\ntype Args = {\n pageBorderBoxWithDroppableScroll: Rect,\n draggable: DraggableDimension,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n last: DisplacementGroups,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\n// Exact\ntype AtIndexArgs = {\n draggable: DraggableDimension,\n closest?: DraggableDimension | null,\n inHomeList: boolean,\n};\n\nfunction atIndex({ draggable, closest, inHomeList }: AtIndexArgs): number | null {\n if (!closest) {\n return null;\n }\n\n if (!inHomeList) {\n return closest.descriptor.index;\n }\n\n if (closest.descriptor.index > draggable.descriptor.index) {\n return closest.descriptor.index - 1;\n }\n\n return closest.descriptor.index;\n}\n\nexport default ({\n pageBorderBoxWithDroppableScroll: targetRect,\n draggable,\n destination,\n insideDestination,\n last,\n viewport,\n afterCritical,\n}: Args): DragImpact => {\n const axis: Axis = destination.axis;\n const displacedBy: DisplacedBy = getDisplacedBy(\n destination.axis,\n draggable.displaceBy,\n );\n const displacement: number = displacedBy.value;\n\n const targetStart: number = targetRect[axis.start];\n const targetEnd: number = targetRect[axis.end];\n\n const withoutDragging: DraggableDimension[] = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n const closest: DraggableDimension | null | undefined = find(\n withoutDragging,\n (child: DraggableDimension): boolean => {\n const id: DraggableId = child.descriptor.id;\n const childCenter: number = child.page.borderBox.center[axis.line];\n\n const didStartAfterCritical: boolean = getDidStartAfterCritical(\n id,\n afterCritical,\n );\n\n const isDisplaced: boolean = getIsDisplaced({ displaced: last, id });\n\n /*\n Note: we change things when moving *past* the child center - not when it hits the center\n If we make it when we *hit* the child center then there can be\n a hit on the next update causing a flicker.\n\n - Update 1: targetBottom hits center => displace backwards\n - Update 2: targetStart is now hitting the displaced center => displace forwards\n - Update 3: goto 1 (boom)\n */\n\n if (didStartAfterCritical) {\n // Continue to displace while targetEnd before the childCenter\n // Move once we *move forward past* the childCenter\n if (isDisplaced) {\n return targetEnd <= childCenter;\n }\n\n // Has been moved backwards from where it started\n // Displace forwards when targetStart *moves backwards past* the displaced childCenter\n return targetStart < childCenter - displacement;\n }\n\n // Item has been shifted forward.\n // Remove displacement when targetEnd moves forward past the displaced center\n if (isDisplaced) {\n return targetEnd <= childCenter + displacement;\n }\n\n // Item is behind the dragging item\n // We want to displace it if the targetStart goes *backwards past* the childCenter\n return targetStart < childCenter;\n },\n );\n\n const newIndex: number | null = atIndex({\n draggable,\n closest,\n inHomeList: isHomeOf(draggable, destination),\n });\n\n // TODO: index cannot be null?\n // otherwise return null from there and return empty impact\n // that was calculate reorder impact does not need to account for a null index\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last,\n displacedBy,\n index: newIndex,\n });\n};\n","// @flow\nimport type { Rect } from 'css-box-model';\nimport type {\n DraggableId,\n Axis,\n DraggableDimension,\n DroppableDimension,\n DragImpact,\n LiftEffect,\n DisplacedBy,\n} from '../../types';\nimport { find } from '../../native-with-fallback';\nimport getDidStartAfterCritical from '../did-start-after-critical';\nimport getDisplacedBy from '../get-displaced-by';\nimport getIsDisplaced from '../get-is-displaced';\nimport removeDraggableFromList from '../remove-draggable-from-list';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n pageBorderBoxWithDroppableScroll: Rect,\n previousImpact: DragImpact,\n destination: DroppableDimension,\n insideDestination: DraggableDimension[],\n afterCritical: LiftEffect,\n};\n\n// exported for testing\nexport const combineThresholdDivisor: number = 4;\n\nexport default ({\n draggable,\n pageBorderBoxWithDroppableScroll: targetRect,\n previousImpact,\n destination,\n insideDestination,\n afterCritical,\n}: Args): DragImpact | null => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const axis: Axis = destination.axis;\n const displacedBy: DisplacedBy = getDisplacedBy(\n destination.axis,\n draggable.displaceBy,\n );\n const displacement: number = displacedBy.value;\n\n const targetStart: number = targetRect[axis.start];\n const targetEnd: number = targetRect[axis.end];\n\n const withoutDragging: DraggableDimension[] = removeDraggableFromList(\n draggable,\n insideDestination,\n );\n\n const combineWith: DraggableDimension | null | undefined = find(\n withoutDragging,\n (child: DraggableDimension): boolean => {\n const id: DraggableId = child.descriptor.id;\n const childRect: Rect = child.page.borderBox;\n const childSize: number = childRect[axis.size];\n const threshold: number = childSize / combineThresholdDivisor;\n\n const didStartAfterCritical: boolean = getDidStartAfterCritical(\n id,\n afterCritical,\n );\n\n const isDisplaced: boolean = getIsDisplaced({\n displaced: previousImpact.displaced,\n id,\n });\n\n /*\n Only combining when in the combine region\n As soon as a boundary is hit then no longer combining\n */\n\n if (didStartAfterCritical) {\n // In original position\n // Will combine with item when inside a band\n if (isDisplaced) {\n return (\n targetEnd > childRect[axis.start] + threshold &&\n targetEnd < childRect[axis.end] - threshold\n );\n }\n\n // child is now 'displaced' backwards from where it started\n // want to combine when we move backwards onto it\n return (\n targetStart > childRect[axis.start] - displacement + threshold &&\n targetStart < childRect[axis.end] - displacement - threshold\n );\n }\n\n // item has moved forwards\n if (isDisplaced) {\n return (\n targetEnd > childRect[axis.start] + displacement + threshold &&\n targetEnd < childRect[axis.end] + displacement - threshold\n );\n }\n\n // is in resting position - being moved backwards on to\n return (\n targetStart > childRect[axis.start] + threshold &&\n targetStart < childRect[axis.end] - threshold\n );\n },\n );\n\n if (!combineWith) {\n return null;\n }\n\n const impact: DragImpact = {\n // no change to displacement when combining\n displacedBy,\n displaced: previousImpact.displaced,\n at: {\n type: 'COMBINE',\n combine: {\n draggableId: combineWith.descriptor.id,\n droppableId: destination.descriptor.id,\n },\n },\n };\n return impact;\n};\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport type {\n DroppableId,\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DroppableDimensionMap,\n DragImpact,\n Viewport,\n LiftEffect,\n} from '../../types';\nimport getDroppableOver from '../get-droppable-over';\nimport getDraggablesInsideDroppable from '../get-draggables-inside-droppable';\nimport withDroppableScroll from '../with-scroll-change/with-droppable-scroll';\nimport getReorderImpact from './get-reorder-impact';\nimport getCombineImpact from './get-combine-impact';\nimport noImpact from '../no-impact';\nimport { offsetRectByPosition } from '../rect';\n\n// Exact\ntype Args = {\n pageOffset: Position,\n draggable: DraggableDimension,\n // all dimensions in system\n draggables: DraggableDimensionMap,\n droppables: DroppableDimensionMap,\n previousImpact: DragImpact,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n pageOffset,\n draggable,\n draggables,\n droppables,\n previousImpact,\n viewport,\n afterCritical,\n}: Args): DragImpact => {\n const pageBorderBox: Rect = offsetRectByPosition(\n draggable.page.borderBox,\n pageOffset,\n );\n\n const destinationId: DroppableId | null = getDroppableOver({\n pageBorderBox,\n draggable,\n droppables,\n });\n\n // not dragging over anything\n\n if (!destinationId) {\n // A big design decision was made here to collapse the home list\n // when not over any list. This yielded the most consistently beautiful experience.\n return noImpact;\n }\n\n const destination: DroppableDimension = droppables[destinationId];\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n destination.descriptor.id,\n draggables,\n );\n\n // Where the element actually is now.\n // Need to take into account the change of scroll in the droppable\n const pageBorderBoxWithDroppableScroll: Rect = withDroppableScroll(\n destination,\n pageBorderBox,\n );\n\n // checking combine first so we combine before any reordering\n return (\n getCombineImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n previousImpact,\n destination,\n insideDestination,\n afterCritical,\n }) ||\n getReorderImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n destination,\n insideDestination,\n last: previousImpact.displaced,\n viewport,\n afterCritical,\n })\n );\n};\n","// @flow\nimport type { DroppableDimension, DroppableDimensionMap } from '../types';\n\nexport default (\n droppables: DroppableDimensionMap,\n updated: DroppableDimension,\n): DroppableDimensionMap => ({\n ...droppables,\n [updated.descriptor.id]: updated,\n});\n","// @flow\nimport {\n addPlaceholder,\n removePlaceholder,\n} from './droppable/with-placeholder';\nimport whatIsDraggedOver from './droppable/what-is-dragged-over';\nimport type {\n DroppableDimension,\n DraggableDimensionMap,\n DroppableDimensionMap,\n DraggableDimension,\n DragImpact,\n DroppableId,\n} from '../types';\nimport patchDroppableMap from './patch-droppable-map';\nimport isHomeOf from './droppable/is-home-of';\n\n// Exact\ntype ClearArgs = {\n previousImpact: DragImpact,\n impact: DragImpact,\n droppables: DroppableDimensionMap,\n};\n\nconst clearUnusedPlaceholder = ({\n previousImpact,\n impact,\n droppables,\n}: ClearArgs): DroppableDimensionMap => {\n const last: DroppableId | null = whatIsDraggedOver(previousImpact);\n const now: DroppableId | null = whatIsDraggedOver(impact);\n\n if (!last) {\n return droppables;\n }\n\n // no change - can keep the last state\n if (last === now) {\n return droppables;\n }\n\n const lastDroppable: DroppableDimension = droppables[last];\n\n // nothing to clear\n if (!lastDroppable.subject.withPlaceholder) {\n return droppables;\n }\n\n const updated: DroppableDimension = removePlaceholder(lastDroppable);\n return patchDroppableMap(droppables, updated);\n};\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n draggables: DraggableDimensionMap,\n droppables: DroppableDimensionMap,\n impact: DragImpact,\n previousImpact: DragImpact,\n};\n\nexport default ({\n draggable,\n draggables,\n droppables,\n previousImpact,\n impact,\n}: Args): DroppableDimensionMap => {\n const cleaned: DroppableDimensionMap = clearUnusedPlaceholder({\n previousImpact,\n impact,\n droppables,\n });\n\n const isOver: DroppableId | null = whatIsDraggedOver(impact);\n\n if (!isOver) {\n return cleaned;\n }\n\n const droppable: DroppableDimension = droppables[isOver];\n\n // no need to add additional space to home droppable\n if (isHomeOf(draggable, droppable)) {\n return cleaned;\n }\n\n // already have a placeholder - nothing to do here!\n if (droppable.subject.withPlaceholder) {\n return cleaned;\n }\n\n // Need to patch the existing droppable\n const patched: DroppableDimension = addPlaceholder(\n droppable,\n draggable,\n draggables,\n );\n\n return patchDroppableMap(cleaned, patched);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DraggableDimension,\n DraggingState,\n ClientPositions,\n PagePositions,\n DragPositions,\n DragImpact,\n Viewport,\n DimensionMap,\n StateWhenUpdatesAllowed,\n DroppableDimensionMap,\n} from '../../../types';\nimport getDragImpact from '../../get-drag-impact';\nimport { add, subtract } from '../../position';\nimport recomputePlaceholders from '../../recompute-placeholders';\n\n// Exact\ntype Args = {\n state: StateWhenUpdatesAllowed,\n clientSelection?: Position,\n dimensions?: DimensionMap,\n viewport?: Viewport,\n // force a custom drag impact\n impact?: DragImpact | null,\n // provide a scroll jump request (optionally provided - and can be null)\n scrollJumpRequest?: Position | null,\n};\n\nexport default ({\n state,\n clientSelection: forcedClientSelection,\n dimensions: forcedDimensions,\n viewport: forcedViewport,\n impact: forcedImpact,\n scrollJumpRequest,\n}: Args): StateWhenUpdatesAllowed => {\n // DRAGGING: can update position and impact\n // COLLECTING: can update position but cannot update impact\n\n const viewport: Viewport = forcedViewport || state.viewport;\n const dimensions: DimensionMap = forcedDimensions || state.dimensions;\n const clientSelection: Position =\n forcedClientSelection || state.current.client.selection;\n\n const offset: Position = subtract(\n clientSelection,\n state.initial.client.selection,\n );\n\n const client: ClientPositions = {\n offset,\n selection: clientSelection,\n borderBoxCenter: add(state.initial.client.borderBoxCenter, offset),\n };\n\n const page: PagePositions = {\n selection: add(client.selection, viewport.scroll.current),\n borderBoxCenter: add(client.borderBoxCenter, viewport.scroll.current),\n offset: add(client.offset, viewport.scroll.diff.value),\n };\n\n const current: DragPositions = {\n client,\n page,\n };\n\n // Not updating impact while bulk collecting\n if (state.phase === 'COLLECTING') {\n return {\n // adding phase to appease flow (even though it will be overwritten by spread)\n // phase: 'COLLECTING',\n ...state,\n dimensions,\n viewport,\n current,\n };\n }\n\n const draggable: DraggableDimension =\n dimensions.draggables[state.critical.draggable.id];\n\n const newImpact: DragImpact =\n forcedImpact ||\n getDragImpact({\n pageOffset: page.offset,\n draggable,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact: state.impact,\n viewport,\n afterCritical: state.afterCritical,\n });\n\n const withUpdatedPlaceholders: DroppableDimensionMap = recomputePlaceholders({\n draggable,\n impact: newImpact,\n previousImpact: state.impact,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n });\n // dragging!\n const result: DraggingState = {\n ...state,\n current,\n dimensions: {\n draggables: dimensions.draggables,\n droppables: withUpdatedPlaceholders,\n },\n impact: newImpact,\n viewport,\n scrollJumpRequest: scrollJumpRequest || null,\n // client updates can be applied as a part of a jump scroll\n // this can be to immediately reverse movement to allow for a nice animation\n // into the final position\n forceShouldAnimate: scrollJumpRequest ? false : null,\n };\n\n return result;\n};\n","// @flow\nimport type {\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DragImpact,\n Viewport,\n DraggableId,\n DisplacementGroups,\n} from '../../types';\nimport getDisplacementGroups from '../get-displacement-groups';\n\n// Exact\ntype RecomputeArgs = {\n impact: DragImpact,\n draggables: DraggableDimensionMap,\n destination: DroppableDimension,\n viewport: Viewport,\n forceShouldAnimate?: boolean,\n};\n\nfunction getDraggables(\n ids: DraggableId[],\n draggables: DraggableDimensionMap,\n): DraggableDimension[] {\n return ids.map((id: DraggableId): DraggableDimension => draggables[id]);\n}\n\nexport default ({\n impact,\n viewport,\n draggables,\n destination,\n forceShouldAnimate,\n}: RecomputeArgs): DragImpact => {\n const last: DisplacementGroups = impact.displaced;\n const afterDragging: DraggableDimension[] = getDraggables(\n last.all,\n draggables,\n );\n\n const displaced: DisplacementGroups = getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n forceShouldAnimate,\n last,\n });\n\n return {\n ...impact,\n displaced,\n };\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n Viewport,\n DragImpact,\n DraggableDimension,\n DraggableDimensionMap,\n LiftEffect,\n} from '../../../types';\nimport getPageBorderBoxCenterFromImpact from '../get-page-border-box-center';\nimport getClientFromPageBorderBoxCenter from './get-client-from-page-border-box-center';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n draggable: DraggableDimension,\n droppable: DroppableDimension,\n draggables: DraggableDimensionMap,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n impact,\n draggable,\n droppable,\n draggables,\n viewport,\n afterCritical,\n}: Args): Position => {\n const pageBorderBoxCenter: Position = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical,\n });\n\n return getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport,\n });\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport type {\n DroppableDimension,\n DraggableDimension,\n StateWhenUpdatesAllowed,\n DroppableId,\n DimensionMap,\n DragImpact,\n Viewport,\n} from '../../../types';\nimport whatIsDraggedOver from '../../droppable/what-is-dragged-over';\nimport recomputeDisplacementVisibility from '../../update-displacement-visibility/recompute';\nimport getClientBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center';\nimport update from './update';\n\n// Exact\ntype Args = {\n state: StateWhenUpdatesAllowed,\n dimensions?: DimensionMap,\n viewport?: Viewport,\n};\n\nexport default ({\n state,\n dimensions: forcedDimensions,\n viewport: forcedViewport,\n}: // when a draggable is changing enabled state, sometimes it needs to force refresh an impact\nArgs): StateWhenUpdatesAllowed => {\n invariant(state.movementMode === 'SNAP');\n\n const needsVisibilityCheck: DragImpact = state.impact;\n const viewport: Viewport = forcedViewport || state.viewport;\n const dimensions: DimensionMap = forcedDimensions || state.dimensions;\n const { draggables, droppables } = dimensions;\n\n const draggable: DraggableDimension = draggables[state.critical.draggable.id];\n const isOver: DroppableId | null = whatIsDraggedOver(needsVisibilityCheck);\n invariant(isOver, 'Must be over a destination in SNAP movement mode');\n const destination: DroppableDimension = droppables[isOver];\n\n const impact: DragImpact = recomputeDisplacementVisibility({\n impact: needsVisibilityCheck,\n viewport,\n destination,\n draggables,\n });\n\n const clientSelection: Position = getClientBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n viewport,\n afterCritical: state.afterCritical,\n });\n\n return update({\n // new\n impact,\n clientSelection,\n // pass through\n state,\n dimensions,\n viewport,\n });\n};\n","// @flow\nimport type { DraggableDescriptor, DraggableLocation } from '../types';\n\nexport default (descriptor: DraggableDescriptor): DraggableLocation => ({\n index: descriptor.index,\n droppableId: descriptor.droppableId,\n});\n","// @flow\nimport { invariant } from '../invariant';\nimport getHomeLocation from './get-home-location';\nimport type {\n DraggableDimension,\n DroppableDimension,\n DraggableDimensionMap,\n DragImpact,\n DisplacedBy,\n Viewport,\n DraggableIdMap,\n DisplacementGroups,\n LiftEffect,\n} from '../types';\nimport getDraggablesInsideDroppable from './get-draggables-inside-droppable';\nimport getDisplacedBy from './get-displaced-by';\nimport getDisplacementGroups from './get-displacement-groups';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n home: DroppableDimension,\n draggables: DraggableDimensionMap,\n viewport: Viewport,\n};\n\n// Exact\ntype Result = {\n afterCritical: LiftEffect,\n impact: DragImpact,\n};\n\nexport default ({ draggable, home, draggables, viewport }: Args): Result => {\n const displacedBy: DisplacedBy = getDisplacedBy(\n home.axis,\n draggable.displaceBy,\n );\n\n const insideHome: DraggableDimension[] = getDraggablesInsideDroppable(\n home.descriptor.id,\n draggables,\n );\n\n // in a list that does not start at 0 the descriptor.index might be different from the index in the list\n // eg a list could be: [2,3,4]. A descriptor.index of '2' would actually be in index '0' of the list\n const rawIndex: number = insideHome.indexOf(draggable);\n invariant(rawIndex !== -1, 'Expected draggable to be inside home list');\n\n const afterDragging: DraggableDimension[] = insideHome.slice(rawIndex + 1);\n const effected: DraggableIdMap = afterDragging.reduce(\n (previous: DraggableIdMap, item: DraggableDimension): DraggableIdMap => {\n previous[item.descriptor.id] = true;\n return previous;\n },\n {},\n );\n const afterCritical: LiftEffect = {\n inVirtualList: home.descriptor.mode === 'virtual',\n displacedBy,\n effected,\n };\n\n const displaced: DisplacementGroups = getDisplacementGroups({\n afterDragging,\n destination: home,\n displacedBy,\n last: null,\n viewport: viewport.frame,\n // originally we do not want any animation as we want\n // everything to be fixed in the same position that\n // it started in\n forceShouldAnimate: false,\n });\n\n const impact: DragImpact = {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: getHomeLocation(draggable.descriptor),\n },\n };\n return { impact, afterCritical };\n};\n","// @flow\nimport type { DimensionMap, DroppableDimension } from '../types';\nimport patchDroppableMap from './patch-droppable-map';\n\nexport default (\n dimensions: DimensionMap,\n updated: DroppableDimension,\n): DimensionMap => ({\n draggables: dimensions.draggables,\n droppables: patchDroppableMap(dimensions.droppables, updated),\n});\n","// @flow\ntype Records = {\n [key: string]: number,\n};\n\nconst records: Records = {};\nlet isEnabled: boolean = false;\n\nconst isTimingsEnabled = (): boolean => isEnabled;\n\nexport const forceEnable = () => {\n isEnabled = true;\n};\n\n// Debug: uncomment to enable\n// forceEnable();\n\nexport const start = (key: string) => {\n // we want to strip all the code out for production builds\n // draw back: can only do timings in dev env (which seems to be fine for now)\n if (process.env.NODE_ENV !== 'production') {\n if (!isTimingsEnabled()) {\n return;\n }\n const now: number = performance.now();\n\n records[key] = now;\n }\n};\n\n// Exact\ntype Style = {\n textColor: string,\n symbol: string,\n};\n\nexport const finish = (key: string) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!isTimingsEnabled()) {\n return;\n }\n const now: number = performance.now();\n\n const previous: number | null = records[key];\n\n if (!previous) {\n // eslint-disable-next-line no-console\n console.warn('cannot finish timing as no previous time found', key);\n return;\n }\n\n const result: number = now - previous;\n const rounded: string = result.toFixed(2);\n\n const style: Style = (() => {\n if (result < 12) {\n return {\n textColor: 'green',\n symbol: '✅',\n };\n }\n if (result < 40) {\n return {\n textColor: 'orange',\n symbol: '⚠️',\n };\n }\n return {\n textColor: 'red',\n symbol: '❌',\n };\n })();\n\n // eslint-disable-next-line no-console\n console.log(\n `${style.symbol} %cTiming %c${rounded} %cms %c${key}`,\n // title\n 'color: blue; font-weight: bold;',\n // result\n `color: ${style.textColor}; font-size: 1.1em;`,\n // ms\n 'color: grey;',\n // key\n 'color: purple; font-weight: bold;',\n );\n }\n};\n","// @flow\nimport {\n withScroll,\n offset as offsetBox,\n type Position,\n type BoxModel,\n} from 'css-box-model';\nimport type { DraggableDimension } from '../../types';\n\n// Exact\ntype Args = {\n draggable: DraggableDimension,\n offset: Position,\n initialWindowScroll: Position,\n};\n\nexport default ({\n draggable,\n offset,\n initialWindowScroll,\n}: Args): DraggableDimension => {\n const client: BoxModel = offsetBox(draggable.client, offset);\n const page: BoxModel = withScroll(client, initialWindowScroll);\n\n const moved: DraggableDimension = {\n ...draggable,\n placeholder: {\n ...draggable.placeholder,\n client,\n },\n client,\n page,\n };\n\n return moved;\n};\n","// @flow\nimport { invariant } from '../invariant';\n\nimport type { DroppableDimension, Scrollable } from '../types';\n\nexport default (droppable: DroppableDimension): Scrollable => {\n const frame: Scrollable | null = droppable.frame;\n invariant(frame, 'Expected Droppable to have a frame');\n return frame;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport type {\n Viewport,\n DraggableDimension,\n DroppableDimension,\n Scrollable,\n DroppableDimensionMap,\n DroppableId,\n} from '../../types';\nimport { add } from '../position';\nimport offsetDraggable from './offset-draggable';\nimport getFrame from '../get-frame';\n\n// Exact\ntype Args = {\n additions: DraggableDimension[],\n updatedDroppables: DroppableDimensionMap,\n viewport: Viewport,\n};\n\nexport default ({\n additions,\n updatedDroppables,\n viewport,\n}: Args): DraggableDimension[] => {\n // We need to adjust collected draggables so that they\n // match the model we had when the drag started.\n // When a draggable is dynamically collected it does not have\n // the same relative client position. We need to unwind\n // any changes in window scroll and droppable scroll so that\n // the newly collected draggables fit in with our other draggables\n // and give the same dimensions that would have had if they were\n // collected at the start of the drag.\n\n // Need to undo the displacement caused by window scroll changes\n const windowScrollChange: Position = viewport.scroll.diff.value;\n // These modified droppables have already had their scroll changes correctly updated\n\n return additions.map((draggable: DraggableDimension): DraggableDimension => {\n const droppableId: DroppableId = draggable.descriptor.droppableId;\n const modified: DroppableDimension = updatedDroppables[droppableId];\n const frame: Scrollable = getFrame(modified);\n const droppableScrollChange: Position = frame.scroll.diff.value;\n\n const totalChange: Position = add(\n windowScrollChange,\n droppableScrollChange,\n );\n\n const moved: DraggableDimension = offsetDraggable({\n draggable,\n offset: totalChange,\n initialWindowScroll: viewport.scroll.initial,\n });\n\n return moved;\n });\n};\n","// @flow\nimport type {\n DimensionMap,\n DraggingState,\n CollectingState,\n DropPendingState,\n Published,\n DraggableId,\n DraggableDimension,\n DroppableDimensionMap,\n DraggableDimensionMap,\n DroppableDimension,\n DragImpact,\n DroppablePublish,\n DroppableId,\n} from '../../types';\nimport * as timings from '../../debug/timings';\nimport getDragImpact from '../get-drag-impact';\nimport adjustAdditionsForScrollChanges from './adjust-additions-for-scroll-changes';\nimport { toDraggableMap, toDroppableMap } from '../dimension-structures';\nimport getLiftEffect from '../get-lift-effect';\nimport scrollDroppable from '../droppable/scroll-droppable';\nimport whatIsDraggedOver from '../droppable/what-is-dragged-over';\n\n// Exact\ntype Args = {\n state: CollectingState | DropPendingState,\n published: Published,\n};\n\nconst timingsKey: string = 'Processing dynamic changes';\n\nexport default ({\n state,\n published,\n}: Args): DraggingState | DropPendingState => {\n timings.start(timingsKey);\n\n // TODO: update window scroll (needs to be a part of the published object)\n // TODO: validate.\n // - Check that all additions / removals have a droppable\n // - Check that all droppables are virtual\n\n // The scroll might be different to what is currently in the state\n // We want to ensure the new draggables are in step with the state\n const withScrollChange: DroppableDimension[] = published.modified.map(\n (update: DroppablePublish): DroppableDimension => {\n const existing: DroppableDimension =\n state.dimensions.droppables[update.droppableId];\n\n const scrolled: DroppableDimension = scrollDroppable(\n existing,\n update.scroll,\n );\n return scrolled;\n },\n );\n\n const droppables: DroppableDimensionMap = {\n ...state.dimensions.droppables,\n ...toDroppableMap(withScrollChange),\n };\n\n const updatedAdditions: DraggableDimensionMap = toDraggableMap(\n adjustAdditionsForScrollChanges({\n additions: published.additions,\n updatedDroppables: droppables,\n viewport: state.viewport,\n }),\n );\n\n const draggables: DraggableDimensionMap = {\n ...state.dimensions.draggables,\n ...updatedAdditions,\n };\n\n // remove all the old ones (except for the critical)\n // we do this so that list operations remain fast\n // TODO: need to test the impact of this like crazy\n published.removals.forEach((id: DraggableId) => {\n delete draggables[id];\n });\n\n const dimensions: DimensionMap = {\n droppables,\n draggables,\n };\n\n const wasOverId: DroppableId | null = whatIsDraggedOver(state.impact);\n const wasOver: DroppableDimension | null = wasOverId\n ? dimensions.droppables[wasOverId]\n : null;\n\n const draggable: DraggableDimension =\n dimensions.draggables[state.critical.draggable.id];\n const home: DroppableDimension =\n dimensions.droppables[state.critical.droppable.id];\n\n const { impact: onLiftImpact, afterCritical } = getLiftEffect({\n draggable,\n home,\n draggables,\n viewport: state.viewport,\n });\n\n const previousImpact: DragImpact =\n wasOver && wasOver.isCombineEnabled\n ? // Cheating here\n // TODO: pursue a more robust approach\n state.impact\n : onLiftImpact;\n\n const impact: DragImpact = getDragImpact({\n pageOffset: state.current.page.offset,\n draggable: dimensions.draggables[state.critical.draggable.id],\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact,\n viewport: state.viewport,\n afterCritical,\n });\n\n timings.finish(timingsKey);\n\n const draggingState: DraggingState = {\n // appeasing flow\n // phase: 'DRAGGING',\n ...state,\n // eslint-disable-next-line\n phase: 'DRAGGING',\n impact,\n onLiftImpact,\n dimensions,\n afterCritical,\n // not animating this movement\n forceShouldAnimate: false,\n };\n\n if (state.phase === 'COLLECTING') {\n return draggingState;\n }\n\n // There was a DROP_PENDING\n // Staying in the DROP_PENDING phase\n // setting isWaiting for false\n\n const dropPending: DropPendingState = {\n // appeasing flow\n // phase: 'DROP_PENDING',\n ...draggingState,\n // eslint-disable-next-line\n phase: 'DROP_PENDING',\n // No longer waiting\n reason: state.reason,\n isWaiting: false,\n };\n\n return dropPending;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { invariant } from '../invariant';\nimport type {\n DimensionMap,\n State,\n StateWhenUpdatesAllowed,\n DraggableDimension,\n DroppableDimension,\n IdleState,\n DraggingState,\n DragPositions,\n ClientPositions,\n CollectingState,\n DropAnimatingState,\n DropPendingState,\n Viewport,\n DropReason,\n} from '../types';\nimport type { Action } from './store-types';\nimport type { PublicResult as MoveInDirectionResult } from './move-in-direction/move-in-direction-types';\nimport scrollDroppable from './droppable/scroll-droppable';\nimport moveInDirection from './move-in-direction';\nimport { add, isEqual, origin } from './position';\nimport scrollViewport from './scroll-viewport';\nimport isMovementAllowed from './is-movement-allowed';\nimport { toDroppableList } from './dimension-structures';\nimport update from './post-reducer/when-moving/update';\nimport refreshSnap from './post-reducer/when-moving/refresh-snap';\nimport getLiftEffect from './get-lift-effect';\nimport patchDimensionMap from './patch-dimension-map';\nimport publishWhileDraggingInVirtual from './publish-while-dragging-in-virtual';\n\nconst isSnapping = (state: StateWhenUpdatesAllowed): boolean =>\n state.movementMode === 'SNAP';\n\nconst postDroppableChange = (\n state: StateWhenUpdatesAllowed,\n updated: DroppableDimension,\n isEnabledChanging: boolean,\n): StateWhenUpdatesAllowed => {\n const dimensions: DimensionMap = patchDimensionMap(state.dimensions, updated);\n\n // if the enabled state is changing, we need to force a update\n if (!isSnapping(state) || isEnabledChanging) {\n return update({\n state,\n dimensions,\n });\n }\n\n return refreshSnap({\n state,\n dimensions,\n });\n};\n\nexport function isDragging(\n state: State,\n): state is DraggingState | CollectingState | DropPendingState {\n return (\n state.phase === 'DRAGGING' ||\n state.phase === 'COLLECTING' ||\n state.phase === 'DROP_PENDING'\n );\n}\n\nfunction removeScrollJumpRequest(state: State): State {\n if (isDragging(state) && state.movementMode === 'SNAP') {\n return {\n // will be overwritten by spread\n // needed for flow\n // phase: 'DRAGGING',\n ...state,\n scrollJumpRequest: null\n };\n }\n return state;\n}\n\nconst idle: IdleState = { phase: 'IDLE', completed: null, shouldFlush: false };\n\nexport default (state: State = idle, action: Action): State => {\n if (action.type === 'FLUSH') {\n return {\n ...idle,\n shouldFlush: true,\n };\n }\n\n if (action.type === 'INITIAL_PUBLISH') {\n invariant(\n state.phase === 'IDLE',\n 'INITIAL_PUBLISH must come after a IDLE phase',\n );\n const {\n critical,\n clientSelection,\n viewport,\n dimensions,\n movementMode,\n } = action.payload;\n\n const draggable: DraggableDimension =\n dimensions.draggables[critical.draggable.id];\n const home: DroppableDimension =\n dimensions.droppables[critical.droppable.id];\n\n const client: ClientPositions = {\n selection: clientSelection,\n borderBoxCenter: draggable.client.borderBox.center,\n offset: origin,\n };\n\n const initial: DragPositions = {\n client,\n page: {\n selection: add(client.selection, viewport.scroll.initial),\n borderBoxCenter: add(client.selection, viewport.scroll.initial),\n offset: add(client.selection, viewport.scroll.diff.value),\n },\n };\n\n // Can only auto scroll the window if every list is not fixed on the page\n const isWindowScrollAllowed: boolean = toDroppableList(\n dimensions.droppables,\n ).every((item: DroppableDimension) => !item.isFixedOnPage);\n\n const { impact, afterCritical } = getLiftEffect({\n draggable,\n home,\n draggables: dimensions.draggables,\n viewport,\n });\n\n const result: DraggingState = {\n phase: 'DRAGGING',\n isDragging: true,\n critical,\n movementMode,\n dimensions,\n initial,\n current: initial,\n isWindowScrollAllowed,\n impact,\n afterCritical,\n onLiftImpact: impact,\n viewport,\n scrollJumpRequest: null,\n forceShouldAnimate: null,\n };\n\n return result;\n }\n\n if (action.type === 'COLLECTION_STARTING') {\n // A collection might have restarted. We do not care as we are already in the right phase\n // TODO: remove?\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n state.phase === 'DRAGGING',\n `Collection cannot start from phase ${state.phase}`,\n );\n\n const result: CollectingState = {\n // putting phase first to appease flow\n // phase: 'COLLECTING',\n ...state,\n // eslint-disable-next-line\n phase: 'COLLECTING',\n };\n\n return result;\n }\n\n if (action.type === 'PUBLISH_WHILE_DRAGGING') {\n // Unexpected bulk publish\n invariant(\n state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING',\n `Unexpected ${action.type} received in phase ${state.phase}`,\n );\n\n return publishWhileDraggingInVirtual({\n state,\n published: action.payload,\n });\n }\n\n if (action.type === 'MOVE') {\n // Not allowing any more movements\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `${action.type} not permitted in phase ${state.phase}`,\n );\n\n const { client: clientSelection } = action.payload;\n\n // nothing needs to be done\n if (isEqual(clientSelection, state.current.client.selection)) {\n return state;\n }\n\n return update({\n state,\n clientSelection,\n // If we are snap moving - manual movements should not update the impact\n impact: isSnapping(state) ? state.impact : null,\n });\n }\n\n if (action.type === 'UPDATE_DROPPABLE_SCROLL') {\n // Not allowing changes while a drop is pending\n // Cannot get this during a DROP_ANIMATING as the dimension\n // marshal will cancel any pending scroll updates\n if (state.phase === 'DROP_PENDING') {\n return removeScrollJumpRequest(state);\n }\n\n // We will be updating the scroll in response to dynamic changes\n // manually on the droppable so we can ignore this change\n if (state.phase === 'COLLECTING') {\n return removeScrollJumpRequest(state);\n }\n\n invariant(\n isMovementAllowed(state),\n `${action.type} not permitted in phase ${state.phase}`,\n );\n\n const { id, newScroll } = action.payload;\n const target: DroppableDimension | null = state.dimensions.droppables[id];\n\n // This is possible if a droppable has been asked to watch scroll but\n // the dimension has not been published yet\n if (!target) {\n return state;\n }\n\n const scrolled: DroppableDimension = scrollDroppable(target, newScroll);\n return postDroppableChange(state, scrolled, false);\n }\n\n if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') {\n // Things are locked at this point\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `Attempting to move in an unsupported phase ${state.phase}`,\n );\n\n const { id, isEnabled } = action.payload;\n const target: DroppableDimension | null = state.dimensions.droppables[id];\n\n invariant(\n target,\n `Cannot find Droppable[id: ${id}] to toggle its enabled state`,\n );\n\n invariant(\n target.isEnabled !== isEnabled,\n `Trying to set droppable isEnabled to ${String(isEnabled)}\n but it is already ${String(target.isEnabled)}`,\n );\n\n const updated: DroppableDimension = {\n ...target,\n isEnabled,\n };\n\n return postDroppableChange(state, updated, true);\n }\n\n if (action.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') {\n // Things are locked at this point\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `Attempting to move in an unsupported phase ${state.phase}`,\n );\n\n const { id, isCombineEnabled } = action.payload;\n const target: DroppableDimension | null = state.dimensions.droppables[id];\n\n invariant(\n target,\n `Cannot find Droppable[id: ${id}] to toggle its isCombineEnabled state`,\n );\n\n invariant(\n target.isCombineEnabled !== isCombineEnabled,\n `Trying to set droppable isCombineEnabled to ${String(isCombineEnabled)}\n but it is already ${String(target.isCombineEnabled)}`,\n );\n\n const updated: DroppableDimension = {\n ...target,\n isCombineEnabled,\n };\n\n return postDroppableChange(state, updated, true);\n }\n\n if (action.type === 'MOVE_BY_WINDOW_SCROLL') {\n // No longer accepting changes\n if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') {\n return state;\n }\n\n invariant(\n isMovementAllowed(state),\n `Cannot move by window in phase ${state.phase}`,\n );\n\n invariant(\n state.isWindowScrollAllowed,\n 'Window scrolling is currently not supported for fixed lists',\n );\n\n const newScroll: Position = action.payload.newScroll;\n\n // nothing needs to be done\n if (isEqual(state.viewport.scroll.current, newScroll)) {\n return removeScrollJumpRequest(state);\n }\n\n const viewport: Viewport = scrollViewport(state.viewport, newScroll);\n\n if (isSnapping(state)) {\n return refreshSnap({\n state,\n viewport,\n });\n }\n\n return update({\n state,\n viewport,\n });\n }\n\n if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {\n // Could occur if a transitionEnd occurs after a drag ends\n if (!isMovementAllowed(state)) {\n return state;\n }\n\n const maxScroll: Position = action.payload.maxScroll;\n\n if (isEqual(maxScroll, state.viewport.scroll.max)) {\n return state;\n }\n\n const withMaxScroll: Viewport = {\n ...state.viewport,\n scroll: {\n ...state.viewport.scroll,\n max: maxScroll,\n },\n };\n\n // don't need to recalc any updates\n return {\n // phase will be overridden - appeasing flow\n // phase: 'DRAGGING',\n ...state,\n viewport: withMaxScroll,\n };\n }\n if (\n action.type === 'MOVE_UP' ||\n action.type === 'MOVE_DOWN' ||\n action.type === 'MOVE_LEFT' ||\n action.type === 'MOVE_RIGHT'\n ) {\n // Not doing keyboard movements during these phases\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n\n invariant(\n state.phase === 'DRAGGING',\n `${action.type} received while not in DRAGGING phase`,\n );\n\n const result: MoveInDirectionResult | null = moveInDirection({\n state,\n type: action.type,\n });\n\n // cannot move in that direction\n if (!result) {\n return state;\n }\n\n return update({\n state,\n impact: result.impact,\n clientSelection: result.clientSelection,\n scrollJumpRequest: result.scrollJumpRequest,\n });\n }\n\n if (action.type === 'DROP_PENDING') {\n const reason: DropReason = action.payload.reason;\n invariant(\n state.phase === 'COLLECTING',\n 'Can only move into the DROP_PENDING phase from the COLLECTING phase',\n );\n\n const newState: DropPendingState = {\n // appeasing flow\n // phase: 'DROP_PENDING',\n ...state,\n // eslint-disable-next-line\n phase: 'DROP_PENDING',\n isWaiting: true,\n reason,\n };\n return newState;\n }\n\n if (action.type === 'DROP_ANIMATE') {\n const { completed, dropDuration, newHomeClientOffset } = action.payload;\n invariant(\n state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING',\n `Cannot animate drop from phase ${state.phase}`,\n );\n\n // Moving into a new phase\n const result: DropAnimatingState = {\n phase: 'DROP_ANIMATING',\n completed,\n dropDuration,\n newHomeClientOffset,\n dimensions: state.dimensions,\n };\n\n return result;\n }\n\n // Action will be used by responders to call consumers\n // We can simply return to the idle state\n if (action.type === 'DROP_COMPLETE') {\n const { completed } = action.payload;\n\n return {\n phase: 'IDLE',\n completed,\n shouldFlush: false,\n };\n }\n\n return state;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n Critical,\n DraggableId,\n DroppableId,\n CompletedDrag,\n MovementMode,\n Viewport,\n DimensionMap,\n DropReason,\n Published,\n} from '../types';\n\n// Exact\nexport type BeforeInitialCaptureArgs = {\n draggableId: DraggableId,\n movementMode: MovementMode,\n};\n\n// Exact\nexport type BeforeInitialCaptureAction = {\n type: 'BEFORE_INITIAL_CAPTURE',\n payload: BeforeInitialCaptureArgs,\n};\n\nexport const beforeInitialCapture = (\n args: BeforeInitialCaptureArgs,\n): BeforeInitialCaptureAction => ({\n type: 'BEFORE_INITIAL_CAPTURE',\n payload: args,\n});\n\n// Exact\nexport type LiftArgs = {\n // lifting with DraggableId rather than descriptor\n // as the descriptor might change after a drop is flushed\n id: DraggableId,\n clientSelection: Position,\n movementMode: MovementMode,\n};\n\n// Exact\nexport type LiftAction = {\n type: 'LIFT',\n payload: LiftArgs,\n};\n\nexport const lift = (args: LiftArgs): LiftAction => ({\n type: 'LIFT',\n payload: args,\n});\n\n// Exact\nexport type InitialPublishArgs = {\n critical: Critical,\n dimensions: DimensionMap,\n clientSelection: Position,\n viewport: Viewport,\n movementMode: MovementMode,\n};\n\n// Exact\nexport type InitialPublishAction = {\n type: 'INITIAL_PUBLISH',\n payload: InitialPublishArgs,\n};\n\nexport const initialPublish = (\n args: InitialPublishArgs,\n): InitialPublishAction => ({\n type: 'INITIAL_PUBLISH',\n payload: args,\n});\n\n// Exact\nexport type WhileDraggingPublishAction = {\n type: 'PUBLISH_WHILE_DRAGGING',\n payload: Published,\n};\n\nexport const publishWhileDragging = (\n args: Published,\n): WhileDraggingPublishAction => ({\n type: 'PUBLISH_WHILE_DRAGGING',\n payload: args,\n});\n\n// Exact\nexport type CollectionStartingAction = {\n type: 'COLLECTION_STARTING',\n payload: null,\n};\n\nexport const collectionStarting = (): CollectionStartingAction => ({\n type: 'COLLECTION_STARTING',\n payload: null,\n});\n\nexport type UpdateDroppableScrollArgs = {\n id: DroppableId,\n newScroll: Position,\n};\n\n// Exact\nexport type UpdateDroppableScrollAction = {\n type: 'UPDATE_DROPPABLE_SCROLL',\n payload: UpdateDroppableScrollArgs,\n};\n\nexport const updateDroppableScroll = (\n args: UpdateDroppableScrollArgs,\n): UpdateDroppableScrollAction => ({\n type: 'UPDATE_DROPPABLE_SCROLL',\n payload: args,\n});\n\n// Exact\nexport type UpdateDroppableIsEnabledArgs = {\n id: DroppableId,\n isEnabled: boolean,\n};\n\n// Exact\nexport type UpdateDroppableIsEnabledAction = {\n type: 'UPDATE_DROPPABLE_IS_ENABLED',\n payload: UpdateDroppableIsEnabledArgs,\n};\n\nexport const updateDroppableIsEnabled = (\n args: UpdateDroppableIsEnabledArgs,\n): UpdateDroppableIsEnabledAction => ({\n type: 'UPDATE_DROPPABLE_IS_ENABLED',\n payload: args,\n});\n\n// Exact\nexport type UpdateDroppableIsCombineEnabledArgs = {\n id: DroppableId,\n isCombineEnabled: boolean,\n};\n\n// Exact\nexport type UpdateDroppableIsCombineEnabledAction = {\n type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',\n payload: UpdateDroppableIsCombineEnabledArgs,\n};\n\nexport const updateDroppableIsCombineEnabled = (\n args: UpdateDroppableIsCombineEnabledArgs,\n): UpdateDroppableIsCombineEnabledAction => ({\n type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',\n payload: args,\n});\n\n// Exact\nexport type MoveArgs = {\n client: Position,\n};\n\n// Exact\nexport type MoveAction = {\n type: 'MOVE',\n payload: MoveArgs,\n};\n\nexport const move = (args: MoveArgs): MoveAction => ({\n type: 'MOVE',\n payload: args,\n});\n\n// Exact\ntype MoveByWindowScrollArgs = {\n newScroll: Position,\n};\n\n// Exact\nexport type MoveByWindowScrollAction = {\n type: 'MOVE_BY_WINDOW_SCROLL',\n payload: MoveByWindowScrollArgs,\n};\n\nexport const moveByWindowScroll = (\n args: MoveByWindowScrollArgs,\n): MoveByWindowScrollAction => ({\n type: 'MOVE_BY_WINDOW_SCROLL',\n payload: args,\n});\n\n// Exact\nexport type UpdateViewportMaxScrollArgs = {\n maxScroll: Position,\n};\n\n// Exact\ntype UpdateViewportMaxScrollAction = {\n type: 'UPDATE_VIEWPORT_MAX_SCROLL',\n payload: UpdateViewportMaxScrollArgs,\n};\n\nexport const updateViewportMaxScroll = (\n args: UpdateViewportMaxScrollArgs,\n): UpdateViewportMaxScrollAction => ({\n type: 'UPDATE_VIEWPORT_MAX_SCROLL',\n payload: args,\n});\n\n// Exact\nexport type MoveUpAction = {\n type: 'MOVE_UP',\n payload: null,\n};\n\nexport const moveUp = (): MoveUpAction => ({\n type: 'MOVE_UP',\n payload: null,\n});\n\n// Exact\nexport type MoveDownAction = {\n type: 'MOVE_DOWN',\n payload: null,\n};\n\nexport const moveDown = (): MoveDownAction => ({\n type: 'MOVE_DOWN',\n payload: null,\n});\n\n// Exact\nexport type MoveRightAction = {\n type: 'MOVE_RIGHT',\n payload: null,\n};\n\nexport const moveRight = (): MoveRightAction => ({\n type: 'MOVE_RIGHT',\n payload: null,\n});\n\n// Exact\nexport type MoveLeftAction = {\n type: 'MOVE_LEFT',\n payload: null,\n};\n\nexport const moveLeft = (): MoveLeftAction => ({\n type: 'MOVE_LEFT',\n payload: null,\n});\n\n// Exact\ntype FlushAction = {\n type: 'FLUSH',\n payload: null,\n};\n\nexport const flush = (): FlushAction => ({\n type: 'FLUSH',\n payload: null,\n});\n\n// Exact\nexport type AnimateDropArgs = {\n completed: CompletedDrag,\n newHomeClientOffset: Position,\n dropDuration: number,\n};\n\nexport type DropAnimateAction = {\n type: 'DROP_ANIMATE',\n payload: AnimateDropArgs,\n};\n\nexport const animateDrop = (args: AnimateDropArgs): DropAnimateAction => ({\n type: 'DROP_ANIMATE',\n payload: args,\n});\n\n// Exact\nexport type DropCompleteArgs = {\n completed: CompletedDrag,\n};\n\nexport type DropCompleteAction = {\n type: 'DROP_COMPLETE',\n payload: DropCompleteArgs,\n};\n\nexport const completeDrop = (args: DropCompleteArgs): DropCompleteAction => ({\n type: 'DROP_COMPLETE',\n payload: args,\n});\n\n// Exact\ntype DropArgs = {\n reason: DropReason,\n};\n\n// Exact\nexport type DropAction = {\n type: 'DROP',\n payload: DropArgs,\n};\n\nexport const drop = (args: DropArgs): DropAction => ({\n type: 'DROP',\n payload: args,\n});\n\nexport const cancel = () => drop({ reason: 'CANCEL' });\n\n// Exact\nexport type DropPendingAction = {\n type: 'DROP_PENDING',\n payload: DropArgs,\n};\n\nexport const dropPending = (args: DropArgs): DropPendingAction => ({\n type: 'DROP_PENDING',\n payload: args,\n});\n\n// Exact\nexport type DropAnimationFinishedAction = {\n type: 'DROP_ANIMATION_FINISHED',\n payload: null,\n};\n\nexport const dropAnimationFinished = (): DropAnimationFinishedAction => ({\n type: 'DROP_ANIMATION_FINISHED',\n payload: null,\n});\n\nexport type Action =\n | BeforeInitialCaptureAction\n | LiftAction\n | InitialPublishAction\n | WhileDraggingPublishAction\n | CollectionStartingAction\n | UpdateDroppableScrollAction\n | UpdateDroppableIsEnabledAction\n | UpdateDroppableIsCombineEnabledAction\n | MoveByWindowScrollAction\n | UpdateViewportMaxScrollAction\n // | PostJumpScrollAction\n // | PostSnapDestinationChangeAction\n | MoveAction\n | MoveUpAction\n | MoveDownAction\n | MoveRightAction\n | MoveLeftAction\n | DropPendingAction\n | DropAction\n | DropAnimateAction\n | DropAnimationFinishedAction\n | DropCompleteAction\n | FlushAction;\n","// @flow\nimport type {\n Critical,\n DimensionMap,\n DraggableDimension,\n} from '../../../types';\nimport getDraggablesInsideDroppable from '../../get-draggables-inside-droppable';\nimport { warning } from '../../../dev-warning';\n\ntype ErrorMap = {\n [index: number]: true,\n};\n\nfunction checkIndexes(insideDestination: DraggableDimension[]) {\n // no point running if there are 1 or less items\n if (insideDestination.length <= 1) {\n return;\n }\n\n const indexes: number[] = insideDestination.map(\n (d: DraggableDimension): number => d.descriptor.index,\n );\n\n const errors: ErrorMap = {};\n\n for (let i = 1; i < indexes.length; i++) {\n const current: number = indexes[i];\n const previous: number = indexes[i - 1];\n\n // this will be an error if:\n // 1. index is not consecutive\n // 2. index is duplicated (which is true if #1 is not passed)\n if (current !== previous + 1) {\n errors[current] = true;\n }\n }\n\n if (!Object.keys(errors).length) {\n return;\n }\n\n const formatted: string = indexes\n .map((index: number): string => {\n const hasError: boolean = Boolean(errors[index]);\n\n return hasError ? `[🔥${index}]` : `${index}`;\n })\n .join(', ');\n\n warning(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${formatted}\n `);\n}\n\nexport default function validateDimensions(\n critical: Critical,\n dimensions: DimensionMap,\n): void {\n // wrapping entire block for better minification\n if (process.env.NODE_ENV !== 'production') {\n const insideDestination: DraggableDimension[] = getDraggablesInsideDroppable(\n critical.droppable.id,\n dimensions.draggables,\n );\n checkIndexes(insideDestination);\n }\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { DimensionMarshal } from '../dimension-marshal/dimension-marshal-types';\nimport type { State, ScrollOptions, LiftRequest } from '../../types';\nimport type { MiddlewareStore, Action, Dispatch } from '../store-types';\nimport {\n completeDrop,\n initialPublish,\n flush,\n beforeInitialCapture,\n} from '../action-creators';\nimport validateDimensions from './util/validate-dimensions';\n\nexport default (marshal: DimensionMarshal) => ({\n getState,\n dispatch,\n}: MiddlewareStore) => (next: Dispatch) => (action: Action): any => {\n if (action.type !== 'LIFT') {\n next(action);\n return;\n }\n const { id, clientSelection, movementMode } = action.payload;\n const initial: State = getState();\n\n // flush dropping animation if needed\n // this can change the descriptor of the dragging item\n // Will call the onDragEnd responders\n\n if (initial.phase === 'DROP_ANIMATING') {\n dispatch(completeDrop({ completed: initial.completed }));\n }\n\n invariant(getState().phase === 'IDLE', 'Unexpected phase to start a drag');\n\n // Removing any placeholders before we capture any starting dimensions\n dispatch(flush());\n\n // Let consumers know we are just about to publish\n // We are only publishing a small amount of information as\n // things might change as a result of the onBeforeCapture callback\n dispatch(beforeInitialCapture({ draggableId: id, movementMode }));\n\n // will communicate with the marshal to start requesting dimensions\n const scrollOptions: ScrollOptions = {\n shouldPublishImmediately: movementMode === 'SNAP',\n };\n const request: LiftRequest = {\n draggableId: id,\n scrollOptions,\n };\n // Let's get the marshal started!\n const { critical, dimensions, viewport } = marshal.startPublishing(request);\n\n validateDimensions(critical, dimensions);\n\n // Okay, we are good to start dragging now\n dispatch(\n initialPublish({\n critical,\n dimensions,\n clientSelection,\n movementMode,\n viewport,\n }),\n );\n};\n","// @flow\nimport type { Action, Dispatch } from '../store-types';\nimport type { StyleMarshal } from '../../view/use-style-marshal/style-marshal-types';\n\nexport default (marshal: StyleMarshal) => () => (next: Dispatch) => (\n action: Action,\n): any => {\n if (action.type === 'INITIAL_PUBLISH') {\n marshal.dragging();\n }\n\n if (action.type === 'DROP_ANIMATE') {\n marshal.dropping(action.payload.completed.result.reason);\n }\n\n // this will clear any styles immediately before a reorder\n if (action.type === 'FLUSH' || action.type === 'DROP_COMPLETE') {\n marshal.resting();\n }\n\n next(action);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { isEqual, origin } from './state/position';\n\nexport const curves = {\n outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)',\n drop: 'cubic-bezier(.2,1,.1,1)',\n};\n\nexport const combine = {\n opacity: {\n // while dropping: fade out totally\n drop: 0,\n // while dragging: fade out partially\n combining: 0.7,\n },\n scale: {\n drop: 0.75,\n },\n};\n\nexport const timings = {\n outOfTheWay: 0.2,\n // greater than the out of the way time\n // so that when the drop ends everything will\n // have to be out of the way\n minDropTime: 0.33,\n maxDropTime: 0.55,\n};\n\n// slow timings\n// uncomment to use\n// export const timings = {\n// outOfTheWay: 2,\n// // greater than the out of the way time\n// // so that when the drop ends everything will\n// // have to be out of the way\n// minDropTime: 3,\n// maxDropTime: 4,\n// };\n\nconst outOfTheWayTiming: string = `${timings.outOfTheWay}s ${curves.outOfTheWay}`;\nexport const placeholderTransitionDelayTime: number = 0.1;\n\nexport const transitions = {\n fluid: `opacity ${outOfTheWayTiming}`,\n snap: `transform ${outOfTheWayTiming}, opacity ${outOfTheWayTiming}`,\n drop: (duration: number): string => {\n const timing: string = `${duration}s ${curves.drop}`;\n return `transform ${timing}, opacity ${timing}`;\n },\n outOfTheWay: `transform ${outOfTheWayTiming}`,\n placeholder: `height ${outOfTheWayTiming}, width ${outOfTheWayTiming}, margin ${outOfTheWayTiming}`,\n};\n\nconst moveTo = (offset: Position): string | null =>\n isEqual(offset, origin) ? null : `translate(${offset.x}px, ${offset.y}px)`;\n\nexport const transforms = {\n moveTo,\n drop: (offset: Position, isCombining: boolean) => {\n const translate: string | null = moveTo(offset);\n if (!translate) {\n return null;\n }\n\n // only transforming the translate\n if (!isCombining) {\n return translate;\n }\n\n // when dropping while combining we also update the scale\n return `${translate} scale(${combine.scale.drop})`;\n },\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { distance as getDistance } from '../../position';\nimport { timings } from '../../../animation';\nimport type { DropReason } from '../../../types';\n\n// Exact\ntype GetDropDurationArgs = {\n current: Position,\n destination: Position,\n reason: DropReason,\n};\n\nconst { minDropTime, maxDropTime } = timings;\nconst dropTimeRange: number = maxDropTime - minDropTime;\nconst maxDropTimeAtDistance: number = 1500;\n// will bring a time lower - which makes it faster\nconst cancelDropModifier: number = 0.6;\n\nexport default ({\n current,\n destination,\n reason,\n}: GetDropDurationArgs): number => {\n const distance: number = getDistance(current, destination);\n // even if there is no distance to travel, we might still need to animate opacity\n if (distance <= 0) {\n return minDropTime;\n }\n\n if (distance >= maxDropTimeAtDistance) {\n return maxDropTime;\n }\n\n // * range from:\n // 0px = 0.33s\n // 1500px and over = 0.55s\n // * If reason === 'CANCEL' then speeding up the animation\n // * round to 2 decimal points\n\n const percentage: number = distance / maxDropTimeAtDistance;\n const duration: number = minDropTime + dropTimeRange * percentage;\n\n const withDuration: number =\n reason === 'CANCEL' ? duration * cancelDropModifier : duration;\n // To two decimal points by converting to string and back\n return Number(withDuration.toFixed(2));\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n Viewport,\n DragImpact,\n DimensionMap,\n DraggableDimension,\n DroppableId,\n LiftEffect,\n} from '../../../types';\nimport whatIsDraggedOver from '../../droppable/what-is-dragged-over';\nimport { subtract } from '../../position';\nimport getClientBorderBoxCenter from '../../get-center-from-impact/get-client-border-box-center';\n\n// Exact\ntype Args = {\n impact: DragImpact,\n draggable: DraggableDimension,\n dimensions: DimensionMap,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\nexport default ({\n impact,\n draggable,\n dimensions,\n viewport,\n afterCritical,\n}: Args): Position => {\n const { draggables, droppables } = dimensions;\n const droppableId: DroppableId | null = whatIsDraggedOver(impact);\n const destination: DroppableDimension | null = droppableId\n ? droppables[droppableId]\n : null;\n const home: DroppableDimension = droppables[draggable.descriptor.droppableId];\n\n const newClientCenter: Position = getClientBorderBoxCenter({\n impact,\n draggable,\n draggables,\n // if there is no destination, then we will be dropping back into the home\n afterCritical,\n droppable: destination || home,\n viewport,\n });\n\n const offset: Position = subtract(\n newClientCenter,\n draggable.client.borderBox.center,\n );\n\n return offset;\n};\n","// @flow\nimport type {\n DropReason,\n DragImpact,\n Viewport,\n DroppableDimension,\n DraggableDimensionMap,\n LiftEffect,\n} from '../../../types';\nimport recompute from '../../update-displacement-visibility/recompute';\nimport { emptyGroups } from '../../no-impact';\n\n// Exact\ntype Args = {\n draggables: DraggableDimensionMap,\n home: DroppableDimension,\n reason: DropReason,\n lastImpact: DragImpact,\n onLiftImpact: DragImpact,\n viewport: Viewport,\n afterCritical: LiftEffect,\n};\n\n// Exact\nexport type Result = {\n impact: DragImpact,\n didDropInsideDroppable: boolean,\n};\n\nexport default ({\n draggables,\n reason,\n lastImpact,\n home,\n viewport,\n onLiftImpact,\n}: Args): Result => {\n if (!lastImpact.at || reason !== 'DROP') {\n // Dropping outside of a list or the drag was cancelled\n\n // Going to use the on lift impact\n // Need to recompute the visibility of the original impact\n // What is visible can be different to when the drag started\n\n const recomputedHomeImpact: DragImpact = recompute({\n draggables,\n impact: onLiftImpact,\n destination: home,\n viewport,\n // We need the draggables to animate back to their positions\n forceShouldAnimate: true,\n });\n\n return {\n impact: recomputedHomeImpact,\n didDropInsideDroppable: false,\n };\n }\n\n // use the existing impact\n if (lastImpact.at.type === 'REORDER') {\n return {\n impact: lastImpact,\n didDropInsideDroppable: true,\n };\n }\n\n // When merging we remove the movement so that everything\n // will animate closed\n const withoutMovement: DragImpact = {\n ...lastImpact,\n displaced: emptyGroups,\n };\n\n return {\n impact: withoutMovement,\n didDropInsideDroppable: true,\n };\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { invariant } from '../../../invariant';\nimport type {\n State,\n DropReason,\n Critical,\n DraggableLocation,\n DropResult,\n CompletedDrag,\n Combine,\n DimensionMap,\n DraggableDimension,\n} from '../../../types';\nimport type { MiddlewareStore, Dispatch, Action } from '../../store-types';\nimport {\n animateDrop,\n completeDrop,\n dropPending,\n type AnimateDropArgs,\n} from '../../action-creators';\nimport { isEqual } from '../../position';\nimport getDropDuration from './get-drop-duration';\nimport getNewHomeClientOffset from './get-new-home-client-offset';\nimport getDropImpact, { type Result } from './get-drop-impact';\nimport { tryGetCombine, tryGetDestination } from '../../get-impact-location';\n\nexport default ({ getState, dispatch }: MiddlewareStore) => (\n next: Dispatch,\n) => (action: Action): unknown => {\n if (action.type !== 'DROP') {\n next(action);\n return;\n }\n\n const state: State = getState();\n const reason: DropReason = action.payload.reason;\n\n // Still waiting for a bulk collection to publish\n // We are now shifting the application into the 'DROP_PENDING' phase\n if (state.phase === 'COLLECTING') {\n dispatch(dropPending({ reason }));\n return;\n }\n\n // Could have occurred in response to an error\n if (state.phase === 'IDLE') {\n return;\n }\n\n // Still waiting for our drop pending to end\n // TODO: should this throw?\n const isWaitingForDrop: boolean =\n state.phase === 'DROP_PENDING' && state.isWaiting;\n invariant(\n !isWaitingForDrop,\n 'A DROP action occurred while DROP_PENDING and still waiting',\n );\n\n invariant(\n state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING',\n `Cannot drop in phase: ${state.phase}`,\n );\n // We are now in the DRAGGING or DROP_PENDING phase\n\n const critical: Critical = state.critical;\n const dimensions: DimensionMap = state.dimensions;\n const draggable: DraggableDimension =\n dimensions.draggables[state.critical.draggable.id];\n // Only keeping impact when doing a user drop - otherwise we are cancelling\n\n const { impact, didDropInsideDroppable }: Result = getDropImpact({\n reason,\n lastImpact: state.impact,\n afterCritical: state.afterCritical,\n onLiftImpact: state.onLiftImpact,\n home: state.dimensions.droppables[state.critical.droppable.id],\n viewport: state.viewport,\n draggables: state.dimensions.draggables,\n });\n\n // only populating destination / combine if 'didDropInsideDroppable' is true\n const destination: DraggableLocation | null = didDropInsideDroppable\n ? tryGetDestination(impact)\n : null;\n const combine: Combine | null = didDropInsideDroppable\n ? tryGetCombine(impact)\n : null;\n\n const source: DraggableLocation = {\n index: critical.draggable.index,\n droppableId: critical.droppable.id,\n };\n\n const result: DropResult = {\n draggableId: draggable.descriptor.id,\n type: draggable.descriptor.type,\n source,\n reason,\n mode: state.movementMode,\n // destination / combine will be null if didDropInsideDroppable is true\n destination,\n combine,\n };\n\n const newHomeClientOffset: Position = getNewHomeClientOffset({\n impact,\n draggable,\n dimensions,\n viewport: state.viewport,\n afterCritical: state.afterCritical,\n });\n\n const completed: CompletedDrag = {\n critical: state.critical,\n afterCritical: state.afterCritical,\n result,\n impact,\n };\n\n const isAnimationRequired: boolean =\n // 1. not already in the right spot\n !isEqual(state.current.client.offset, newHomeClientOffset) ||\n // 2. doing a combine (we still want to animate the scale and opacity fade)\n // looking at the result and not the impact as the combine impact is cleared\n Boolean(result.combine);\n\n if (!isAnimationRequired) {\n dispatch(completeDrop({ completed }));\n return;\n }\n\n const dropDuration: number = getDropDuration({\n current: state.current.client.offset,\n destination: newHomeClientOffset,\n reason,\n });\n\n const args: AnimateDropArgs = {\n newHomeClientOffset,\n dropDuration,\n completed,\n };\n\n dispatch(animateDrop(args));\n};\n","var rafSchd = function rafSchd(fn) {\n var lastArgs = [];\n var frameId = null;\n\n var wrapperFn = function wrapperFn() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n lastArgs = args;\n\n if (frameId) {\n return;\n }\n\n frameId = requestAnimationFrame(function () {\n frameId = null;\n fn.apply(void 0, lastArgs);\n });\n };\n\n wrapperFn.cancel = function () {\n if (!frameId) {\n return;\n }\n\n cancelAnimationFrame(frameId);\n frameId = null;\n };\n\n return wrapperFn;\n};\n\nexport default rafSchd;\n","// @flow\nimport { type Position } from 'css-box-model';\n\n// The browsers update document.documentElement.scrollTop and window.pageYOffset\n// differently as the window scrolls.\n\n// Webkit\n// documentElement.scrollTop: no update. Stays at 0\n// window.pageYOffset: updates to whole number\n\n// Chrome\n// documentElement.scrollTop: update with fractional value\n// window.pageYOffset: update with fractional value\n\n// FireFox\n// documentElement.scrollTop: updates to whole number\n// window.pageYOffset: updates to whole number\n\n// IE11 (same as firefox)\n// documentElement.scrollTop: updates to whole number\n// window.pageYOffset: updates to whole number\n\n// Edge (same as webkit)\n// documentElement.scrollTop: no update. Stays at 0\n// window.pageYOffset: updates to whole number\n\nexport default (): Position => ({\n x: window.pageXOffset,\n y: window.pageYOffset,\n});\n","// @flow\nimport type { Position } from 'css-box-model';\nimport rafSchd from 'raf-schd';\nimport { invariant } from '../invariant';\nimport bindEvents from './event-bindings/bind-events';\nimport type { EventBinding } from './event-bindings/event-types';\nimport getWindowScroll from './window/get-window-scroll';\nimport { noop } from '../empty';\n\ntype OnWindowScroll = (newScroll: Position) => void;\n\n// Exact\ntype Args = {\n onWindowScroll: OnWindowScroll,\n};\n\n// Exact\ntype Result = {\n start: () => void,\n stop: () => void,\n isActive: () => boolean,\n};\n\nfunction getWindowScrollBinding(update: () => void): EventBinding {\n return {\n eventName: 'scroll',\n // ## Passive: true\n // Eventual consistency is fine because we use position: fixed on the item\n // ## Capture: false\n // Scroll events on elements do not bubble, but they go through the capture phase\n // https://twitter.com/alexandereardon/status/985994224867819520\n // Using capture: false here as we want to avoid intercepting droppable scroll requests\n options: { passive: true, capture: false },\n fn: (event: UIEvent) => {\n // IE11 fix\n // All scrollable events still bubble up and are caught by this handler in ie11.\n // On a window scroll the event.target should be the window or the document.\n // If this is not the case then it is not a 'window' scroll event and can be ignored\n if (event.target !== window && event.target !== window.document) {\n return;\n }\n\n update();\n },\n };\n}\n\nexport default function getScrollListener({ onWindowScroll }: Args): Result {\n function updateScroll() {\n // letting the update function read the latest scroll when called\n onWindowScroll(getWindowScroll());\n }\n\n const scheduled = rafSchd(updateScroll);\n const binding: EventBinding = getWindowScrollBinding(scheduled);\n let unbind: () => void = noop;\n\n function isActive(): boolean {\n return unbind !== noop;\n }\n\n function start() {\n invariant(!isActive(), 'Cannot start scroll listener when already active');\n unbind = bindEvents(window, [binding], {});\n }\n function stop() {\n invariant(isActive(), 'Cannot stop scroll listener when not active');\n scheduled.cancel();\n unbind();\n unbind = noop;\n }\n\n return { start, stop, isActive };\n}\n","// @flow\nimport type { Position } from 'css-box-model';\nimport { moveByWindowScroll } from '../action-creators';\nimport type { MiddlewareStore, Action, Dispatch } from '../store-types';\nimport getScrollListener from '../../view/scroll-listener';\n\n// TODO: this is taken from auto-scroll. Let's make it a util\nconst shouldEnd = (action: Action): boolean =>\n action.type === 'DROP_COMPLETE' ||\n action.type === 'DROP_ANIMATE' ||\n action.type === 'FLUSH';\n\nexport default (store: MiddlewareStore) => {\n const listener = getScrollListener({\n onWindowScroll: (newScroll: Position) => {\n store.dispatch(moveByWindowScroll({ newScroll }));\n },\n });\n\n return (next: Dispatch) => (action: Action): any => {\n if (!listener.isActive() && action.type === 'INITIAL_PUBLISH') {\n listener.start();\n }\n\n if (listener.isActive() && shouldEnd(action)) {\n listener.stop();\n }\n\n next(action);\n };\n};\n","// @flow\nimport type { Announce, TimeoutID } from '../../../types';\nimport { warning } from '../../../dev-warning';\n\nexport type ExpiringAnnounce = Announce & {\n wasCalled: () => boolean,\n};\n\nexport default (announce: Announce): ExpiringAnnounce => {\n let wasCalled: boolean = false;\n let isExpired: boolean = false;\n\n // not allowing async announcements\n const timeoutId: TimeoutID = setTimeout(() => {\n isExpired = true;\n });\n\n const result = (message: string): void => {\n if (wasCalled) {\n warning('Announcement already made. Not making a second announcement');\n\n return;\n }\n\n if (isExpired) {\n warning(`\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n `);\n return;\n }\n\n wasCalled = true;\n announce(message);\n clearTimeout(timeoutId);\n };\n\n // getter for isExpired\n // using this technique so that a consumer cannot\n // set the isExpired or wasCalled flags\n result.wasCalled = (): boolean => wasCalled;\n\n return result;\n};\n","// @flow\nimport { invariant } from '../../../invariant';\nimport { findIndex } from '../../../native-with-fallback';\nimport { TimeoutID } from '../../../types';\n\n// Exact\ntype Entry = {\n timerId: TimeoutID,\n callback: Function,\n};\n\n// Exact\nexport type AsyncMarshal = {\n add: (fn: Function) => void,\n flush: () => void,\n};\n\nexport default () => {\n const entries: Entry[] = [];\n\n const execute = (timerId: TimeoutID) => {\n const index: number = findIndex(\n entries,\n (item: Entry): boolean => item.timerId === timerId,\n );\n invariant(index !== -1, 'Could not find timer');\n // delete in place\n const [entry] = entries.splice(index, 1);\n entry.callback();\n };\n\n const add = (fn: Function) => {\n const timerId: TimeoutID = setTimeout(() => execute(timerId));\n const entry: Entry = {\n timerId,\n callback: fn,\n };\n entries.push(entry);\n };\n\n const flush = () => {\n // nothing to flush\n if (!entries.length) {\n return;\n }\n\n const shallow: Entry[] = [...entries];\n // clearing entries in case a callback adds some more callbacks\n entries.length = 0;\n\n shallow.forEach((entry: Entry) => {\n clearTimeout(entry.timerId);\n entry.callback();\n });\n };\n\n return { add, flush };\n};\n","// @flow\nimport type { Critical, DraggableLocation, Combine } from '../../../types';\n\nexport const areLocationsEqual = (\n first: DraggableLocation | null,\n second: DraggableLocation | null,\n): boolean => {\n // if both are null - we are equal\n if (first == null && second == null) {\n return true;\n }\n\n // if one is null - then they are not equal\n if (first == null || second == null) {\n return false;\n }\n\n // compare their actual values\n return (\n first.droppableId === second.droppableId && first.index === second.index\n );\n};\n\nexport const isCombineEqual = (first: Combine | null, second: Combine | null): boolean => {\n // if both are null - we are equal\n if (first == null && second == null) {\n return true;\n }\n\n // only one is null\n if (first == null || second == null) {\n return false;\n }\n\n return (\n first.draggableId === second.draggableId &&\n first.droppableId === second.droppableId\n );\n};\n\nexport const isCriticalEqual = (first: Critical, second: Critical): boolean => {\n if (first === second) {\n return true;\n }\n\n const isDraggableEqual: boolean =\n first.draggable.id === second.draggable.id &&\n first.draggable.droppableId === second.draggable.droppableId &&\n first.draggable.type === second.draggable.type &&\n first.draggable.index === second.draggable.index;\n\n const isDroppableEqual: boolean =\n first.droppable.id === second.droppable.id &&\n first.droppable.type === second.droppable.type;\n\n return isDraggableEqual && isDroppableEqual;\n};\n","// @flow\nimport { invariant } from '../../../invariant';\nimport messagePreset from '../../../screen-reader-message-preset';\nimport * as timings from '../../../debug/timings';\nimport getExpiringAnnounce, {\n type ExpiringAnnounce,\n} from './expiring-announce';\nimport getAsyncMarshal, { type AsyncMarshal } from './async-marshal';\nimport type {\n DropResult,\n Responders,\n ResponderProvided,\n Critical,\n BeforeCapture,\n DragImpact,\n DraggableLocation,\n Combine,\n DragStart,\n Announce,\n DragUpdate,\n MovementMode,\n DraggableId,\n OnBeforeCaptureResponder,\n OnBeforeDragStartResponder,\n OnDragStartResponder,\n OnDragUpdateResponder,\n OnDragEndResponder,\n} from '../../../types';\nimport { isCombineEqual, isCriticalEqual, areLocationsEqual } from './is-equal';\nimport { tryGetDestination, tryGetCombine } from '../../get-impact-location';\n\nconst withTimings = (key: string, fn: Function) => {\n timings.start(key);\n fn();\n timings.finish(key);\n};\n\nconst getDragStart = (critical: Critical, mode: MovementMode): DragStart => ({\n draggableId: critical.draggable.id,\n type: critical.droppable.type,\n source: {\n droppableId: critical.droppable.id,\n index: critical.draggable.index,\n },\n mode,\n});\n\ntype AnyPrimaryResponderFn =\n | OnDragStartResponder\n | OnDragUpdateResponder\n | OnDragEndResponder;\n\ntype AnyResponderData = DragStart | DragUpdate | DropResult;\n\nconst execute = (\n responder: AnyPrimaryResponderFn | null,\n data: AnyResponderData,\n announce: Announce,\n getDefaultMessage: (data: any) => string,\n) => {\n if (!responder) {\n announce(getDefaultMessage(data));\n return;\n }\n\n const willExpire: ExpiringAnnounce = getExpiringAnnounce(announce);\n const provided: ResponderProvided = {\n announce: willExpire,\n };\n\n // Casting because we are not validating which data type is going into which responder\n responder(data as any, provided); // Casted to any\n\n if (!willExpire.wasCalled()) {\n announce(getDefaultMessage(data));\n }\n};\n\n// Exact\nexport type WhileDragging = {\n mode: MovementMode\n lastCritical: Critical,\n lastCombine: Combine | null,\n lastLocation: DraggableLocation | null,\n};\n\nexport default (getResponders: () => Responders, announce: Announce) => {\n const asyncMarshal: AsyncMarshal = getAsyncMarshal();\n let dragging: WhileDragging | null = null;\n\n const beforeCapture = (draggableId: DraggableId, mode: MovementMode) => {\n invariant(\n !dragging,\n 'Cannot fire onBeforeCapture as a drag start has already been published',\n );\n withTimings('onBeforeCapture', () => {\n // No use of screen reader for this responder\n const fn: OnBeforeCaptureResponder | null | undefined = getResponders().onBeforeCapture;\n if (fn) {\n const before: BeforeCapture = {\n draggableId,\n mode,\n };\n fn(before);\n }\n });\n };\n\n const beforeStart = (critical: Critical, mode: MovementMode) => {\n invariant(\n !dragging,\n 'Cannot fire onBeforeDragStart as a drag start has already been published',\n );\n withTimings('onBeforeDragStart', () => {\n // No use of screen reader for this responder\n const fn: OnBeforeDragStartResponder | null | undefined = getResponders().onBeforeDragStart;\n if (fn) {\n fn(getDragStart(critical, mode));\n }\n });\n };\n\n const start = (critical: Critical, mode: MovementMode) => {\n invariant(\n !dragging,\n 'Cannot fire onBeforeDragStart as a drag start has already been published',\n );\n const data: DragStart = getDragStart(critical, mode);\n dragging = {\n mode,\n lastCritical: critical,\n lastLocation: data.source,\n lastCombine: null,\n };\n\n // we will flush this frame if we receive any responder updates\n asyncMarshal.add(() => {\n withTimings('onDragStart', () =>\n execute(\n getResponders().onDragStart ?? null,\n data,\n announce,\n messagePreset.onDragStart,\n ),\n );\n });\n };\n\n // Passing in the critical location again as it can change during a drag\n const update = (critical: Critical, impact: DragImpact) => {\n const location: DraggableLocation | null = tryGetDestination(impact);\n const combine: Combine | null = tryGetCombine(impact);\n\n invariant(\n dragging,\n 'Cannot fire onDragMove when onDragStart has not been called',\n );\n\n // Has the critical changed? Will result in a source change\n const hasCriticalChanged: boolean = !isCriticalEqual(\n critical,\n dragging.lastCritical,\n );\n if (hasCriticalChanged) {\n dragging.lastCritical = critical;\n }\n\n // Has the location changed? Will result in a destination change\n const hasLocationChanged: boolean = !areLocationsEqual(\n dragging.lastLocation,\n location,\n );\n if (hasLocationChanged) {\n dragging.lastLocation = location;\n }\n const hasGroupingChanged: boolean = !isCombineEqual(\n dragging.lastCombine,\n combine,\n );\n if (hasGroupingChanged) {\n dragging.lastCombine = combine;\n }\n\n // Nothing has changed - no update needed\n if (!hasCriticalChanged && !hasLocationChanged && !hasGroupingChanged) {\n return;\n }\n\n const data: DragUpdate = {\n ...getDragStart(critical, dragging.mode),\n combine,\n destination: location,\n };\n\n asyncMarshal.add(() => {\n withTimings('onDragUpdate', () =>\n execute(\n getResponders().onDragUpdate ?? null,\n data,\n announce,\n messagePreset.onDragUpdate,\n ),\n );\n });\n };\n\n const flush = () => {\n invariant(dragging, 'Can only flush responders while dragging');\n asyncMarshal.flush();\n };\n\n const drop = (result: DropResult) => {\n invariant(\n dragging,\n 'Cannot fire onDragEnd when there is no matching onDragStart',\n );\n dragging = null;\n // not adding to frame marshal - we want this to be done in the same render pass\n // we also want the consumers reorder logic to be in the same render pass\n withTimings('onDragEnd', () =>\n execute(\n getResponders().onDragEnd,\n result,\n announce,\n messagePreset.onDragEnd,\n ),\n );\n };\n\n // A non user initiated cancel\n const abort = () => {\n // aborting can happen defensively\n if (!dragging) {\n return;\n }\n\n const result: DropResult = {\n ...getDragStart(dragging.lastCritical, dragging.mode),\n combine: null,\n destination: null,\n reason: 'CANCEL',\n };\n drop(result);\n };\n\n return {\n beforeCapture,\n beforeStart,\n start,\n update,\n flush,\n drop,\n abort,\n };\n};\n","// @flow\nimport getPublisher from './publisher';\n\nimport type {\n State,\n DropResult,\n Responders,\n Critical,\n Announce,\n} from '../../../types';\n\nimport type {\n Action,\n // Middleware,\n MiddlewareStore,\n Dispatch,\n} from '../../store-types';\n\nexport default (\n getResponders: () => Responders,\n announce: Announce,\n) => { // Middleware\n const publisher = getPublisher(\n getResponders,\n announce,\n );\n\n return (store: MiddlewareStore) => (next: Dispatch) => (\n action: Action,\n ): any => {\n\n if (action.type === 'BEFORE_INITIAL_CAPTURE') {\n publisher.beforeCapture(\n action.payload.draggableId,\n action.payload.movementMode,\n );\n return;\n }\n\n if (action.type === 'INITIAL_PUBLISH') {\n const critical: Critical = action.payload.critical;\n publisher.beforeStart(critical, action.payload.movementMode);\n next(action);\n publisher.start(critical, action.payload.movementMode);\n return;\n }\n\n // Drag end\n if (action.type === 'DROP_COMPLETE') {\n // it is important that we use the result and not the last impact\n // the last impact might be different to the result for visual reasons\n const result: DropResult = action.payload.completed.result;\n // flushing all pending responders before snapshots are updated\n publisher.flush();\n next(action);\n publisher.drop(result);\n return;\n }\n\n // All other responders can fire after we have updated our connected components\n next(action);\n\n // Drag state resetting - need to check if\n // we should fire a onDragEnd responder\n if (action.type === 'FLUSH') {\n publisher.abort();\n return;\n }\n\n // ## Perform drag updates\n // impact of action has already been reduced\n\n const state: State = store.getState();\n\n if (state.phase === 'DRAGGING') {\n publisher.update(state.critical, state.impact);\n return;\n }\n\n };\n};\n","// @flow\nimport { invariant } from '../../../invariant';\nimport { completeDrop } from '../../action-creators';\nimport type { State } from '../../../types';\nimport type { MiddlewareStore, Action, Dispatch } from '../../store-types';\n\nexport default (store: MiddlewareStore) => (next: Dispatch) => (\n action: Action,\n): any => {\n if (action.type !== 'DROP_ANIMATION_FINISHED') {\n next(action);\n return;\n }\n\n const state: State = store.getState();\n invariant(\n state.phase === 'DROP_ANIMATING',\n 'Cannot finish a drop animating when no drop is occurring',\n );\n store.dispatch(completeDrop({ completed: state.completed }));\n};\n","// @flow\nimport { dropAnimationFinished } from '../../action-creators';\nimport type { AnimationFrameID, State } from '../../../types';\nimport type { MiddlewareStore, Action, Dispatch } from '../../store-types';\nimport type { EventBinding } from '../../../view/event-bindings/event-types';\nimport bindEvents from '../../../view/event-bindings/bind-events';\n\nexport default (store: MiddlewareStore) => {\n let unbind: (() => void) | null;\n let frameId: AnimationFrameID | null= null;\n\n function clear() {\n if (frameId) {\n cancelAnimationFrame(frameId);\n frameId = null;\n }\n\n if (unbind) {\n unbind();\n unbind = null;\n }\n }\n\n return (next: Dispatch) => (action: Action): any => {\n if (\n action.type === 'FLUSH' ||\n action.type === 'DROP_COMPLETE' ||\n action.type === 'DROP_ANIMATION_FINISHED'\n ) {\n clear();\n }\n\n next(action);\n\n if (action.type !== 'DROP_ANIMATE') {\n return;\n }\n\n const binding: EventBinding = {\n eventName: 'scroll',\n // capture: true will catch all scroll events, event from scroll containers\n // once: just in case, we only want to ever fire one\n options: { capture: true, passive: false, once: true },\n fn: function flushDropAnimation() {\n const state: State = store.getState();\n if (state.phase === 'DROP_ANIMATING') {\n store.dispatch(dropAnimationFinished());\n }\n },\n };\n\n // The browser can batch a few scroll events in a single frame\n // including the one that ended the drag.\n // Binding after a requestAnimationFrame ensures that any scrolls caused\n // by the auto scroller are finished\n // TODO: why is a second window scroll being fired?\n // It leads to funny drop positions :(\n frameId = requestAnimationFrame(() => {\n frameId = null;\n unbind = bindEvents(window, [binding], {});\n });\n };\n};\n","// @flow\nimport type { Action, Dispatch } from '../store-types';\nimport type { DimensionMarshal } from '../dimension-marshal/dimension-marshal-types';\n\nexport default (marshal: DimensionMarshal) => () => (next: Dispatch) => (\n action: Action,\n): any => {\n // Not stopping a collection on a 'DROP' as we want a collection to continue\n if (\n // drag is finished\n action.type === 'DROP_COMPLETE' ||\n action.type === 'FLUSH' ||\n // no longer accepting changes once the drop has started\n action.type === 'DROP_ANIMATE'\n ) {\n marshal.stopPublishing();\n }\n\n next(action);\n};\n","// @flow\nimport type { DropResult } from '../../types';\nimport type { Action, Dispatch } from '../store-types';\nimport type { FocusMarshal } from '../../view/use-focus-marshal/focus-marshal-types';\n\nexport default (marshal: FocusMarshal) => {\n let isWatching: boolean = false;\n\n return () => (next: Dispatch) => (action: Action): any => {\n if (action.type === 'INITIAL_PUBLISH') {\n isWatching = true;\n\n marshal.tryRecordFocus(action.payload.critical.draggable.id);\n next(action);\n marshal.tryRestoreFocusRecorded();\n return;\n }\n\n next(action);\n\n if (!isWatching) {\n return;\n }\n\n if (action.type === 'FLUSH') {\n isWatching = false;\n marshal.tryRestoreFocusRecorded();\n return;\n }\n\n if (action.type === 'DROP_COMPLETE') {\n isWatching = false;\n const result: DropResult = action.payload.completed.result;\n\n // give focus to the combine target when combining\n if (result.combine) {\n marshal.tryShiftRecord(result.draggableId, result.combine.draggableId);\n }\n marshal.tryRestoreFocusRecorded();\n }\n };\n};\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { AutoScroller } from '../auto-scroller/auto-scroller-types';\nimport type { Action, Dispatch, MiddlewareStore } from '../store-types';\nimport type { State } from '../../types';\n\nconst shouldStop = (action: Action): boolean =>\n action.type === 'DROP_COMPLETE' ||\n action.type === 'DROP_ANIMATE' ||\n action.type === 'FLUSH';\n\nexport default (autoScroller: AutoScroller) => (store: MiddlewareStore) => (\n next: Dispatch,\n) => (action: Action): any => {\n if (shouldStop(action)) {\n autoScroller.stop();\n next(action);\n return;\n }\n\n if (action.type === 'INITIAL_PUBLISH') {\n // letting the action go first to hydrate the state\n next(action);\n const state: State = store.getState();\n invariant(\n state.phase === 'DRAGGING',\n 'Expected phase to be DRAGGING after INITIAL_PUBLISH',\n );\n autoScroller.start(state);\n return;\n }\n\n // auto scroll happens in response to state changes\n // releasing all actions to the reducer first\n next(action);\n\n autoScroller.scroll(store.getState());\n};\n","// @flow\nimport { drop } from '../action-creators';\nimport type { State } from '../../types';\nimport type { MiddlewareStore, Dispatch, Action } from '../store-types';\n\nexport default (store: MiddlewareStore) => (next: Dispatch) => (\n action: Action,\n): any => {\n // Always let the action go through first\n next(action);\n\n if (action.type !== 'PUBLISH_WHILE_DRAGGING') {\n return;\n }\n\n // A bulk replace occurred - check if\n // 1. there is a pending drop\n // 2. that the pending drop is no longer waiting\n\n const postActionState: State = store.getState();\n\n // no pending drop after the publish\n if (postActionState.phase !== 'DROP_PENDING') {\n return;\n }\n\n // the pending drop is still waiting for completion\n if (postActionState.isWaiting) {\n return;\n }\n\n store.dispatch(\n drop({\n reason: postActionState.reason,\n }),\n );\n};\n","// @flow\n/* eslint-disable no-underscore-dangle */\nimport { applyMiddleware, createStore, compose } from 'redux';\nimport reducer from './reducer';\nimport lift from './middleware/lift';\nimport style from './middleware/style';\nimport drop from './middleware/drop/drop-middleware';\nimport scrollListener from './middleware/scroll-listener';\nimport responders from './middleware/responders/responders-middleware';\nimport dropAnimationFinish from './middleware/drop/drop-animation-finish-middleware';\nimport dropAnimationFlushOnScroll from './middleware/drop/drop-animation-flush-on-scroll-middleware';\nimport dimensionMarshalStopper from './middleware/dimension-marshal-stopper';\nimport focus from './middleware/focus';\nimport autoScroll from './middleware/auto-scroll';\nimport pendingDrop from './middleware/pending-drop';\nimport type { DimensionMarshal } from './dimension-marshal/dimension-marshal-types';\nimport type { FocusMarshal } from '../view/use-focus-marshal/focus-marshal-types';\nimport type { StyleMarshal } from '../view/use-style-marshal/style-marshal-types';\nimport type { AutoScroller } from './auto-scroller/auto-scroller-types';\nimport type { Responders, Announce } from '../types';\nimport type { Store } from './store-types';\n\n// We are checking if window is available before using it.\n// This is needed for universal apps that render the component server side.\n// Details: https://github.com/zalmoxisus/redux-devtools-extension#12-advanced-store-setup\nconst composeEnhancers =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n name: 'draggable',\n })\n : compose;\n\n// Exact\ntype Args = {\n dimensionMarshal: DimensionMarshal,\n focusMarshal: FocusMarshal,\n styleMarshal: StyleMarshal,\n getResponders: () => Responders,\n announce: Announce,\n autoScroller: AutoScroller,\n};\n\nexport default ({\n dimensionMarshal,\n focusMarshal,\n styleMarshal,\n getResponders,\n announce,\n autoScroller,\n}: Args): Store =>\n createStore(\n reducer,\n composeEnhancers(\n applyMiddleware(\n // ## Debug middleware\n\n // > uncomment to use\n // debugging logger\n // require('../debug/middleware/log').default('light'),\n // // user timing api\n // require('../debug/middleware/user-timing').default,\n // debugging timer\n // require('../debug/middleware/action-timing').default,\n // average action timer\n // require('../debug/middleware/action-timing-average').default(200),\n\n // ## Application middleware\n\n // Style updates do not cause more actions. It is important to update styles\n // before responders are called: specifically the onDragEnd responder. We need to clear\n // the transition styles off the elements before a reorder to prevent strange\n // post drag animations in firefox. Even though we clear the transition off\n // a Draggable - if it is done after a reorder firefox will still apply the\n // transition.\n // Must be called before dimension marshal for lifting to apply collecting styles\n style(styleMarshal),\n // Stop the dimension marshal collecting anything\n // when moving into a phase where collection is no longer needed.\n // We need to stop the marshal before responders fire as responders can cause\n // dimension registration changes in response to reordering\n dimensionMarshalStopper(dimensionMarshal),\n // Fire application responders in response to drag changes\n lift(dimensionMarshal),\n drop,\n // When a drop animation finishes - fire a drop complete\n dropAnimationFinish,\n dropAnimationFlushOnScroll,\n pendingDrop,\n autoScroll(autoScroller),\n scrollListener,\n focus(focusMarshal),\n // Fire responders for consumers (after update to store)\n responders(getResponders, announce),\n ),\n ),\n );\n","// @flow\nimport type { Position } from 'css-box-model';\nimport type {\n DraggableId,\n DroppableId,\n DraggableDescriptor,\n Published,\n DraggableDimension,\n DroppablePublish,\n DroppableIdMap,\n DraggableIdMap,\n} from '../../types';\nimport type {\n DroppableEntry,\n Registry,\n DraggableEntry,\n DraggableEntryMap,\n} from '../registry/registry-types';\nimport * as timings from '../../debug/timings';\nimport { origin } from '../position';\n\nexport type WhileDraggingPublisher = {\n add: (entry: DraggableEntry) => void,\n remove: (entry: DraggableEntry) => void,\n stop: () => void,\n};\n\ntype Staging = {\n additions: DraggableEntryMap,\n removals: DraggableIdMap,\n modified: DroppableIdMap,\n};\n\ntype Callbacks = {\n publish: (args: Published) => unknown,\n collectionStarting: () => unknown,\n};\n\ntype Args = {\n registry: Registry,\n callbacks: Callbacks,\n};\n\nconst clean = (): Staging => ({\n additions: {},\n removals: {},\n modified: {},\n});\n\nconst timingKey: string = 'Publish collection from DOM';\n\nexport default function createPublisher({\n registry,\n callbacks,\n}: Args): WhileDraggingPublisher {\n let staging: Staging = clean();\n let frameId: any = null; // AnimationFrameID\n\n const collect = () => {\n if (frameId) {\n return;\n }\n\n callbacks.collectionStarting();\n frameId = requestAnimationFrame(() => {\n frameId = null;\n timings.start(timingKey);\n\n const { additions, removals, modified } = staging;\n\n const added: DraggableDimension[] = Object.keys(additions)\n .map(\n // Using the origin as the window scroll. This will be adjusted when processing the published values\n (id: DraggableId): DraggableDimension =>\n registry.draggable.getById(id).getDimension(origin),\n )\n // Dimensions are not guarenteed to be ordered in the same order as keys\n // So we need to sort them so they are in the correct order\n .sort(\n (a: DraggableDimension, b: DraggableDimension): number =>\n a.descriptor.index - b.descriptor.index,\n );\n\n const updated: DroppablePublish[] = Object.keys(modified).map(\n (id: DroppableId) => {\n const entry: DroppableEntry = registry.droppable.getById(id);\n\n const scroll: Position = entry.callbacks.getScrollWhileDragging();\n return {\n droppableId: id,\n scroll,\n };\n },\n );\n\n const result: Published = {\n additions: added,\n removals: Object.keys(removals),\n modified: updated,\n };\n\n staging = clean();\n\n timings.finish(timingKey);\n callbacks.publish(result);\n });\n };\n\n const add = (entry: DraggableEntry) => {\n const id: DraggableId = entry.descriptor.id;\n staging.additions[id] = entry;\n staging.modified[entry.descriptor.droppableId] = true;\n\n if (staging.removals[id]) {\n delete staging.removals[id];\n }\n collect();\n };\n\n const remove = (entry: DraggableEntry) => {\n const descriptor: DraggableDescriptor = entry.descriptor;\n staging.removals[descriptor.id] = true;\n staging.modified[descriptor.droppableId] = true;\n\n if (staging.additions[descriptor.id]) {\n delete staging.additions[descriptor.id];\n }\n collect();\n };\n\n const stop = () => {\n if (!frameId) {\n return;\n }\n\n cancelAnimationFrame(frameId);\n frameId = null;\n staging = clean();\n };\n\n return {\n add,\n remove,\n stop,\n };\n}\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { subtract } from './position';\n\n// Exact\ntype Args = {\n scrollHeight: number,\n scrollWidth: number,\n height: number,\n width: number,\n};\n\nexport default ({\n scrollHeight,\n scrollWidth,\n height,\n width,\n}: Args): Position => {\n const maxScroll: Position = subtract(\n // full size\n { x: scrollWidth, y: scrollHeight },\n // viewport size\n { x: width, y: height },\n );\n\n const adjustedMaxScroll: Position = {\n x: Math.max(0, maxScroll.x),\n y: Math.max(0, maxScroll.y),\n };\n\n return adjustedMaxScroll;\n};\n","// @flow\nimport { invariant } from '../invariant';\n\nexport default (): HTMLElement => {\n const doc: HTMLElement | null = document.documentElement;\n invariant(doc, 'Cannot find document.documentElement');\n return doc;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport getMaxScroll from '../../state/get-max-scroll';\nimport getDocumentElement from '../get-document-element';\n\nexport default (): Position => {\n const doc: HTMLElement = getDocumentElement();\n\n const maxScroll: Position = getMaxScroll({\n // unclipped padding box, with scrollbar\n scrollHeight: doc.scrollHeight,\n scrollWidth: doc.scrollWidth,\n // clipped padding box, without scrollbar\n width: doc.clientWidth,\n height: doc.clientHeight,\n });\n\n return maxScroll;\n};\n","// @flow\nimport { getRect, type Rect, type Position } from 'css-box-model';\nimport type { Viewport } from '../../types';\nimport { origin } from '../../state/position';\nimport getWindowScroll from './get-window-scroll';\nimport getMaxWindowScroll from './get-max-window-scroll';\nimport getDocumentElement from '../get-document-element';\n\nexport default (): Viewport => {\n const scroll: Position = getWindowScroll();\n const maxScroll: Position = getMaxWindowScroll();\n\n const top: number = scroll.y;\n const left: number = scroll.x;\n\n // window.innerHeight: includes scrollbars (not what we want)\n // document.clientHeight gives us the correct value when using the html5 doctype\n const doc: HTMLElement = getDocumentElement();\n // Using these values as they do not consider scrollbars\n // padding box, without scrollbar\n const width: number = doc.clientWidth;\n const height: number = doc.clientHeight;\n\n // Computed\n const right: number = left + width;\n const bottom: number = top + height;\n\n const frame: Rect = getRect({\n top,\n left,\n right,\n bottom,\n });\n\n const viewport: Viewport = {\n frame,\n scroll: {\n initial: scroll,\n current: scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin,\n },\n },\n };\n\n return viewport;\n};\n","// @flow\nimport type { Position } from 'css-box-model';\nimport * as timings from '../../debug/timings';\nimport type { StartPublishingResult } from './dimension-marshal-types';\nimport type {\n Registry,\n DraggableEntry,\n DroppableEntry,\n} from '../registry/registry-types';\nimport { toDraggableMap, toDroppableMap } from '../dimension-structures';\nimport type {\n DroppableDescriptor,\n DroppableDimension,\n DraggableDimension,\n DimensionMap,\n ScrollOptions,\n Critical,\n Viewport,\n} from '../../types';\nimport getViewport from '../../view/window/get-viewport';\n\ntype Args = {\n critical: Critical,\n scrollOptions: ScrollOptions,\n registry: Registry,\n};\n\nexport default ({\n critical,\n scrollOptions,\n registry,\n}: Args): StartPublishingResult => {\n const timingKey: string = 'Initial collection from DOM';\n timings.start(timingKey);\n const viewport: Viewport = getViewport();\n const windowScroll: Position = viewport.scroll.current;\n\n const home: DroppableDescriptor = critical.droppable;\n\n const droppables: DroppableDimension[] = registry.droppable\n .getAllByType(home.type)\n .map((entry: DroppableEntry): DroppableDimension =>\n entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions),\n );\n\n const draggables: DraggableDimension[] = registry.draggable\n .getAllByType(critical.draggable.type)\n .map((entry: DraggableEntry): DraggableDimension =>\n entry.getDimension(windowScroll),\n );\n\n const dimensions: DimensionMap = {\n draggables: toDraggableMap(draggables),\n droppables: toDroppableMap(droppables),\n };\n\n timings.finish(timingKey);\n\n const result: StartPublishingResult = {\n dimensions,\n critical,\n viewport,\n };\n\n return result;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport type {\n DimensionMarshal,\n Callbacks,\n StartPublishingResult,\n} from './dimension-marshal-types';\nimport createPublisher, {\n type WhileDraggingPublisher,\n} from './while-dragging-publisher';\nimport getInitialPublish from './get-initial-publish';\nimport type {\n Registry,\n DroppableEntry,\n DraggableEntry,\n Subscriber,\n Unsubscribe,\n RegistryEvent,\n} from '../registry/registry-types';\nimport type {\n DroppableId,\n DroppableDescriptor,\n LiftRequest,\n Critical,\n DraggableDescriptor,\n} from '../../types';\nimport { warning } from '../../dev-warning';\n\n// Exact\ntype Collection = {\n critical: Critical,\n unsubscribe: Unsubscribe,\n};\n\nfunction shouldPublishUpdate(\n registry: Registry,\n dragging: DraggableDescriptor,\n entry: DraggableEntry,\n): boolean {\n // do not publish updates for the critical draggable\n if (entry.descriptor.id === dragging.id) {\n return false;\n }\n // do not publish updates for draggables that are not of a type that we care about\n if (entry.descriptor.type !== dragging.type) {\n return false;\n }\n\n const home: DroppableEntry = registry.droppable.getById(\n entry.descriptor.droppableId,\n );\n\n if (home.descriptor.mode !== 'virtual') {\n warning(`\n You are attempting to add or remove a Draggable [id: ${entry.descriptor.id}]\n while a drag is occurring. This is only supported for virtual lists.\n\n See https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/patterns/virtual-lists.md\n `);\n return false;\n }\n\n return true;\n}\n\nexport default (registry: Registry, callbacks: Callbacks) => {\n let collection: Collection | null | undefined = null;\n\n const publisher: WhileDraggingPublisher = createPublisher({\n callbacks: {\n publish: callbacks.publishWhileDragging,\n collectionStarting: callbacks.collectionStarting,\n },\n registry,\n });\n\n const updateDroppableIsEnabled = (id: DroppableId, isEnabled: boolean) => {\n invariant(\n registry.droppable.exists(id),\n `Cannot update is enabled flag of Droppable ${id} as it is not registered`,\n );\n\n // no need to update the application state if a collection is not occurring\n if (!collection) {\n return;\n }\n\n // At this point a non primary droppable dimension might not yet be published\n // but may have its enabled state changed. For now we still publish this change\n // and let the reducer exit early if it cannot find the dimension in the state.\n callbacks.updateDroppableIsEnabled({ id, isEnabled });\n };\n\n const updateDroppableIsCombineEnabled = (\n id: DroppableId,\n isCombineEnabled: boolean,\n ) => {\n // no need to update\n if (!collection) {\n return;\n }\n\n invariant(\n registry.droppable.exists(id),\n `Cannot update isCombineEnabled flag of Droppable ${id} as it is not registered`,\n );\n\n callbacks.updateDroppableIsCombineEnabled({ id, isCombineEnabled });\n };\n\n const updateDroppableScroll = (id: DroppableId, newScroll: Position) => {\n // no need to update the application state if a collection is not occurring\n if (!collection) {\n return;\n }\n\n invariant(\n registry.droppable.exists(id),\n `Cannot update the scroll on Droppable ${id} as it is not registered`,\n );\n\n callbacks.updateDroppableScroll({ id, newScroll });\n };\n\n const scrollDroppable = (id: DroppableId, change: Position) => {\n if (!collection) {\n return;\n }\n registry.droppable.getById(id).callbacks.scroll(change);\n };\n\n const stopPublishing = () => {\n // This function can be called defensively\n if (!collection) {\n return;\n }\n // Stop any pending dom collections or publish\n publisher.stop();\n\n // Tell all droppables to stop watching scroll\n // all good if they where not already listening\n const home: DroppableDescriptor = collection.critical.droppable;\n registry.droppable\n .getAllByType(home.type)\n .forEach((entry: DroppableEntry) => entry.callbacks.dragStopped());\n\n // Unsubscribe from registry updates\n collection.unsubscribe();\n // Finally - clear our collection\n collection = null;\n };\n\n const subscriber: Subscriber = (event: RegistryEvent) => {\n invariant(\n collection,\n 'Should only be subscribed when a collection is occurring',\n );\n // The dragging item can be add and removed when using a clone\n // We do not publish updates for the critical item\n const dragging: DraggableDescriptor = collection.critical.draggable;\n\n if (event.type === 'ADDITION') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.add(event.value);\n }\n }\n if (event.type === 'REMOVAL') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.remove(event.value);\n }\n }\n };\n\n const startPublishing = (request: LiftRequest): StartPublishingResult => {\n invariant(\n !collection,\n 'Cannot start capturing critical dimensions as there is already a collection',\n );\n const entry: DraggableEntry = registry.draggable.getById(\n request.draggableId,\n );\n const home: DroppableEntry = registry.droppable.getById(\n entry.descriptor.droppableId,\n );\n\n const critical: Critical = {\n draggable: entry.descriptor,\n droppable: home.descriptor,\n };\n\n const unsubscribe = registry.subscribe(subscriber);\n\n collection = {\n critical,\n unsubscribe,\n };\n\n return getInitialPublish({\n critical,\n registry,\n scrollOptions: request.scrollOptions,\n });\n };\n\n const marshal: DimensionMarshal = {\n // Droppable changes\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n scrollDroppable,\n updateDroppableScroll,\n\n // Entry\n startPublishing,\n stopPublishing,\n };\n\n return marshal;\n};\n","// @flow\nimport type { State, DraggableId } from '../types';\n\nexport default (state: State, id: DraggableId): boolean => {\n // Ready to go!\n if (state.phase === 'IDLE') {\n return true;\n }\n\n // Can lift depending on the type of drop animation\n if (state.phase !== 'DROP_ANIMATING') {\n return false;\n }\n\n // - For a user drop we allow the user to drag other Draggables\n // immediately as items are most likely already in their home\n // - For a cancel items will be moving back to their original position\n // as such it is a cleaner experience to block them from dragging until\n // the drop animation is complete. Otherwise they will be grabbing\n // items not in their original position which can lead to bad visuals\n // Not allowing dragging of the dropping draggable\n if (state.completed.result.draggableId === id) {\n return false;\n }\n\n // if dropping - allow lifting\n // if cancelling - disallow lifting\n return state.completed.result.reason === 'DROP';\n};\n","// @flow\nimport { type Position } from 'css-box-model';\n\n// Not guarenteed to scroll by the entire amount\nexport default (change: Position): void => {\n window.scrollBy(change.x, change.y);\n};\n","// @flow\nimport memoizeOne from 'memoize-one';\nimport { type Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n DroppableDimensionMap,\n DroppableId,\n} from '../../../types';\nimport { invariant } from '../../../invariant';\nimport isPositionInFrame from '../../visibility/is-position-in-frame';\nimport { toDroppableList } from '../../dimension-structures';\nimport { find } from '../../../native-with-fallback';\n\nconst getScrollableDroppables = memoizeOne(\n (droppables: DroppableDimensionMap): DroppableDimension[] =>\n toDroppableList(droppables).filter(\n (droppable: DroppableDimension): boolean => {\n // exclude disabled droppables\n if (!droppable.isEnabled) {\n return false;\n }\n\n // only want droppables that are scrollable\n if (!droppable.frame) {\n return false;\n }\n\n return true;\n },\n ),\n);\n\nconst getScrollableDroppableOver = (\n target: Position,\n droppables: DroppableDimensionMap,\n): DroppableDimension | undefined => {\n const maybe: DroppableDimension | undefined = find(\n getScrollableDroppables(droppables),\n (droppable: DroppableDimension): boolean => {\n invariant(droppable.frame, 'Invalid result');\n return isPositionInFrame(droppable.frame.pageMarginBox)(target);\n },\n );\n\n return maybe;\n};\n\ntype Api = {\n center: Position,\n destination: DroppableId | null,\n droppables: DroppableDimensionMap,\n};\n\nexport default ({\n center,\n destination,\n droppables,\n}: Api): DroppableDimension | null | undefined => {\n // We need to scroll the best droppable frame we can so that the\n // placeholder buffer logic works correctly\n\n if (destination) {\n const dimension: DroppableDimension = droppables[destination];\n if (!dimension.frame) {\n return null;\n }\n return dimension;\n }\n\n // 2. If we are not over a droppable - are we over a droppable frame?\n const dimension: DroppableDimension | undefined = getScrollableDroppableOver(\n center,\n droppables,\n );\n\n return dimension;\n};\n","// @flow\n\n// Values used to control how the fluid auto scroll feels\nconst config = {\n // percentage distance from edge of container:\n startFromPercentage: 0.25,\n maxScrollAtPercentage: 0.05,\n // pixels per frame\n maxPixelScroll: 28,\n\n // A function used to ease a percentage value\n // A simple linear function would be: (percentage) => percentage;\n // percentage is between 0 and 1\n // result must be between 0 and 1\n ease: (percentage: number): number => Math.pow(percentage, 2),\n\n durationDampening: {\n // ms: how long to dampen the speed of an auto scroll from the start of a drag\n stopDampeningAt: 1200,\n // ms: when to start accelerating the reduction of duration dampening\n accelerateAt: 360,\n },\n};\n\nexport default config;\n","// @flow\nimport type { Rect } from 'css-box-model';\nimport config from '../../config';\nimport type { Axis } from '../../../../../types';\n\n// all in pixels\nexport type DistanceThresholds = {\n startScrollingFrom: number\n maxScrollValueAt: number\n};\n\n// converts the percentages in the config into actual pixel values\nexport default (container: Rect, axis: Axis): DistanceThresholds => {\n const startScrollingFrom: number =\n container[axis.size] * config.startFromPercentage;\n const maxScrollValueAt: number =\n container[axis.size] * config.maxScrollAtPercentage;\n\n const thresholds: DistanceThresholds = {\n startScrollingFrom,\n maxScrollValueAt,\n };\n\n return thresholds;\n};\n","// @flow\nimport { warning } from '../../../dev-warning';\n\ntype Args = {\n startOfRange: number,\n endOfRange: number,\n current: number,\n};\n\nexport default ({ startOfRange, endOfRange, current }: Args): number => {\n const range: number = endOfRange - startOfRange;\n\n if (range === 0) {\n warning(`\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n `);\n return 0;\n }\n\n const currentInRange: number = current - startOfRange;\n const percentage: number = currentInRange / range;\n return percentage;\n};\n","// @flow\n\n// A scroll event will only be triggered when there is a value of at least 1px change\nexport default 1;\n","// @flow\nimport { type DistanceThresholds } from './get-distance-thresholds';\nimport getPercentage from '../../get-percentage';\nimport config from '../../config';\nimport minScroll from './min-scroll';\n\nexport default (\n distanceToEdge: number,\n thresholds: DistanceThresholds,\n): number => {\n /*\n // This function only looks at the distance to one edge\n // Example: looking at bottom edge\n |----------------------------------|\n | |\n | |\n | |\n | |\n | | => no scroll in this range\n | |\n | |\n | startScrollingFrom (eg 100px) |\n | |\n | | => increased scroll value the closer to maxScrollValueAt\n | maxScrollValueAt (eg 10px) |\n | | => max scroll value in this range\n |----------------------------------|\n */\n\n // too far away to auto scroll\n if (distanceToEdge > thresholds.startScrollingFrom) {\n return 0;\n }\n\n // use max speed when on or over boundary\n if (distanceToEdge <= thresholds.maxScrollValueAt) {\n return config.maxPixelScroll;\n }\n\n // when just going on the boundary return the minimum integer\n if (distanceToEdge === thresholds.startScrollingFrom) {\n return minScroll;\n }\n\n // to get the % past startScrollingFrom we will calculate\n // the % the value is from maxScrollValueAt and then invert it\n const percentageFromMaxScrollValueAt: number = getPercentage({\n startOfRange: thresholds.maxScrollValueAt,\n endOfRange: thresholds.startScrollingFrom,\n current: distanceToEdge,\n });\n\n const percentageFromStartScrollingFrom: number =\n 1 - percentageFromMaxScrollValueAt;\n\n const scroll: number =\n config.maxPixelScroll * config.ease(percentageFromStartScrollingFrom);\n\n // scroll will always be a positive integer\n return Math.ceil(scroll);\n};\n","// @flow\nimport getPercentage from '../../get-percentage';\nimport config from '../../config';\nimport minScroll from './min-scroll';\n\nconst accelerateAt: number = config.durationDampening.accelerateAt;\nconst stopAt: number = config.durationDampening.stopDampeningAt;\n\nexport default (proposedScroll: number, dragStartTime: number): number => {\n const startOfRange: number = dragStartTime;\n const endOfRange: number = stopAt;\n const now: number = Date.now();\n const runTime: number = now - startOfRange;\n\n // we have finished the time dampening period\n if (runTime >= stopAt) {\n return proposedScroll;\n }\n\n // Up to this point we know there is a proposed scroll\n // but we have not reached our accelerate point\n // Return the minimum amount of scroll\n if (runTime < accelerateAt) {\n return minScroll;\n }\n\n const betweenAccelerateAtAndStopAtPercentage: number = getPercentage({\n startOfRange: accelerateAt,\n endOfRange,\n current: runTime,\n });\n\n const scroll: number =\n proposedScroll * config.ease(betweenAccelerateAtAndStopAtPercentage);\n\n return Math.ceil(scroll);\n};\n","// @flow\nimport { type DistanceThresholds } from './get-distance-thresholds';\nimport getValueFromDistance from './get-value-from-distance';\nimport dampenValueByTime from './dampen-value-by-time';\nimport minScroll from './min-scroll';\n\ntype Args = {\n distanceToEdge: number,\n thresholds: DistanceThresholds,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n distanceToEdge,\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n}: Args): number => {\n const scroll: number = getValueFromDistance(distanceToEdge, thresholds);\n\n // not enough distance to trigger a minimum scroll\n // we can bail here\n if (scroll === 0) {\n return 0;\n }\n\n // Dampen an auto scroll speed based on duration of drag\n\n if (!shouldUseTimeDampening) {\n return scroll;\n }\n\n // Once we know an auto scroll should occur based on distance,\n // we must let at least 1px through to trigger a scroll event an\n // another auto scroll call\n\n return Math.max(dampenValueByTime(scroll, dragStartTime), minScroll);\n};\n","// @flow\nimport type { Rect, Spacing } from 'css-box-model';\nimport getDistanceThresholds, {\n type DistanceThresholds,\n} from './get-distance-thresholds';\nimport type { Axis } from '../../../../../types';\nimport getValue from './get-value';\n\ntype GetOnAxisArgs = {\n container: Rect,\n distanceToEdges: Spacing,\n dragStartTime: number,\n axis: Axis,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n container,\n distanceToEdges,\n dragStartTime,\n axis,\n shouldUseTimeDampening,\n}: GetOnAxisArgs): number => {\n const thresholds: DistanceThresholds = getDistanceThresholds(container, axis);\n const isCloserToEnd: boolean =\n distanceToEdges[axis.end] < distanceToEdges[axis.start];\n\n if (isCloserToEnd) {\n return getValue({\n distanceToEdge: distanceToEdges[axis.end],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n });\n }\n\n return (\n -1 *\n getValue({\n distanceToEdge: distanceToEdges[axis.start],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n })\n );\n};\n","// @flow\nimport type { Rect, Position } from 'css-box-model';\n\ntype Args = {\n container: Rect,\n subject: Rect,\n proposedScroll: Position,\n};\n\nexport default ({ container, subject, proposedScroll }: Args): Position | null | undefined => {\n const isTooBigVertically: boolean = subject.height > container.height;\n const isTooBigHorizontally: boolean = subject.width > container.width;\n\n // not too big on any axis\n if (!isTooBigHorizontally && !isTooBigVertically) {\n return proposedScroll;\n }\n\n // too big on both axis\n if (isTooBigHorizontally && isTooBigVertically) {\n return null;\n }\n\n // Only too big on one axis\n // Exclude the axis that we cannot scroll on\n return {\n x: isTooBigHorizontally ? 0 : proposedScroll.x,\n y: isTooBigVertically ? 0 : proposedScroll.y,\n };\n};\n","// @flow\nimport type { Position, Rect, Spacing } from 'css-box-model';\nimport { apply, isEqual, origin } from '../../../position';\nimport getScrollOnAxis from './get-scroll-on-axis';\nimport adjustForSizeLimits from './adjust-for-size-limits';\nimport { horizontal, vertical } from '../../../axis';\n\n// will replace -0 and replace with +0\nconst clean = apply((value: number) => (value === 0 ? 0 : value));\n\ntype Args = {\n dragStartTime: number,\n container: Rect,\n subject: Rect,\n center: Position,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n dragStartTime,\n container,\n subject,\n center,\n shouldUseTimeDampening,\n}: Args): Position | null => {\n // get distance to each edge\n const distanceToEdges: Spacing = {\n top: center.y - container.top,\n right: container.right - center.x,\n bottom: container.bottom - center.y,\n left: center.x - container.left,\n };\n\n // 1. Figure out which x,y values are the best target\n // 2. Can the container scroll in that direction at all?\n // If no for both directions, then return null\n // 3. Is the center close enough to a edge to start a drag?\n // 4. Based on the distance, calculate the speed at which a scroll should occur\n // The lower distance value the faster the scroll should be.\n // Maximum speed value should be hit before the distance is 0\n // Negative values to not continue to increase the speed\n const y: number = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: vertical,\n shouldUseTimeDampening,\n });\n const x: number = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: horizontal,\n shouldUseTimeDampening,\n });\n\n const required: Position = clean({ x, y });\n\n // nothing required\n if (isEqual(required, origin)) {\n return null;\n }\n\n // need to not scroll in a direction that we are too big to scroll in\n const limited: Position | null | undefined = adjustForSizeLimits({\n container,\n subject,\n proposedScroll: required,\n });\n\n if (!limited) {\n return null;\n }\n\n return isEqual(limited, origin) ? null : limited;\n};\n","\nimport type { Position } from 'css-box-model';\nimport type {\n DroppableDimension,\n Viewport,\n Scrollable,\n} from '../../types';\n\nimport { add, apply, isEqual, origin } from '../position';\n\ntype CanPartiallyScrollArgs = {\n max: Position;\n current: Position;\n change: Position;\n};\n\nconst smallestSigned = apply((value: number) => {\n if (value === 0) {\n return 0;\n }\n return value > 0 ? 1 : -1;\n});\n\ntype GetRemainderArgs = {\n current: Position;\n max: Position;\n change: Position;\n};\n\n// We need to figure out how much of the movement\n// cannot be done with a scroll\nexport const getOverlap = (() => {\n const getRemainder = (target: number, max: number): number => {\n if (target < 0) {\n return target;\n }\n if (target > max) {\n return target - max;\n }\n return 0;\n };\n\n return ({ current, max, change }: GetRemainderArgs): Position | null => {\n const targetScroll: Position = add(current, change);\n\n const overlap: Position = {\n x: getRemainder(targetScroll.x, max.x),\n y: getRemainder(targetScroll.y, max.y),\n };\n\n if (isEqual(overlap, origin)) {\n return null;\n }\n\n return overlap;\n };\n})();\n\nexport const canPartiallyScroll = ({\n max: rawMax,\n current,\n change,\n}: CanPartiallyScrollArgs): boolean => {\n const max: Position = {\n x: Math.max(current.x, rawMax.x),\n y: Math.max(current.y, rawMax.y),\n };\n\n const smallestChange: Position = smallestSigned(change);\n\n const overlap: Position | null = getOverlap({\n max,\n current,\n change: smallestChange,\n });\n\n if (!overlap) {\n return true;\n }\n\n if (smallestChange.x !== 0 && overlap.x === 0) {\n return true;\n }\n\n if (smallestChange.y !== 0 && overlap.y === 0) {\n return true;\n }\n\n return false;\n};\n\nexport const canScrollWindow = (\n viewport: Viewport,\n change: Position,\n): boolean =>\n canPartiallyScroll({\n current: viewport.scroll.current,\n max: viewport.scroll.max,\n change,\n });\n\nexport const getWindowOverlap = (\n viewport: Viewport,\n change: Position,\n): Position | null => {\n if (!canScrollWindow(viewport, change)) {\n return null;\n }\n\n const max: Position = viewport.scroll.max;\n const current: Position = viewport.scroll.current;\n\n return getOverlap({\n current,\n max,\n change,\n });\n};\n\nexport const canScrollDroppable = (\n droppable: DroppableDimension,\n change: Position,\n): boolean => {\n\n const frame: Scrollable | null = droppable.frame;\n\n if (!frame) {\n return false;\n }\n\n return canPartiallyScroll({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change,\n });\n};\n\nexport const getDroppableOverlap = (\n droppable: DroppableDimension,\n change: Position,\n): Position | null => {\n\n const frame: Scrollable | null = droppable.frame;\n\n if (!frame) {\n return null;\n }\n\n if (!canScrollDroppable(droppable, change)) {\n return null;\n }\n\n return getOverlap({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change,\n });\n};\n\n\n// // @flow\n// import { type Position } from 'css-box-model';\n// import { add, apply, isEqual, origin } from '../position';\n// import type { DroppableDimension, Viewport, Scrollable } from '../../types';\n\n// type CanPartiallyScrollArgs = {|\n// max: Position,\n// current: Position,\n// change: Position,\n// |};\n\n// const smallestSigned = apply((value: number) => {\n// if (value === 0) {\n// return 0;\n// }\n// return value > 0 ? 1 : -1;\n// });\n\n// type GetRemainderArgs = {|\n// current: Position,\n// max: Position,\n// change: Position,\n// |};\n\n// // We need to figure out how much of the movement\n// // cannot be done with a scroll\n// export const getOverlap = (() => {\n// const getRemainder = (target: number, max: number): number => {\n// if (target < 0) {\n// return target;\n// }\n// if (target > max) {\n// return target - max;\n// }\n// return 0;\n// };\n\n// return ({ current, max, change }: GetRemainderArgs): ?Position => {\n// const targetScroll: Position = add(current, change);\n\n// const overlap: Position = {\n// x: getRemainder(targetScroll.x, max.x),\n// y: getRemainder(targetScroll.y, max.y),\n// };\n\n// if (isEqual(overlap, origin)) {\n// return null;\n// }\n\n// return overlap;\n// };\n// })();\n\n// export const canPartiallyScroll = ({\n// max: rawMax,\n// current,\n// change,\n// }: CanPartiallyScrollArgs): boolean => {\n// // It is possible for the max scroll to be greater than the current scroll\n// // when there are scrollbars on the cross axis. We adjust for this by\n// // increasing the max scroll point if needed\n// // This will allow movements backwards even if the current scroll is greater than the max scroll\n// const max: Position = {\n// x: Math.max(current.x, rawMax.x),\n// y: Math.max(current.y, rawMax.y),\n// };\n\n// // Only need to be able to move the smallest amount in the desired direction\n// const smallestChange: Position = smallestSigned(change);\n\n// const overlap: ?Position = getOverlap({\n// max,\n// current,\n// change: smallestChange,\n// });\n\n// // no overlap at all - we can move there!\n// if (!overlap) {\n// return true;\n// }\n\n// // if there was an x value, but there is no x overlap - then we can scroll on the x!\n// if (smallestChange.x !== 0 && overlap.x === 0) {\n// return true;\n// }\n\n// // if there was an y value, but there is no y overlap - then we can scroll on the y!\n// if (smallestChange.y !== 0 && overlap.y === 0) {\n// return true;\n// }\n\n// return false;\n// };\n\n// export const canScrollWindow = (\n// viewport: Viewport,\n// change: Position,\n// ): boolean =>\n// canPartiallyScroll({\n// current: viewport.scroll.current,\n// max: viewport.scroll.max,\n// change,\n// });\n\n// export const getWindowOverlap = (\n// viewport: Viewport,\n// change: Position,\n// ): ?Position => {\n// if (!canScrollWindow(viewport, change)) {\n// return null;\n// }\n\n// const max: Position = viewport.scroll.max;\n// const current: Position = viewport.scroll.current;\n\n// return getOverlap({\n// current,\n// max,\n// change,\n// });\n// };\n\n// export const canScrollDroppable = (\n// droppable: DroppableDimension,\n// change: Position,\n// ): boolean => {\n// const frame: ?Scrollable = droppable.frame;\n\n// // Cannot scroll when there is no scrollable\n// if (!frame) {\n// return false;\n// }\n\n// return canPartiallyScroll({\n// current: frame.scroll.current,\n// max: frame.scroll.max,\n// change,\n// });\n// };\n\n// export const getDroppableOverlap = (\n// droppable: DroppableDimension,\n// change: Position,\n// ): ?Position => {\n// const frame: ?Scrollable = droppable.frame;\n\n// if (!frame) {\n// return null;\n// }\n\n// if (!canScrollDroppable(droppable, change)) {\n// return null;\n// }\n\n// return getOverlap({\n// current: frame.scroll.current,\n// max: frame.scroll.max,\n// change,\n// });\n// };\n","// @flow\nimport type { Position, Rect } from 'css-box-model';\nimport type { Viewport } from '../../../types';\nimport getScroll from './get-scroll';\nimport { canScrollWindow } from '../can-scroll';\n\ntype Args = {\n viewport: Viewport,\n subject: Rect,\n center: Position,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n viewport,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n}: Args): Position | null => {\n const scroll: Position | null = getScroll({\n dragStartTime,\n container: viewport.frame,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n return scroll && canScrollWindow(viewport, scroll) ? scroll : null;\n};\n","// @flow\nimport type { Position, Rect } from 'css-box-model';\nimport type { Scrollable, DroppableDimension } from '../../../types';\nimport getScroll from './get-scroll';\nimport { canScrollDroppable } from '../can-scroll';\n\ntype Args = {\n droppable: DroppableDimension,\n subject: Rect,\n center: Position,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n droppable,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n}: Args): Position | null => {\n // We know this has a closestScrollable\n const frame: Scrollable | null = droppable.frame;\n\n // this should never happen - just being safe\n if (!frame) {\n return null;\n }\n\n const scroll: Position | null = getScroll({\n dragStartTime,\n container: frame.pageMarginBox,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n return scroll && canScrollDroppable(droppable, scroll) ? scroll : null;\n};\n","// @flow\nimport { type Position, type Rect } from 'css-box-model';\nimport type {\n DraggingState,\n DroppableId,\n DraggableDimension,\n DroppableDimension,\n Viewport,\n} from '../../../types';\nimport getBestScrollableDroppable from './get-best-scrollable-droppable';\nimport whatIsDraggedOver from '../../droppable/what-is-dragged-over';\nimport getWindowScrollChange from './get-window-scroll-change';\nimport getDroppableScrollChange from './get-droppable-scroll-change';\n\ntype Args = {\n state: DraggingState,\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n scrollWindow: (scroll: Position) => void,\n scrollDroppable: (id: DroppableId, scroll: Position) => void,\n};\n\nexport default ({\n state,\n dragStartTime,\n shouldUseTimeDampening,\n scrollWindow,\n scrollDroppable,\n}: Args): void => {\n const center: Position = state.current.page.borderBoxCenter;\n const draggable: DraggableDimension =\n state.dimensions.draggables[state.critical.draggable.id];\n const subject: Rect = draggable.page.marginBox;\n // 1. Can we scroll the viewport?\n if (state.isWindowScrollAllowed) {\n const viewport: Viewport = state.viewport;\n const change: Position | null = getWindowScrollChange({\n dragStartTime,\n viewport,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n if (change) {\n scrollWindow(change);\n return;\n }\n }\n\n const droppable: DroppableDimension | null | undefined = getBestScrollableDroppable({\n center,\n destination: whatIsDraggedOver(state.impact),\n droppables: state.dimensions.droppables,\n });\n\n if (!droppable) {\n return;\n }\n\n const change: Position | null = getDroppableScrollChange({\n dragStartTime,\n droppable,\n subject,\n center,\n shouldUseTimeDampening,\n });\n\n if (change) {\n scrollDroppable(droppable.descriptor.id, change);\n }\n};\n","// @flow\nimport rafSchd from 'raf-schd';\nimport { type Position } from 'css-box-model';\nimport type { DraggingState, DroppableId } from '../../../types';\nimport scroll from './scroll';\nimport { invariant } from '../../../invariant';\nimport * as timings from '../../../debug/timings';\n\nexport type PublicArgs = {\n scrollWindow: (change: Position) => void,\n scrollDroppable: (id: DroppableId, change: Position) => void,\n};\n\nexport type FluidScroller = {\n scroll: (state: DraggingState) => void,\n start: (state: DraggingState) => void,\n stop: () => void,\n};\n\ntype WhileDragging = {\n dragStartTime: number,\n shouldUseTimeDampening: boolean,\n};\n\nexport default ({\n scrollWindow,\n scrollDroppable,\n}: PublicArgs): FluidScroller => {\n const scheduleWindowScroll = rafSchd(scrollWindow);\n const scheduleDroppableScroll = rafSchd(scrollDroppable);\n let dragging: WhileDragging | null = null;\n\n const tryScroll = (state: DraggingState): void => {\n invariant(dragging, 'Cannot fluid scroll if not dragging');\n\n const { shouldUseTimeDampening, dragStartTime } = dragging!; // not null\n\n scroll({\n state,\n scrollWindow: scheduleWindowScroll,\n scrollDroppable: scheduleDroppableScroll,\n dragStartTime,\n shouldUseTimeDampening,\n });\n };\n\n const start = (state: DraggingState) => {\n timings.start('starting fluid scroller');\n invariant(!dragging, 'Cannot start auto scrolling when already started');\n const dragStartTime: number = Date.now();\n\n let wasScrollNeeded: boolean = false;\n const fakeScrollCallback = () => {\n wasScrollNeeded = true;\n };\n scroll({\n state,\n dragStartTime: 0,\n shouldUseTimeDampening: false,\n scrollWindow: fakeScrollCallback,\n scrollDroppable: fakeScrollCallback,\n });\n\n dragging = {\n dragStartTime,\n shouldUseTimeDampening: wasScrollNeeded,\n };\n timings.finish('starting fluid scroller');\n\n // we know an auto scroll is needed - let's do it!\n if (wasScrollNeeded) {\n tryScroll(state);\n }\n };\n\n const stop = () => {\n // can be called defensively\n if (!dragging) {\n return;\n }\n scheduleWindowScroll.cancel();\n scheduleDroppableScroll.cancel();\n dragging = null;\n };\n\n return {\n start,\n stop,\n scroll: tryScroll,\n };\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport { invariant } from '../../invariant';\nimport { add, subtract } from '../position';\nimport {\n canScrollWindow,\n canScrollDroppable,\n getWindowOverlap,\n getDroppableOverlap,\n} from './can-scroll';\nimport whatIsDraggedOver from '../droppable/what-is-dragged-over';\nimport { type MoveArgs } from '../action-creators';\nimport type {\n DroppableDimension,\n Viewport,\n DraggingState,\n DroppableId,\n} from '../../types';\n\ntype Args = {\n scrollDroppable: (id: DroppableId, change: Position) => void,\n scrollWindow: (offset: Position) => void,\n move: (args: MoveArgs) => unknown,\n};\n\nexport type JumpScroller = (state: DraggingState) => void;\n\ntype Remainder = Position;\n\nexport default ({\n move,\n scrollDroppable,\n scrollWindow,\n}: Args): JumpScroller => {\n const moveByOffset = (state: DraggingState, offset: Position) => {\n const client: Position = add(state.current.client.selection, offset);\n move({ client });\n };\n\n const scrollDroppableAsMuchAsItCan = (\n droppable: DroppableDimension,\n change: Position,\n ): Remainder | null => {\n // Droppable cannot absorb any of the scroll\n if (!canScrollDroppable(droppable, change)) {\n return change;\n }\n\n // Position | null\n const overlap: Position | null = getDroppableOverlap(droppable, change);\n\n // Droppable can absorb the entire change\n if (!overlap) {\n scrollDroppable(droppable.descriptor.id, change);\n return null;\n }\n\n // Droppable can only absorb a part of the change\n const whatTheDroppableCanScroll: Position = subtract(change, overlap);\n scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll);\n\n const remainder: Position = subtract(change, whatTheDroppableCanScroll);\n return remainder;\n };\n\n const scrollWindowAsMuchAsItCan = (\n isWindowScrollAllowed: boolean,\n viewport: Viewport,\n change: Position,\n ): Position | null => {\n if (!isWindowScrollAllowed) {\n return change;\n }\n\n if (!canScrollWindow(viewport, change)) {\n // window cannot absorb any of the scroll\n return change;\n }\n\n const overlap: Position | null = getWindowOverlap(viewport, change);\n\n // window can absorb entire scroll\n if (!overlap) {\n scrollWindow(change);\n return null;\n }\n\n // window can only absorb a part of the scroll\n const whatTheWindowCanScroll: Position = subtract(change, overlap);\n scrollWindow(whatTheWindowCanScroll);\n\n const remainder: Position = subtract(change, whatTheWindowCanScroll);\n return remainder;\n };\n\n const jumpScroller: JumpScroller = (state: DraggingState) => {\n const request: Position | null = state.scrollJumpRequest;\n\n if (!request) {\n return;\n }\n\n const destination: DroppableId | null = whatIsDraggedOver(state.impact);\n invariant(\n destination,\n 'Cannot perform a jump scroll when there is no destination',\n );\n\n // 1. We scroll the droppable first if we can to avoid the draggable\n // leaving the list\n\n const droppableRemainder: Position | null = scrollDroppableAsMuchAsItCan(\n state.dimensions.droppables[destination],\n request,\n );\n\n // droppable absorbed the entire scroll\n if (!droppableRemainder) {\n return;\n }\n\n const viewport: Viewport = state.viewport;\n const windowRemainder: Position | null = scrollWindowAsMuchAsItCan(\n state.isWindowScrollAllowed,\n viewport,\n droppableRemainder,\n );\n\n // window could absorb all the droppable remainder\n if (!windowRemainder) {\n return;\n }\n\n // The entire scroll could not be absorbed by the droppable and window\n // so we manually move whatever is left\n moveByOffset(state, windowRemainder);\n };\n\n return jumpScroller;\n};\n","// @flow\nimport { type Position } from 'css-box-model';\nimport createFluidScroller, { type FluidScroller } from './fluid-scroller';\nimport createJumpScroller, { type JumpScroller } from './jump-scroller';\nimport type { AutoScroller } from './auto-scroller-types';\nimport type { DroppableId, State } from '../../types';\nimport type { MoveArgs } from '../action-creators';\n\nexport type Args = {\n scrollWindow: (offset: Position) => void,\n scrollDroppable: (id: DroppableId, change: Position) => void,\n move: (args: MoveArgs) => unknown,\n};\n\nexport default ({\n scrollDroppable,\n scrollWindow,\n move,\n}: Args): AutoScroller => {\n const fluidScroller: FluidScroller = createFluidScroller({\n scrollWindow,\n scrollDroppable,\n });\n\n const jumpScroll: JumpScroller = createJumpScroller({\n move,\n scrollWindow,\n scrollDroppable,\n });\n\n const scroll = (state: State) => {\n // Only allowing auto scrolling in the DRAGGING phase\n if (state.phase !== 'DRAGGING') {\n return;\n }\n\n if (state.movementMode === 'FLUID') {\n fluidScroller.scroll(state);\n return;\n }\n\n if (!state.scrollJumpRequest) {\n return;\n }\n\n jumpScroll(state);\n };\n\n const scroller: AutoScroller = {\n scroll,\n start: fluidScroller.start,\n stop: fluidScroller.stop,\n };\n\n return scroller;\n};\n","// @flow\nexport const prefix: string = 'data-rbd';\nexport const dragHandle = (() => {\n const base = `${prefix}-drag-handle`;\n\n return {\n base,\n draggableId: `${base}-draggable-id`,\n contextId: `${base}-context-id`,\n };\n})();\n\nexport const draggable = (() => {\n const base: string = `${prefix}-draggable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`,\n };\n})();\n\nexport const droppable = (() => {\n const base: string = `${prefix}-droppable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`,\n };\n})();\n\nexport const placeholder = {\n contextId: `${prefix}-placeholder-context-id`,\n};\n\nexport const scrollContainer = {\n contextId: `${prefix}-scroll-container-context-id`,\n};\n","// @flow\nimport type { ContextId } from '../../types';\nimport { transitions } from '../../animation';\nimport * as attributes from '../data-attributes';\n\n// Exact\nexport type Styles = {\n always: string,\n dragging: string,\n resting: string,\n dropAnimating: string,\n userCancel: string,\n};\n\n// Exact\ntype Rule = {\n selector: string\n styles: Partial<Styles>\n};\n\ntype DragState =\n | 'always'\n | 'resting'\n | 'dragging'\n | 'dropAnimating'\n | 'userCancel';\n\nconst makeGetSelector = (context: string) => (attribute: string) =>\n `[${attribute}=\"${context}\"]`;\n\nconst getStyles = (rules: Rule[], property: DragState): string =>\n rules\n .map((rule: Rule): string => {\n const value: string | undefined = rule.styles[property];\n if (!value) {\n return '';\n }\n\n return `${rule.selector} { ${value} }`;\n })\n .join(' ');\n\nconst noPointerEvents: string = 'pointer-events: none;';\n\nexport default (contextId: ContextId): Styles => {\n const getSelector = makeGetSelector(contextId);\n\n // ## Drag handle styles\n\n // -webkit-touch-callout\n // A long press on anchors usually pops a content menu that has options for\n // the link such as 'Open in new tab'. Because long press is used to start\n // a drag we need to opt out of this behavior\n\n // -webkit-tap-highlight-color\n // Webkit based browsers add a grey overlay to anchors when they are active.\n // We remove this tap overlay as it is confusing for users\n // https://css-tricks.com/snippets/css/remove-gray-highlight-when-tapping-links-in-mobile-safari/\n\n // touch-action: manipulation\n // Avoid the *pull to refresh action* and *delayed anchor focus* on Android Chrome\n\n // cursor: grab\n // We apply this by default for an improved user experience. It is such a common default that we\n // bake it right in. Consumers can opt out of this by adding a selector with higher specificity\n // The cursor will not apply when pointer-events is set to none\n\n // pointer-events: none\n // this is used to prevent pointer events firing on draggables during a drag\n // Reasons:\n // 1. performance: it stops the other draggables from processing mouse events\n // 2. scrolling: it allows the user to scroll through the current draggable\n // to scroll the list behind\n // 3.* function: it blocks other draggables from starting. This is not relied on though as there\n // is a function on the context (canLift) which is a more robust way of controlling this\n\n const dragHandle: Rule = (() => {\n const grabCursor = `\n cursor: -webkit-grab;\n cursor: grab;\n `;\n return {\n selector: getSelector(attributes.dragHandle.contextId),\n styles: {\n always: `\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n `,\n resting: grabCursor,\n dragging: noPointerEvents,\n // it is fine for users to start dragging another item when a drop animation is occurring\n dropAnimating: grabCursor,\n // Not applying grab cursor during a user cancel as it is not possible for users to reorder\n // items during a cancel\n },\n };\n })();\n\n // ## Draggable styles\n\n // transition: transform\n // This controls the animation of draggables that are moving out of the way\n // The main draggable is controlled by react-motion.\n\n const draggable: Rule = (() => {\n const transition: string = `\n transition: ${transitions.outOfTheWay};\n `;\n return {\n selector: getSelector(attributes.draggable.contextId),\n styles: {\n dragging: transition,\n dropAnimating: transition,\n userCancel: transition,\n },\n };\n })();\n\n // ## Droppable styles\n\n // overflow-anchor: none;\n // Opting out of the browser feature which tries to maintain\n // the scroll position when the DOM changes above the fold.\n // This does not work well with reordering DOM nodes.\n // When we drop a Draggable it already has the correct scroll applied.\n\n const droppable: Rule = {\n selector: getSelector(attributes.droppable.contextId),\n styles: {\n always: `overflow-anchor: none;`,\n // need pointer events on the droppable to allow manual scrolling\n },\n };\n\n // ## Body styles\n\n // cursor: grab\n // We apply this by default for an improved user experience. It is such a common default that we\n // bake it right in. Consumers can opt out of this by adding a selector with higher specificity\n\n // user-select: none\n // This prevents the user from selecting text on the page while dragging\n\n // overflow-anchor: none\n // We are in control and aware of all of the window scrolls that occur\n // we do not want the browser to have behaviors we do not expect\n\n const body: Rule = {\n selector: 'body',\n styles: {\n dragging: `\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n `,\n },\n };\n\n const rules: Rule[] = [draggable, dragHandle, droppable, body];\n\n return {\n always: getStyles(rules, 'always'),\n resting: getStyles(rules, 'resting'),\n dragging: getStyles(rules, 'dragging'),\n dropAnimating: getStyles(rules, 'dropAnimating'),\n userCancel: getStyles(rules, 'userCancel'),\n };\n};\n","// @flow\n// eslint-disable-next-line no-restricted-imports\nimport { useLayoutEffect, useEffect } from 'react';\n\n// https://github.com/reduxjs/react-redux/blob/v7-beta/src/components/connectAdvanced.js#L35\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect because we want\n// `connect` to perform sync updates to a ref to save the latest props after\n// a render is actually committed to the DOM.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined'\n ? useLayoutEffect\n : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n","// @flow\nimport { useRef } from \"react\";\nimport memoizeOne from \"memoize-one\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { invariant } from \"../../invariant\";\nimport type { StyleMarshal } from \"./style-marshal-types\";\nimport type { ContextId, DropReason } from \"../../types\";\nimport getStyles, { type Styles } from \"./get-styles\";\nimport { prefix } from \"../data-attributes\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\n\nconst getHead = (): HTMLHeadElement => {\n const head: HTMLHeadElement | null = document.querySelector(\"head\");\n invariant(head, \"Cannot find the head to append a style to\");\n return head;\n};\n\nconst createStyleEl = (nonce?: string): HTMLStyleElement => {\n const el: HTMLStyleElement = document.createElement(\"style\");\n if (nonce) {\n el.setAttribute(\"nonce\", nonce);\n }\n el.type = \"text/css\";\n return el;\n};\n\nexport default function useStyleMarshal(contextId: ContextId, nonce?: string) {\n const styles: Styles = useMemo(() => getStyles(contextId), [contextId]);\n const alwaysRef = useRef<HTMLStyleElement | null>(null);\n const dynamicRef = useRef<HTMLStyleElement | null>(null);\n\n const setDynamicStyle = useCallback(\n // Using memoizeOne to prevent frequent updates to textContext\n memoizeOne((proposed: string) => {\n const el: HTMLStyleElement | null = dynamicRef.current;\n invariant(el, \"Cannot set dynamic style element if it is not set\");\n el.textContent = proposed;\n }),\n [],\n );\n\n const setAlwaysStyle = useCallback((proposed: string) => {\n const el: HTMLStyleElement | null = alwaysRef.current;\n invariant(el, \"Cannot set dynamic style element if it is not set\");\n el.textContent = proposed;\n }, []);\n\n // using layout effect as programatic dragging might start straight away (such as for cypress)\n useLayoutEffect(() => {\n invariant(\n !alwaysRef.current && !dynamicRef.current,\n \"style elements already mounted\",\n );\n\n const always: HTMLStyleElement = createStyleEl(nonce);\n const dynamic: HTMLStyleElement = createStyleEl(nonce);\n\n // store their refs\n alwaysRef.current = always;\n dynamicRef.current = dynamic;\n\n // for easy identification\n always.setAttribute(`${prefix}-always`, contextId);\n dynamic.setAttribute(`${prefix}-dynamic`, contextId);\n\n // add style tags to head\n getHead().appendChild(always);\n getHead().appendChild(dynamic);\n\n // set initial style\n setAlwaysStyle(styles.always);\n setDynamicStyle(styles.resting);\n\n return () => {\n const remove = (ref: any) => {\n const current: HTMLStyleElement | null = ref.current;\n invariant(current, \"Cannot unmount ref as it is not set\");\n getHead().removeChild(current);\n ref.current = null;\n };\n\n remove(alwaysRef);\n remove(dynamicRef);\n };\n }, [\n nonce,\n setAlwaysStyle,\n setDynamicStyle,\n styles.always,\n styles.resting,\n contextId,\n ]);\n\n const dragging = useCallback(\n () => setDynamicStyle(styles.dragging),\n [setDynamicStyle, styles.dragging],\n );\n const dropping = useCallback(\n (reason: DropReason) => {\n if (reason === \"DROP\") {\n setDynamicStyle(styles.dropAnimating);\n return;\n }\n setDynamicStyle(styles.userCancel);\n },\n [setDynamicStyle, styles.dropAnimating, styles.userCancel],\n );\n const resting = useCallback(() => {\n // Can be called defensively\n if (!dynamicRef.current) {\n return;\n }\n setDynamicStyle(styles.resting);\n }, [setDynamicStyle, styles.resting]);\n\n const marshal: StyleMarshal = useMemo(\n () => ({\n dragging,\n dropping,\n resting,\n }),\n [dragging, dropping, resting],\n );\n\n return marshal;\n}\n","// @flow\nexport default (el: Element | null): typeof window => {\n if (el && el.ownerDocument?.defaultView) {\n return el.ownerDocument.defaultView;\n }\n\n return window;\n};\n\n\n// export default (el: Element | null): typeof window =>\n// el && el.ownerDocument ? el.ownerDocument.defaultView : window;\n","// @flow\nimport getWindowFromEl from '../window/get-window-from-el';\n\nexport default function isHtmlElement(el: Element): el is HTMLElement {\n return el instanceof getWindowFromEl(el).HTMLElement;\n}\n\n// export default function isHtmlElement(el: Object): boolean %checks {\n// return el instanceof getWindowFromEl(el).HTMLElement;\n// }\n","// @flow\nimport type { DraggableId, ContextId } from '../../types';\nimport { dragHandle as dragHandleAttr } from '../data-attributes';\nimport { warning } from '../../dev-warning';\nimport { find, toArray } from '../../native-with-fallback';\nimport isHtmlElement from '../is-type-of-element/is-html-element';\n\nexport default function findDragHandle(\n contextId: ContextId,\n draggableId: DraggableId,\n): HTMLElement | null {\n // cannot create a selector with the draggable id as it might not be a valid attribute selector\n const selector: string = `[${dragHandleAttr.contextId}=\"${contextId}\"]`;\n const possible: Element[] = toArray(document.querySelectorAll(selector));\n\n if (!possible.length) {\n warning(`Unable to find any drag handles in the context \"${contextId}\"`);\n return null;\n }\n\n const handle: Element | undefined = find(possible, (el: Element): boolean => {\n return el.getAttribute(dragHandleAttr.draggableId) === draggableId;\n });\n\n if (!handle) {\n warning(\n `Unable to find drag handle with id \"${draggableId}\" as no handle with a matching id was found`,\n );\n return null;\n }\n\n if (!isHtmlElement(handle)) {\n warning('drag handle needs to be a HTMLElement');\n return null;\n }\n\n return handle as HTMLElement;\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport type { DraggableId, ContextId, AnimationFrameID } from \"../../types\";\nimport type { FocusMarshal, Unregister } from \"./focus-marshal-types\";\nimport { dragHandle as dragHandleAttr } from \"../data-attributes\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport findDragHandle from \"../get-elements/find-drag-handle\";\n\n// Exact\ntype Entry = {\n id: DraggableId,\n focus: () => void,\n};\n\ntype EntryMap = {\n [id: DraggableId]: Entry,\n};\n\nexport default function useFocusMarshal(contextId: ContextId): FocusMarshal {\n const entriesRef = useRef<EntryMap>({});\n const recordRef = useRef<DraggableId | null>(null);\n const restoreFocusFrameRef = useRef<AnimationFrameID | null>(null);\n const isMountedRef = useRef<boolean>(false);\n\n const register = useCallback(function register(\n id: DraggableId,\n focus: () => void,\n ): Unregister {\n const entry: Entry = { id, focus };\n entriesRef.current[id] = entry;\n\n return function unregister() {\n const entries: EntryMap = entriesRef.current;\n const current: Entry = entries[id];\n // entry might have been overrided by another registration\n if (current !== entry) {\n delete entries[id];\n }\n };\n }, []);\n\n const tryGiveFocus = useCallback(\n function tryGiveFocus(tryGiveFocusTo: DraggableId) {\n const handle: HTMLElement | null = findDragHandle(contextId, tryGiveFocusTo);\n\n if (handle && handle !== document.activeElement) {\n handle.focus();\n }\n },\n [contextId],\n );\n\n const tryShiftRecord = useCallback(function tryShiftRecord(\n previous: DraggableId,\n redirectTo: DraggableId,\n ) {\n if (recordRef.current === previous) {\n recordRef.current = redirectTo;\n }\n }, []);\n\n const tryRestoreFocusRecorded = useCallback(\n function tryRestoreFocusRecorded() {\n // frame already queued\n if (restoreFocusFrameRef.current) {\n return;\n }\n\n // cannot give focus if unmounted\n // this code path is generally not hit expect for some hot-reloading flows\n if (!isMountedRef.current) {\n return;\n }\n\n restoreFocusFrameRef.current = requestAnimationFrame(() => {\n restoreFocusFrameRef.current = null;\n const record: DraggableId | null = recordRef.current;\n if (record) {\n tryGiveFocus(record);\n }\n });\n },\n [tryGiveFocus],\n );\n\n const tryRecordFocus = useCallback(function tryRecordFocus(id: DraggableId) {\n // clear any existing record\n recordRef.current = null;\n\n const focused: Element | null = document.activeElement;\n\n // no item focused so it cannot be our item\n if (!focused) {\n return;\n }\n\n // focused element is not a drag handle or does not have the right id\n if (focused.getAttribute(dragHandleAttr.draggableId) !== id) {\n return;\n }\n\n recordRef.current = id;\n }, []);\n\n useLayoutEffect(() => {\n isMountedRef.current = true;\n return function clearFrameOnUnmount() {\n isMountedRef.current = false;\n const frameId: AnimationFrameID | null = restoreFocusFrameRef.current;\n if (frameId) {\n cancelAnimationFrame(frameId);\n }\n };\n }, []);\n\n const marshal: FocusMarshal = useMemo(\n () => ({\n register,\n tryRecordFocus,\n tryRestoreFocusRecorded,\n tryShiftRecord,\n }),\n [register, tryRecordFocus, tryRestoreFocusRecorded, tryShiftRecord],\n );\n\n return marshal;\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { TypeId, DraggableId, DroppableId } from '../../types';\nimport type {\n Registry,\n DraggableAPI,\n DroppableAPI,\n DraggableEntry,\n DroppableEntry,\n RegistryEvent,\n Subscriber,\n Unsubscribe,\n DraggableEntryMap,\n DroppableEntryMap,\n} from './registry-types';\nimport { values } from '../../native-with-fallback';\n\ntype EntryMap = {\n draggables: DraggableEntryMap,\n droppables: DroppableEntryMap,\n};\n\nexport default function createRegistry(): Registry {\n const entries: EntryMap = {\n draggables: {},\n droppables: {},\n };\n\n const subscribers: Subscriber[] = [];\n\n function subscribe(cb: Subscriber): Unsubscribe {\n subscribers.push(cb);\n\n return function unsubscribe(): void {\n const index: number = subscribers.indexOf(cb);\n\n // might have been removed by a clean\n if (index === -1) {\n return;\n }\n\n subscribers.splice(index, 1);\n };\n }\n\n function notify(event: RegistryEvent) {\n if (subscribers.length) {\n subscribers.forEach((cb) => cb(event));\n }\n }\n\n function findDraggableById(id: DraggableId): DraggableEntry | null {\n return entries.draggables[id] || null;\n }\n\n function getDraggableById(id: DraggableId): DraggableEntry {\n const entry: DraggableEntry | null = findDraggableById(id);\n invariant(entry, `Cannot find draggable entry with id [${id}]`);\n return entry;\n }\n\n const draggableAPI: DraggableAPI = {\n register: (entry: DraggableEntry) => {\n entries.draggables[entry.descriptor.id] = entry;\n notify({ type: 'ADDITION', value: entry });\n },\n update: (entry: DraggableEntry, last: DraggableEntry) => {\n const current: DraggableEntry | null = entries.draggables[last.descriptor.id];\n\n // item already removed\n if (!current) {\n return;\n }\n\n // id already used for another mount\n if (current.uniqueId !== entry.uniqueId) {\n return;\n }\n\n // We are safe to delete the old entry and add a new one\n delete entries.draggables[last.descriptor.id];\n entries.draggables[entry.descriptor.id] = entry;\n },\n unregister: (entry: DraggableEntry) => {\n const draggableId: DraggableId = entry.descriptor.id;\n const current: DraggableEntry | null = findDraggableById(draggableId);\n\n // can occur if cleaned before unregistration\n if (!current) {\n return;\n }\n\n // outdated uniqueId\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n\n delete entries.draggables[draggableId];\n notify({ type: 'REMOVAL', value: entry });\n },\n getById: getDraggableById,\n findById: findDraggableById,\n exists: (id: DraggableId): boolean => Boolean(findDraggableById(id)),\n getAllByType: (type: TypeId): DraggableEntry[] =>\n values(entries.draggables).filter(\n (entry: DraggableEntry): boolean => entry.descriptor.type === type,\n ),\n };\n\n function findDroppableById(id: DroppableId): DroppableEntry | null {\n return entries.droppables[id] || null;\n }\n\n function getDroppableById(id: DroppableId): DroppableEntry {\n const entry: DroppableEntry | null = findDroppableById(id);\n invariant(entry, `Cannot find droppable entry with id [${id}]`);\n return entry;\n }\n\n const droppableAPI: DroppableAPI = {\n register: (entry: DroppableEntry) => {\n entries.droppables[entry.descriptor.id] = entry;\n },\n unregister: (entry: DroppableEntry) => {\n const current: DroppableEntry | null = findDroppableById(entry.descriptor.id);\n\n // can occur if cleaned before an unregistry\n if (!current) {\n return;\n }\n\n // already changed\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n\n delete entries.droppables[entry.descriptor.id];\n },\n getById: getDroppableById,\n findById: findDroppableById,\n exists: (id: DroppableId): boolean => Boolean(findDroppableById(id)),\n getAllByType: (type: TypeId): DroppableEntry[] =>\n values(entries.droppables).filter(\n (entry: DroppableEntry): boolean => entry.descriptor.type === type,\n ),\n };\n\n function clean(): void {\n // kill entries\n entries.draggables = {};\n entries.droppables = {};\n // remove all subscribers\n subscribers.length = 0;\n }\n\n return {\n draggable: draggableAPI,\n droppable: droppableAPI,\n subscribe,\n clean,\n };\n}\n","// @flow\nimport { useEffect } from \"react\";\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { Registry } from \"./registry-types\";\nimport createRegistry from \"./create-registry\";\n\nexport default function useRegistry(): Registry {\n const registry: Registry = useMemo(createRegistry, []);\n\n useEffect(() => {\n return function unmount() {\n // clean up the registry to avoid any leaks\n // doing it after an animation frame so that other things unmounting\n // can continue to interact with the registry\n requestAnimationFrame(registry.clean);\n };\n }, [registry]);\n\n return registry;\n}\n","// @flow\nimport React from 'react';\n// import type { Store } from '../../state/store-types';\nimport type { ReactReduxContextValue } from 'react-redux';\nimport type { State, Action } from '../../state/store-types';\n\n// export default React.createContext<Store | null>(null);\nexport default React.createContext<ReactReduxContextValue<State, Action> | null>(null);\n","// @flow\nimport { invariant } from '../invariant';\n\nexport default (): HTMLElement => {\n const body: HTMLElement | null = document.body;\n invariant(body, 'Cannot find document.body');\n return body;\n};\n","// @flow\n// https://allyjs.io/tutorials/hiding-elements.html\n// Element is visually hidden but is readable by screen readers\nconst visuallyHidden: Object = {\n position: 'absolute',\n width: '1px',\n height: '1px',\n margin: '-1px',\n border: '0',\n padding: '0',\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n 'clip-path': 'inset(100%)',\n};\n\nexport default visuallyHidden;\n","// @flow\nimport { useRef, useEffect } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport type { Announce, ContextId } from \"../../types\";\nimport { warning } from \"../../dev-warning\";\nimport getBodyElement from \"../get-body-element\";\nimport visuallyHidden from \"../visually-hidden-style\";\n\nexport const getId = (contextId: ContextId): string =>\n `rbd-announcement-${contextId}`;\n\nexport default function useAnnouncer(contextId: ContextId): Announce {\n const id: string = useMemo(() => getId(contextId), [contextId]);\n const ref = useRef<HTMLElement | null>(null);\n\n useEffect(\n function setup() {\n const el: HTMLElement = document.createElement(\"div\");\n // storing reference for usage in announce\n ref.current = el;\n\n // identifier\n el.id = id;\n\n // Aria live region\n\n // will force itself to be read\n el.setAttribute(\"aria-live\", \"assertive\");\n // must read the whole thing every time\n el.setAttribute(\"aria-atomic\", \"true\");\n\n // hide the element visually\n Object.assign(el.style, visuallyHidden);\n\n // Add to body\n getBodyElement().appendChild(el);\n\n return function cleanup() {\n // Not clearing the ref as it might be used by announce before the timeout expires\n\n // unmounting after a timeout to let any announcements\n // during a mount be published\n setTimeout(function remove() {\n // checking if element exists as the body might have been changed by things like 'turbolinks'\n const body: HTMLElement = getBodyElement(); // HTMLBodyElement\n if (body.contains(el)) {\n body.removeChild(el);\n }\n // if el was the current ref - clear it so that\n // we can get a warning if announce is called\n if (el === ref.current) {\n ref.current = null;\n }\n });\n };\n },\n [id],\n );\n\n const announce: Announce = useCallback((message: string): void => {\n const el: HTMLElement | null = ref.current;\n if (el) {\n el.textContent = message;\n return;\n }\n\n warning(`\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your <DragDropContext /> in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n \"${message}\"\n `);\n }, []);\n\n return announce;\n}\n","// @flow\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { Id } from \"../types\";\n\nlet count: number = 0;\n\ntype Options = {\n separator: string,\n};\n\nconst defaults: Options = { separator: \"::\" };\n\nexport function reset() {\n count = 0;\n}\n\nexport default function useUniqueId(\n prefix: string,\n options: Options = defaults,\n): Id {\n return useMemo(\n () => `${prefix}${options.separator}${count++}`,\n [options.separator, prefix],\n );\n}\n","// @flow\nimport { useEffect } from \"react\";\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { ContextId, ElementId } from \"../../types\";\nimport getBodyElement from \"../get-body-element\";\nimport useUniqueId from \"../use-unique-id\";\n\n// Exact\ntype GetIdArgs = {\n contextId: ContextId,\n uniqueId: string,\n};\n\nexport function getElementId({ contextId, uniqueId }: GetIdArgs): ElementId {\n return `rbd-hidden-text-${contextId}-${uniqueId}`;\n}\n\n// Exact\ntype Args = {\n contextId: ContextId,\n text: string,\n};\n\nexport default function useHiddenTextElement({\n contextId,\n text,\n}: Args): ElementId {\n const uniqueId: string = useUniqueId(\"hidden-text\", { separator: \"-\" });\n const id: ElementId = useMemo(\n () => getElementId({ contextId, uniqueId }),\n [uniqueId, contextId],\n );\n\n useEffect(\n function mount() {\n const el: HTMLElement = document.createElement(\"div\");\n\n // identifier\n el.id = id;\n\n // add the description text\n el.textContent = text;\n\n // Using `display: none` prevent screen readers from reading this element in the document flow\n el.style.display = \"none\";\n\n // Add to body\n getBodyElement().appendChild(el);\n\n return function unmount() {\n // checking if element exists as the body might have been changed by things like 'turbolinks'\n const body: HTMLElement = getBodyElement(); // HTMLBodyElement\n if (body.contains(el)) {\n body.removeChild(el);\n }\n };\n },\n [id, text],\n );\n\n return id;\n}\n","// @flow\nimport React from 'react';\nimport type { DraggableId, ContextId, ElementId } from '../../types';\nimport type { DimensionMarshal } from '../../state/dimension-marshal/dimension-marshal-types';\nimport type { FocusMarshal } from '../use-focus-marshal/focus-marshal-types';\nimport type { Registry } from '../../state/registry/registry-types';\n\n// Exact\nexport type AppContextValue = {\n focus: FocusMarshal,\n contextId: ContextId,\n canLift: (id: DraggableId) => boolean,\n isMovementAllowed: () => boolean,\n dragHandleUsageInstructionsId: ElementId,\n marshal: DimensionMarshal,\n registry: Registry,\n};\n\nexport default React.createContext<AppContextValue | null>(null);\n","// @flow\nimport { invariant } from '../../invariant';\nimport { warning } from '../../dev-warning';\n\n// Exact\ntype Version = {\n major: number,\n minor: number,\n patch: number,\n raw: string,\n};\n\n// We can use a simple regex here given that:\n// - the version that react supplies is always full: eg 16.5.2\n// - our peer dependency version is to a full version (eg ^16.3.1)\nconst semver: RegExp = /(\\d+)\\.(\\d+)\\.(\\d+)/;\nconst getVersion = (value: string): Version => {\n const result: (string[]) | null = semver.exec(value);\n\n invariant(result != null, `Unable to parse React version ${value}`);\n\n const major: number = Number(result[1]);\n const minor: number = Number(result[2]);\n const patch: number = Number(result[3]);\n\n return {\n major,\n minor,\n patch,\n raw: value,\n };\n};\n\nconst isSatisfied = (expected: Version, actual: Version): boolean => {\n if (actual.major > expected.major) {\n return true;\n }\n\n if (actual.major < expected.major) {\n return false;\n }\n\n // major is equal, continue on\n\n if (actual.minor > expected.minor) {\n return true;\n }\n\n if (actual.minor < expected.minor) {\n return false;\n }\n\n // minor is equal, continue on\n\n return actual.patch >= expected.patch;\n};\n\nexport default (peerDepValue: string, actualValue: string) => {\n const peerDep: Version = getVersion(peerDepValue);\n const actual: Version = getVersion(actualValue);\n\n if (isSatisfied(peerDep, actual)) {\n return;\n }\n\n warning(`\n React version: [${actual.raw}]\n does not satisfy expected peer dependency version: [${peerDep.raw}]\n\n This can result in run time bugs, and even fatal crashes\n `);\n};\n","// @flow\nimport { warning } from '../../dev-warning';\n\nconst suffix: string = `\n We expect a html5 doctype: <!doctype html>\n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md\n`;\n\nexport default (doc: Document) => {\n const doctype: DocumentType | null = doc.doctype;\n\n if (!doctype) {\n warning(`\n No <!doctype html> found.\n\n ${suffix}\n `);\n return;\n }\n\n if (doctype.name.toLowerCase() !== 'html') {\n warning(`\n Unexpected <!doctype> found: (${doctype.name})\n\n ${suffix}\n `);\n }\n\n if (doctype.publicId !== '') {\n warning(`\n Unexpected <!doctype> publicId found: (${doctype.publicId})\n A html5 doctype does not have a publicId\n\n ${suffix}\n `);\n }\n};\n","// @flow\n\nexport default function useDev(useHook: () => void) {\n // Don't run any validation in production\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useHook();\n }\n}\n","// @flow\nimport { useEffect } from 'react';\nimport { error } from '../dev-warning';\nimport useDev from './use-dev';\n\nexport default function useDevSetupWarning(fn: () => void, inputs?: unknown[]) {\n useDev(() => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n try {\n fn();\n } catch (e) {\n error(`\n A setup problem was encountered.\n\n > ${e.message}\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, inputs);\n });\n}\n","// @flow\nimport React from 'react';\nimport { peerDependencies } from '../../../package.json';\nimport checkReactVersion from './check-react-version';\nimport checkDoctype from './check-doctype';\nimport useDevSetupWarning from '../use-dev-setup-warning';\n\nexport default function useStartupValidation() {\n useDevSetupWarning(() => {\n checkReactVersion(peerDependencies.react, React.version);\n checkDoctype(document);\n }, []);\n}\n","// @flow\nimport { useRef, useEffect } from 'react';\n\n// export default function usePrevious<T>(current: T): {| current: T |} {\n// const ref = useRef<T>(current);\n\n// // will be updated on the next render\n// useEffect(() => {\n// ref.current = current;\n// });\n\n// // return the existing current (pre render)\n// return ref;\n// }\n\nexport default function usePrevious<T>(\n current: T,\n): React.RefObject<T> { // MutableRefObject\n const ref = useRef<T>(current);\n\n useEffect(() => {\n ref.current = current;\n });\n\n return ref;\n}","// @flow\nimport { invariant } from '../../invariant';\n\n// Exact\nexport type Lock = {\n abandon: () => void,\n};\n\n// Exact\nexport type LockAPI = {\n isClaimed: () => boolean,\n isActive: (lock: Lock) => boolean,\n claim: (abandon: () => void) => Lock,\n release: () => void,\n tryAbandon: () => void,\n};\n\nexport default function create(): LockAPI {\n let lock: Lock | null = null;\n\n function isClaimed(): boolean {\n return Boolean(lock);\n }\n\n function isActive(value: Lock): boolean {\n return value === lock;\n }\n\n function claim(abandon: () => void): Lock {\n invariant(!lock, 'Cannot claim lock as it is already claimed');\n const newLock: Lock = { abandon };\n // update singleton\n lock = newLock;\n // return lock\n return newLock;\n }\n function release() {\n invariant(lock, 'Cannot release lock when there is no lock');\n lock = null;\n }\n\n function tryAbandon() {\n if (lock) {\n lock.abandon();\n release();\n }\n }\n\n return { isClaimed, isActive, claim, release, tryAbandon };\n}\n","// @flow\nexport const tab: number = 9;\nexport const enter: number = 13;\nexport const escape: number = 27;\nexport const space: number = 32;\nexport const pageUp: number = 33;\nexport const pageDown: number = 34;\nexport const end: number = 35;\nexport const home: number = 36;\nexport const arrowLeft: number = 37;\nexport const arrowUp: number = 38;\nexport const arrowRight: number = 39;\nexport const arrowDown: number = 40;\n","// @flow\nimport * as keyCodes from '../../../key-codes';\n\ntype KeyMap = {\n [key: number]: true,\n};\n\nconst preventedKeys: KeyMap = {\n // submission\n [keyCodes.enter]: true,\n // tabbing\n [keyCodes.tab]: true,\n};\n\nexport default (event: KeyboardEvent) => {\n if (preventedKeys[event.keyCode]) {\n event.preventDefault();\n }\n};\n","// @flow\nimport { find } from '../../../../native-with-fallback';\n\nconst supportedEventName: string = ((): string => {\n const base: string = 'visibilitychange';\n\n // Server side rendering\n if (typeof document === 'undefined') {\n return base;\n }\n\n // See https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n const candidates: string[] = [\n base,\n `ms${base}`,\n `webkit${base}`,\n `moz${base}`,\n `o${base}`,\n ];\n\n const supported: string | undefined = find(\n candidates,\n (eventName: string): boolean => `on${eventName}` in document,\n );\n\n return supported || base;\n})();\n\nexport default supportedEventName;\n","// @flow\nimport { useRef } from \"react\";\nimport { useCallback, useMemo } from \"@helpdice/memoizer\";\nimport type { Position } from \"css-box-model\";\nimport { invariant } from \"../../../invariant\";\nimport type {\n PreDragActions,\n FluidDragActions,\n DraggableId,\n SensorAPI,\n DraggableOptions,\n} from \"../../../types\";\nimport type {\n EventBinding,\n EventOptions,\n} from \"../../event-bindings/event-types\";\nimport bindEvents from \"../../event-bindings/bind-events\";\nimport * as keyCodes from \"../../key-codes\";\nimport preventStandardKeyEvents from \"./util/prevent-standard-key-events\";\nimport supportedPageVisibilityEventName from \"./util/supported-page-visibility-event-name\";\nimport useLayoutEffect from \"../../use-isomorphic-layout-effect\";\nimport { noop } from \"../../../empty\";\n\n// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\nexport const primaryButton: number = 0;\nexport const sloppyClickThreshold: number = 5;\n\nfunction isSloppyClickThresholdExceeded(\n original: Position,\n current: Position,\n): boolean {\n return (\n Math.abs(current.x - original.x) >= sloppyClickThreshold ||\n Math.abs(current.y - original.y) >= sloppyClickThreshold\n );\n}\n\n// Exact\ntype Idle = {\n type: \"IDLE\",\n};\n\n// Exact\ntype Pending = {\n type: \"PENDING\",\n point: Position,\n actions: PreDragActions,\n};\n\n// Exact\ntype Dragging = {\n type: \"DRAGGING\",\n actions: FluidDragActions,\n};\n\ntype Phase = Idle | Pending | Dragging;\n\nconst idle: Idle = { type: \"IDLE\" };\n\n// Exact\ntype GetCaptureArgs = {\n cancel: () => void,\n completed: () => void,\n getPhase: () => Phase,\n setPhase: (phase: Phase) => void,\n};\n\nfunction getCaptureBindings({\n cancel,\n completed,\n getPhase,\n setPhase,\n}: GetCaptureArgs): EventBinding[] {\n return [\n {\n eventName: \"mousemove\",\n fn: (event: MouseEvent) => {\n const { button, clientX, clientY } = event;\n if (button !== primaryButton) {\n return;\n }\n\n const point: Position = {\n x: clientX,\n y: clientY,\n };\n\n const phase: Phase = getPhase();\n\n // Already dragging\n if (phase.type === \"DRAGGING\") {\n // preventing default as we are using this event\n event.preventDefault();\n phase.actions.move(point);\n return;\n }\n\n // There should be a pending drag at this point\n invariant(phase.type === \"PENDING\", \"Cannot be IDLE\");\n const pending: Position = phase.point;\n\n // threshold not yet exceeded\n if (!isSloppyClickThresholdExceeded(pending, point)) {\n return;\n }\n\n // preventing default as we are using this event\n event.preventDefault();\n\n // Lifting at the current point to prevent the draggable item from\n // jumping by the sloppyClickThreshold\n const actions: FluidDragActions = phase.actions.fluidLift(point);\n\n setPhase({\n type: \"DRAGGING\",\n actions,\n });\n },\n },\n {\n eventName: \"mouseup\",\n fn: (event: MouseEvent) => {\n const phase: Phase = getPhase();\n\n if (phase.type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // preventing default as we are using this event\n event.preventDefault();\n phase.actions.drop({ shouldBlockNextClick: true });\n completed();\n },\n },\n {\n eventName: \"mousedown\",\n fn: (event: MouseEvent) => {\n // this can happen during a drag when the user clicks a button\n // other than the primary mouse button\n if (getPhase().type === \"DRAGGING\") {\n event.preventDefault();\n }\n\n cancel();\n },\n },\n {\n eventName: \"keydown\",\n fn: (event: KeyboardEvent) => {\n const phase: Phase = getPhase();\n // Abort if any keystrokes while a drag is pending\n if (phase.type === \"PENDING\") {\n cancel();\n return;\n }\n\n // cancelling a drag\n if (event.keyCode === keyCodes.escape) {\n event.preventDefault();\n cancel();\n return;\n }\n\n preventStandardKeyEvents(event);\n },\n },\n {\n eventName: \"resize\",\n fn: cancel,\n },\n {\n eventName: \"scroll\",\n // kill a pending drag if there is a window scroll\n options: { passive: true, capture: false },\n fn: () => {\n if (getPhase().type === \"PENDING\") {\n cancel();\n }\n },\n },\n\n // Need to opt out of dragging if the user is a force press\n // Only for safari which has decided to introduce its own custom way of doing things\n // https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html\n {\n eventName: \"webkitmouseforcedown\",\n // it is considered a indirect cancel so we do not\n // prevent default in any situation.\n fn: (event: Event) => {\n const phase: Phase = getPhase();\n invariant(phase.type !== \"IDLE\", \"Unexpected phase\");\n\n if (phase.actions.shouldRespectForcePress()) {\n cancel();\n return;\n }\n\n // This technically doesn't do anything.\n // It won't do anything if `webkitmouseforcewillbegin` is prevented.\n // But it is a good signal that we want to opt out of this\n\n event.preventDefault();\n },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n ];\n}\n\nexport default function useMouseSensor(api: SensorAPI) {\n const phaseRef = useRef<Phase>(idle);\n const unbindEventsRef = useRef<() => void>(noop);\n\n const startCaptureBinding: EventBinding = useMemo(\n () => ({\n eventName: \"mousedown\",\n fn: function onMouseDown(event: MouseEvent) {\n // Event already used\n if (event.defaultPrevented) {\n return;\n }\n // only starting a drag if dragging with the primary mouse button\n if (event.button !== primaryButton) {\n return;\n }\n\n // Do not start a drag if any modifier key is pressed\n if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {\n return;\n }\n\n const draggableId: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!draggableId) {\n return;\n }\n\n const actions: PreDragActions | null = api.tryGetLock(\n draggableId,\n // stop is defined later\n // eslint-disable-next-line no-use-before-define\n stop,\n { sourceEvent: event },\n );\n\n if (!actions) {\n return;\n }\n\n // consuming the event\n event.preventDefault();\n\n const point: Position = {\n x: event.clientX,\n y: event.clientY,\n };\n\n // unbind this listener\n unbindEventsRef.current();\n // using this function before it is defined as their is a circular usage pattern\n // eslint-disable-next-line no-use-before-define\n startPendingDrag(actions, point);\n },\n }),\n // not including startPendingDrag as it is not defined initially\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [api],\n );\n\n const preventForcePressBinding: EventBinding = useMemo(\n () => ({\n eventName: \"webkitmouseforcewillbegin\",\n fn: (event: Event) => {\n if (event.defaultPrevented) {\n return;\n }\n\n const id: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!id) {\n return;\n }\n\n const options: DraggableOptions | null = api.findOptionsForDraggable(id);\n\n if (!options) {\n return;\n }\n\n if (options.shouldRespectForcePress) {\n return;\n }\n\n if (!api.canGetLock(id)) {\n return;\n }\n\n event.preventDefault();\n },\n }),\n [api],\n );\n\n const listenForCapture = useCallback(\n function listenForCapture() {\n const options: EventOptions = {\n passive: false,\n capture: true,\n };\n\n unbindEventsRef.current = bindEvents(\n window,\n [preventForcePressBinding, startCaptureBinding],\n options,\n );\n },\n [preventForcePressBinding, startCaptureBinding],\n );\n\n const stop = useCallback(() => {\n const current: Phase = phaseRef.current;\n if (current.type === \"IDLE\") {\n return;\n }\n\n phaseRef.current = idle;\n unbindEventsRef.current();\n\n listenForCapture();\n }, [listenForCapture]);\n\n const cancel = useCallback(() => {\n const phase: Phase = phaseRef.current;\n stop();\n if (phase.type === \"DRAGGING\" && phase.actions.cancel) {\n phase.actions.cancel({ shouldBlockNextClick: true });\n }\n if (phase.type === \"PENDING\") {\n phase.actions.abort();\n }\n }, [stop]);\n\n const bindCapturingEvents = useCallback(\n function bindCapturingEvents() {\n const options = { capture: true, passive: false };\n const bindings: EventBinding[] = getCaptureBindings({\n cancel,\n completed: stop,\n getPhase: () => phaseRef.current,\n setPhase: (phase: Phase) => {\n phaseRef.current = phase;\n },\n });\n\n unbindEventsRef.current = bindEvents(window, bindings, options);\n },\n [cancel, stop],\n );\n\n const startPendingDrag = useCallback(\n function startPendingDrag(actions: PreDragActions, point: Position) {\n invariant(\n phaseRef.current.type === \"IDLE\",\n \"Expected to move from IDLE to PENDING drag\",\n );\n phaseRef.current = {\n type: \"PENDING\",\n point,\n actions,\n };\n bindCapturingEvents();\n },\n [bindCapturingEvents],\n );\n\n useLayoutEffect(\n function mount() {\n listenForCapture();\n\n // kill any pending window events when unmounting\n return function unmount() {\n unbindEventsRef.current();\n };\n },\n [listenForCapture],\n );\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { invariant } from \"../../../invariant\";\nimport type {\n SensorAPI,\n PreDragActions,\n SnapDragActions,\n DraggableId,\n} from \"../../../types\";\nimport type {\n EventBinding,\n EventOptions,\n} from \"../../event-bindings/event-types\";\nimport * as keyCodes from \"../../key-codes\";\nimport bindEvents from \"../../event-bindings/bind-events\";\nimport preventStandardKeyEvents from \"./util/prevent-standard-key-events\";\nimport supportedPageVisibilityEventName from \"./util/supported-page-visibility-event-name\";\nimport useLayoutEffect from \"../../use-isomorphic-layout-effect\";\n\nfunction noop() {}\n\ntype KeyMap = {\n [key: number]: true,\n};\n\nconst scrollJumpKeys: KeyMap = {\n [keyCodes.pageDown]: true,\n [keyCodes.pageUp]: true,\n [keyCodes.home]: true,\n [keyCodes.end]: true,\n};\n\nfunction getDraggingBindings(\n actions: SnapDragActions,\n stop: () => void,\n): EventBinding[] {\n function cancel() {\n stop();\n actions.cancel && actions.cancel();\n }\n\n function drop() {\n stop();\n actions.drop();\n }\n\n return [\n {\n eventName: \"keydown\",\n fn: (event: KeyboardEvent) => {\n if (event.keyCode === keyCodes.escape) {\n event.preventDefault();\n cancel();\n return;\n }\n\n // Dropping\n if (event.keyCode === keyCodes.space) {\n // need to stop parent Draggable's thinking this is a lift\n event.preventDefault();\n drop();\n return;\n }\n\n // Movement\n\n if (event.keyCode === keyCodes.arrowDown && actions.moveDown) {\n event.preventDefault();\n actions.moveDown();\n return;\n }\n\n if (event.keyCode === keyCodes.arrowUp && actions.moveUp) {\n event.preventDefault();\n actions.moveUp();\n return;\n }\n\n if (event.keyCode === keyCodes.arrowRight && actions.moveRight) {\n event.preventDefault();\n actions.moveRight();\n return;\n }\n\n if (event.keyCode === keyCodes.arrowLeft && actions.moveLeft) {\n event.preventDefault();\n actions.moveLeft();\n return;\n }\n\n // preventing scroll jumping at this time\n if (scrollJumpKeys[event.keyCode]) {\n event.preventDefault();\n return;\n }\n\n preventStandardKeyEvents(event);\n },\n },\n // any mouse actions kills a drag\n {\n eventName: \"mousedown\",\n fn: cancel,\n },\n {\n eventName: \"mouseup\",\n fn: cancel,\n },\n {\n eventName: \"click\",\n fn: cancel,\n },\n {\n eventName: \"touchstart\",\n fn: cancel,\n },\n // resizing the browser kills a drag\n {\n eventName: \"resize\",\n fn: cancel,\n },\n // kill if the user is using the mouse wheel\n // We are not supporting wheel / trackpad scrolling with keyboard dragging\n {\n eventName: \"wheel\",\n fn: cancel,\n // chrome says it is a violation for this to not be passive\n // it is fine for it to be passive as we just cancel as soon as we get\n // any event\n options: { passive: true },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n ];\n}\n\nexport default function useKeyboardSensor(api: SensorAPI) {\n const unbindEventsRef = useRef<() => void>(noop);\n\n const startCaptureBinding: EventBinding = useMemo(\n () => ({\n eventName: \"keydown\",\n fn: function onKeyDown(event: KeyboardEvent) {\n // Event already used\n if (event.defaultPrevented) {\n return;\n }\n\n // Need to start drag with a spacebar press\n if (event.keyCode !== keyCodes.space) {\n return;\n }\n\n const draggableId: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!draggableId) {\n return;\n }\n\n const preDrag: PreDragActions | null = api.tryGetLock(\n draggableId,\n // abort function not defined yet\n // eslint-disable-next-line no-use-before-define\n stop,\n { sourceEvent: event },\n );\n\n // Cannot start capturing at this time\n if (!preDrag) {\n return;\n }\n\n // we are consuming the event\n event.preventDefault();\n let isCapturing: boolean = true;\n\n // There is no pending period for a keyboard drag\n // We can lift immediately\n const actions: SnapDragActions = preDrag.snapLift();\n\n // unbind this listener\n unbindEventsRef.current();\n\n // setup our function to end everything\n function stop() {\n invariant(\n isCapturing,\n \"Cannot stop capturing a keyboard drag when not capturing\",\n );\n isCapturing = false;\n\n // unbind dragging bindings\n unbindEventsRef.current();\n // start listening for capture again\n // eslint-disable-next-line no-use-before-define\n listenForCapture();\n }\n\n // bind dragging listeners\n unbindEventsRef.current = bindEvents(\n window,\n getDraggingBindings(actions, stop),\n { capture: true, passive: false },\n );\n },\n }),\n // not including startPendingDrag as it is not defined initially\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [api],\n );\n\n const listenForCapture = useCallback(\n function tryStartCapture() {\n const options: EventOptions = {\n passive: false,\n capture: true,\n };\n\n unbindEventsRef.current = bindEvents(\n window,\n [startCaptureBinding],\n options,\n );\n },\n [startCaptureBinding],\n );\n\n useLayoutEffect(\n function mount() {\n listenForCapture();\n\n // kill any pending window events when unmounting\n return function unmount() {\n unbindEventsRef.current();\n };\n },\n [listenForCapture],\n );\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useCallback, useMemo } from \"@helpdice/memoizer\";\nimport type { Position } from \"css-box-model\";\nimport { invariant } from \"../../../invariant\";\nimport type {\n DraggableId,\n SensorAPI,\n PreDragActions,\n FluidDragActions,\n TimeoutID,\n} from \"../../../types\";\nimport type {\n EventBinding,\n EventOptions,\n} from \"../../event-bindings/event-types\";\nimport bindEvents from \"../../event-bindings/bind-events\";\nimport * as keyCodes from \"../../key-codes\";\nimport supportedPageVisibilityEventName from \"./util/supported-page-visibility-event-name\";\nimport { noop } from \"../../../empty\";\nimport useLayoutEffect from \"../../use-isomorphic-layout-effect\";\n\ntype TouchWithForce = Touch & {\n force: number,\n};\n\n//Exact\ntype Idle = {\n type: \"IDLE\",\n};\n\n// Exact\ntype Pending = {\n type: \"PENDING\",\n point: Position,\n actions: PreDragActions,\n longPressTimerId: TimeoutID,\n};\n\n// Exact\ntype Dragging = {\n type: \"DRAGGING\",\n actions: FluidDragActions,\n hasMoved: boolean,\n};\n\ntype Phase = Idle | Pending | Dragging;\n\nconst idle: Idle = { type: \"IDLE\" };\n// Decreased from 150 as a work around for an issue for forcepress on iOS\n// https://github.com/atlassian/react-beautiful-dnd/issues/1401\nexport const timeForLongPress: number = 120;\nexport const forcePressThreshold: number = 0.15;\n\n// Exact\ntype GetBindingArgs = {\n cancel: () => void,\n completed: () => void,\n getPhase: () => Phase,\n};\n\nfunction getWindowBindings({\n cancel,\n getPhase,\n}: GetBindingArgs): EventBinding[] {\n return [\n // If the orientation of the device changes - kill the drag\n // https://davidwalsh.name/orientation-change\n {\n eventName: \"orientationchange\",\n fn: cancel,\n },\n // some devices fire resize if the orientation changes\n {\n eventName: \"resize\",\n fn: cancel,\n },\n // Long press can bring up a context menu\n // need to opt out of this behavior\n {\n eventName: \"contextmenu\",\n fn: (event: Event) => {\n // always opting out of context menu events\n event.preventDefault();\n },\n },\n // On some devices it is possible to have a touch interface with a keyboard.\n // On any keyboard event we cancel a touch drag\n {\n eventName: \"keydown\",\n fn: (event: KeyboardEvent) => {\n if (getPhase().type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // direct cancel: we are preventing the default action\n // indirect cancel: we are not preventing the default action\n\n // escape is a direct cancel\n if (event.keyCode === keyCodes.escape) {\n event.preventDefault();\n }\n cancel();\n },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n ];\n}\n\n// All of the touch events get applied to the drag handle of the touch interaction\n// This plays well with the event.target being unmounted during a drag\nfunction getHandleBindings({\n cancel,\n completed,\n getPhase,\n}: GetBindingArgs): EventBinding[] {\n return [\n {\n eventName: \"touchmove\",\n // Opting out of passive touchmove (default) so as to prevent scrolling while moving\n // Not worried about performance as effect of move is throttled in requestAnimationFrame\n // Using `capture: false` due to a recent horrible firefox bug: https://twitter.com/alexandereardon/status/1125904207184187393\n options: { capture: false },\n fn: (event: TouchEvent) => {\n const phase: Phase = getPhase();\n // Drag has not yet started and we are waiting for a long press.\n if (phase.type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // At this point we are dragging\n phase.hasMoved = true;\n\n const { clientX, clientY } = event.touches[0];\n\n const point: Position = {\n x: clientX,\n y: clientY,\n };\n\n // We need to prevent the default event in order to block native scrolling\n // Also because we are using it as part of a drag we prevent the default action\n // as a sign that we are using the event\n event.preventDefault();\n phase.actions.move(point);\n },\n },\n {\n eventName: \"touchend\",\n fn: (event: TouchEvent) => {\n const phase: Phase = getPhase();\n // drag had not started yet - do not prevent the default action\n if (phase.type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // ending the drag\n event.preventDefault();\n phase.actions.drop({ shouldBlockNextClick: true });\n completed();\n },\n },\n {\n eventName: \"touchcancel\",\n fn: (event: TouchEvent) => {\n // drag had not started yet - do not prevent the default action\n if (getPhase().type !== \"DRAGGING\") {\n cancel();\n return;\n }\n\n // already dragging - this event is directly ending a drag\n event.preventDefault();\n cancel();\n },\n },\n // Need to opt out of dragging if the user is a force press\n // Only for webkit which has decided to introduce its own custom way of doing things\n // https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html\n {\n eventName: \"touchforcechange\",\n fn: (event: TouchEvent) => {\n const phase: Phase = getPhase();\n\n // needed to use phase.actions\n invariant(phase.type !== \"IDLE\");\n\n // This is not fantastic logic, but it is done to account for\n // and issue with forcepress on iOS\n // Calling event.preventDefault() will currently opt out of scrolling and clicking\n // https://github.com/atlassian/react-beautiful-dnd/issues/1401\n\n const touch: TouchWithForce | null = (event.touches[0] as any);\n\n if (!touch) {\n return;\n }\n\n const isForcePress: boolean = touch.force >= forcePressThreshold;\n\n if (!isForcePress) {\n return;\n }\n\n const shouldRespect: boolean = phase.actions.shouldRespectForcePress();\n\n if (phase.type === \"PENDING\") {\n if (shouldRespect) {\n cancel();\n }\n // If not respecting we just let the event go through\n // It will not have an impact on the browser until\n // there has been a sufficient time ellapsed\n return;\n }\n\n // 'DRAGGING'\n\n if (shouldRespect) {\n if (phase.hasMoved) {\n // After the user has moved we do not allow the dragging item to be force pressed\n // This prevents strange behaviour such as a link preview opening mid drag\n event.preventDefault();\n return;\n }\n // indirect cancel\n cancel();\n return;\n }\n\n // not respecting during a drag\n event.preventDefault();\n },\n },\n // Cancel on page visibility change\n {\n eventName: supportedPageVisibilityEventName,\n fn: cancel,\n },\n // Not adding a cancel on touchstart as this handler will pick up the initial touchstart event\n ];\n}\n\nexport default function useTouchSensor(api: SensorAPI) {\n const phaseRef = useRef<Phase>(idle);\n const unbindEventsRef = useRef<() => void>(noop);\n\n const getPhase = useCallback(function getPhase(): Phase {\n return phaseRef.current;\n }, []);\n\n const setPhase = useCallback(function setPhase(phase: Phase) {\n phaseRef.current = phase;\n }, []);\n\n const startCaptureBinding: EventBinding = useMemo(\n () => ({\n eventName: \"touchstart\",\n fn: function onTouchStart(event: TouchEvent) {\n // Event already used by something else\n if (event.defaultPrevented) {\n return;\n }\n\n // We need to NOT call event.preventDefault() so as to maintain as much standard\n // browser interactions as possible.\n // This includes navigation on anchors which we want to preserve\n\n const draggableId: DraggableId | null = api.findClosestDraggableId(event);\n\n if (!draggableId) {\n return;\n }\n\n const actions: PreDragActions | null = api.tryGetLock(\n draggableId,\n // eslint-disable-next-line no-use-before-define\n stop,\n { sourceEvent: event },\n );\n\n // could not start a drag\n if (!actions) {\n return;\n }\n\n const touch: Touch = event.touches[0];\n const { clientX, clientY } = touch;\n const point: Position = {\n x: clientX,\n y: clientY,\n };\n\n // unbind this event handler\n unbindEventsRef.current();\n\n // eslint-disable-next-line no-use-before-define\n startPendingDrag(actions, point);\n },\n }),\n // not including stop or startPendingDrag as it is not defined initially\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [api],\n );\n\n const listenForCapture = useCallback(\n function listenForCapture() {\n const options: EventOptions = {\n capture: true,\n passive: false,\n };\n\n unbindEventsRef.current = bindEvents(\n window,\n [startCaptureBinding],\n options,\n );\n },\n [startCaptureBinding],\n );\n\n const stop = useCallback(() => {\n const current: Phase = phaseRef.current;\n if (current.type === \"IDLE\") {\n return;\n }\n\n // aborting any pending drag\n if (current.type === \"PENDING\") {\n clearTimeout(current.longPressTimerId);\n }\n\n setPhase(idle);\n unbindEventsRef.current();\n\n listenForCapture();\n }, [listenForCapture, setPhase]);\n\n const cancel = useCallback(() => {\n const phase: Phase = phaseRef.current;\n stop();\n if (phase.type === \"DRAGGING\" && phase.actions.cancel) {\n phase.actions.cancel({ shouldBlockNextClick: true });\n }\n if (phase.type === \"PENDING\") {\n phase.actions.abort();\n }\n }, [stop]);\n\n const bindCapturingEvents = useCallback(\n function bindCapturingEvents() {\n const options: EventOptions = { capture: true, passive: false };\n const args: GetBindingArgs = {\n cancel,\n completed: stop,\n getPhase,\n };\n\n // In prior versions of iOS it was required that touch listeners be added\n // to the handle to work correctly (even if the handle got removed in a portal / clone)\n // In the latest version it appears to be the opposite: for reparenting to work\n // the events need to be attached to the window.\n // For now i'll keep these two functions seperate in case we need to swap it back again\n // Old behaviour:\n // https://gist.github.com/parris/dda613e3ae78f14eb2dc9fa0f4bfce3d\n // https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed\n const unbindTarget = bindEvents(window, getHandleBindings(args), options);\n const unbindWindow = bindEvents(window, getWindowBindings(args), options);\n\n unbindEventsRef.current = function unbindAll() {\n unbindTarget();\n unbindWindow();\n };\n },\n [cancel, getPhase, stop],\n );\n\n const startDragging = useCallback(\n function startDragging() {\n const phase: Phase = getPhase();\n invariant(\n phase.type === \"PENDING\",\n `Cannot start dragging from phase ${phase.type}`,\n );\n\n const actions: FluidDragActions = phase.actions.fluidLift(phase.point);\n\n setPhase({\n type: \"DRAGGING\",\n actions,\n hasMoved: false,\n });\n },\n [getPhase, setPhase],\n );\n\n const startPendingDrag = useCallback(\n function startPendingDrag(actions: PreDragActions, point: Position) {\n invariant(\n getPhase().type === \"IDLE\",\n \"Expected to move from IDLE to PENDING drag\",\n );\n\n const longPressTimerId: TimeoutID = setTimeout(\n startDragging,\n timeForLongPress,\n );\n\n setPhase({\n type: \"PENDING\",\n point,\n actions,\n longPressTimerId,\n });\n\n bindCapturingEvents();\n },\n [bindCapturingEvents, getPhase, setPhase, startDragging],\n );\n\n useLayoutEffect(\n function mount() {\n listenForCapture();\n\n return function unmount() {\n // remove any existing listeners\n unbindEventsRef.current();\n\n // need to kill any pending drag start timer\n const phase: Phase = getPhase();\n if (phase.type === \"PENDING\") {\n clearTimeout(phase.longPressTimerId);\n setPhase(idle);\n }\n };\n },\n [getPhase, listenForCapture, setPhase],\n );\n\n // This is needed for safari\n // Simply adding a non capture, non passive 'touchmove' listener.\n // This forces event.preventDefault() in dynamically added\n // touchmove event handlers to actually work\n // https://github.com/atlassian/react-beautiful-dnd/issues/1374\n useLayoutEffect(function webkitHack(): () => void {\n const unbind = bindEvents(window, [\n {\n eventName: 'touchmove',\n // Using a new noop function for each usage as a single\n // removeEventListener() call will remove all handlers\n // with the same reference.\n fn: (): void => {},\n options: { capture: false, passive: false },\n },\n ], {});\n\n return unbind;\n}, []);\n\n // useLayoutEffect(function webkitHack() {\n // const unbind = bindEvents(window, [\n // {\n // eventName: \"touchmove\",\n // // using a new noop function for each usage as a single `removeEventListener()`\n // // call will remove all handlers with the same reference\n // // https://codesandbox.io/s/removing-multiple-handlers-with-same-reference-fxe15\n // fn: () => {},\n // options: { capture: false, passive: false },\n // },\n // ]);\n\n // return unbind;\n // }, []);\n}\n","// @flow\n/* eslint-disable react-hooks/rules-of-hooks */\nimport { invariant } from '../../invariant';\nimport type { Sensor } from '../../types';\nimport usePreviousRef from '../use-previous-ref';\nimport useDevSetupWarning from '../use-dev-setup-warning';\nimport useDev from '../use-dev';\n\nexport default function useValidateSensorHooks(sensorHooks: Sensor[]) {\n useDev(() => {\n const previousRef = usePreviousRef<Sensor[]>(sensorHooks);\n\n useDevSetupWarning(() => {\n invariant(\n previousRef.current.length === sensorHooks.length,\n 'Cannot change the amount of sensor hooks after mounting',\n );\n });\n });\n}\n","// @flow\nimport isHtmlElement from '../is-type-of-element/is-html-element';\n\nexport type TagNameMap = {\n [tagName: string]: true,\n};\n\nexport const interactiveTagNames: TagNameMap = {\n input: true,\n button: true,\n textarea: true,\n select: true,\n option: true,\n optgroup: true,\n video: true,\n audio: true,\n};\n\nfunction isAnInteractiveElement(parent: Element, current: Element | null) {\n if (current == null) {\n return false;\n }\n\n // Most interactive elements cannot have children. However, some can such as 'button'.\n // See 'Permitted content' on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n // Rather than having two different functions we can consolidate our checks into this single\n // function to keep things simple.\n // There is no harm checking if the parent has an interactive tag name even if it cannot have\n // any children. We need to perform this loop anyway to check for the contenteditable attribute\n const hasAnInteractiveTag: boolean = Boolean(\n interactiveTagNames[current.tagName.toLowerCase()],\n );\n\n if (hasAnInteractiveTag) {\n return true;\n }\n\n // contenteditable=\"true\" or contenteditable=\"\" are valid ways\n // of creating a contenteditable container\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable\n const attribute: string | null = current.getAttribute('contenteditable');\n if (attribute === 'true' || attribute === '') {\n return true;\n }\n\n // nothing more can be done and no results found\n if (current === parent) {\n return false;\n }\n\n // recursion to check parent\n return isAnInteractiveElement(parent, current.parentElement);\n}\n\n// Marked for Review\nexport default function isEventInInteractiveElement(\n draggable: Element,\n event: Event,\n): boolean {\n const target: EventTarget | null = event.target;\n\n if (target && !isHtmlElement(target as Element)) {\n return false;\n }\n\n return isAnInteractiveElement(draggable, target as Element);\n}\n","// @flow\nimport { getRect, type Position } from 'css-box-model';\n\nexport default (el: HTMLElement): Position =>\n getRect(el.getBoundingClientRect()).center;\n","// @flow\nimport getWindowFromEl from '../window/get-window-from-el';\n\nexport default function isElement(el: Element | null): el is Element {\n return el instanceof getWindowFromEl(el).Element;\n}\n\n// export default function isElement(el: Object): boolean %checks {\n// return el instanceof getWindowFromEl(el).Element;\n// }\n","// @flow Marked for Review\nimport { find } from '../../native-with-fallback';\n\n// const supportedMatchesName: string = ((): string => {\n// const base: string = 'matches';\n\n// // Server side rendering\n// if (typeof document === 'undefined') {\n// return base;\n// }\n\n// // See https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n// const candidates: string[] = [\n// base,\n// 'msMatchesSelector',\n// 'webkitMatchesSelector',\n// ];\n\n// const value: string | null = find(\n// candidates,\n// (name: string): boolean => name in Element.prototype,\n// );\n\n// return value || base;\n// })();\n\ntype MatchesMethod =\n | 'matches'\n | 'msMatchesSelector'\n | 'webkitMatchesSelector';\n\ntype MatchesElement = Element & {\n matches: (selector: string) => boolean;\n msMatchesSelector?: (selector: string) => boolean;\n webkitMatchesSelector?: (selector: string) => boolean;\n};\n\nconst supportedMatchesName: MatchesMethod = (() => {\n const base: MatchesMethod = 'matches';\n\n if (typeof document === 'undefined') {\n return base;\n }\n\n const candidates: MatchesMethod[] = [\n base,\n 'msMatchesSelector',\n 'webkitMatchesSelector',\n ];\n\n return find(\n candidates,\n (name: MatchesMethod): boolean => name in Element.prototype,\n ) || base;\n})();\n\n\nfunction closestPonyfill(el: Element | null, selector: string) {\n\n if (el == null) {\n return null;\n }\n\n const matchesElement = el as MatchesElement;\n\n // Element.prototype.matches is supported in ie11 with a different name\n // https://caniuse.com/#feat=matchesselector\n // $FlowFixMe - dynamic property\n\n // if (el[supportedMatchesName](selector)) {\n // return el;\n // }\n\n if (matchesElement[supportedMatchesName]?.(selector)) {\n return el;\n }\n\n // recursively look up the tree\n return closestPonyfill(el.parentElement, selector);\n}\n\nexport default function closest(el: Element | null, selector: string): Element | null {\n // Using native closest for maximum speed where we can\n if (el?.closest) {\n return el.closest(selector);\n }\n // ie11: damn you!\n return closestPonyfill(el, selector);\n}\n","// @flow\nimport type { ContextId, DraggableId } from '../../types';\nimport * as attributes from '../data-attributes';\nimport isElement from '../is-type-of-element/is-element';\nimport isHtmlElement from '../is-type-of-element/is-html-element';\nimport closest from './closest';\nimport { warning } from '../../dev-warning';\n\nfunction getSelector(contextId: ContextId): string {\n return `[${attributes.dragHandle.contextId}=\"${contextId}\"]`;\n}\n\nfunction findClosestDragHandleFromEvent(\n contextId: ContextId,\n event: Event,\n): HTMLElement | Element | null {\n const target: any = event.target; // Eventtarget | null\n\n if (!isElement(target)) {\n warning('event.target must be a Element');\n return null;\n }\n\n const selector: string = getSelector(contextId);\n const handle: Element | null = closest(target as Element, selector);\n\n if (!handle) {\n return null;\n }\n\n if (!isHtmlElement(handle)) {\n warning('drag handle must be a HTMLElement');\n return null;\n }\n\n return handle;\n}\n\nexport default function tryGetClosestDraggableIdFromEvent(\n contextId: ContextId,\n event: Event,\n): DraggableId | null {\n const handle: HTMLElement | Element | null = findClosestDragHandleFromEvent(contextId, event);\n\n if (!handle) {\n return null;\n }\n\n return handle.getAttribute(attributes.dragHandle.draggableId);\n}\n","// @flow\nimport type { DraggableId, ContextId } from '../../types';\nimport * as attributes from '../data-attributes';\nimport { find, toArray } from '../../native-with-fallback';\nimport { warning } from '../../dev-warning';\nimport isHtmlElement from '../is-type-of-element/is-html-element';\n\nexport default function findDraggable(\n contextId: ContextId,\n draggableId: DraggableId,\n): HTMLElement | null {\n // cannot create a selector with the draggable id as it might not be a valid attribute selector\n const selector: string = `[${attributes.draggable.contextId}=\"${contextId}\"]`;\n const possible: Element[] = toArray(document.querySelectorAll(selector));\n\n const draggable: Element | undefined = find(possible, (el: Element): boolean => {\n return el.getAttribute(attributes.draggable.id) === draggableId;\n });\n\n if (!draggable) {\n return null;\n }\n\n if (!isHtmlElement(draggable)) {\n warning('Draggable element is not a HTMLElement');\n return null;\n }\n\n return draggable as HTMLElement;\n}\n","// @flow\nimport rafSchd from \"raf-schd\";\nimport { useState } from \"react\";\nimport { useCallback, useMemo } from \"@helpdice/memoizer\";\nimport type { Position } from \"css-box-model\";\n// import { invariant } from \"../../invariant\";\nimport type {\n ContextId,\n State,\n Sensor,\n StopDragOptions,\n PreDragActions,\n FluidDragActions,\n SnapDragActions,\n DraggableId,\n SensorAPI,\n TryGetLock,\n TryGetLockOptions,\n DraggableOptions,\n} from \"../../types\";\nimport create, { type Lock, type LockAPI } from \"./lock\";\nimport type { Store, Action } from \"../../state/store-types\";\nimport canStartDrag from \"../../state/can-start-drag\";\nimport {\n move as moveAction,\n moveUp as moveUpAction,\n moveRight as moveRightAction,\n moveDown as moveDownAction,\n moveLeft as moveLeftAction,\n drop as dropAction,\n lift as liftAction,\n type LiftArgs as LiftActionArgs,\n flush,\n} from \"../../state/action-creators\";\nimport type {\n Registry,\n DraggableEntry,\n} from \"../../state/registry/registry-types\";\nimport useMouseSensor from \"./sensors/use-mouse-sensor\";\nimport useKeyboardSensor from \"./sensors/use-keyboard-sensor\";\nimport useTouchSensor from \"./sensors/use-touch-sensor\";\nimport useValidateSensorHooks from \"./use-validate-sensor-hooks\";\nimport isEventInInteractiveElement from \"./is-event-in-interactive-element\";\nimport getBorderBoxCenterPosition from \"../get-border-box-center-position\";\nimport { warning } from \"../../dev-warning\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport { noop } from \"../../empty\";\nimport findClosestDraggableIdFromEvent from \"./find-closest-draggable-id-from-event\";\nimport findDraggable from \"../get-elements/find-draggable\";\nimport bindEvents from \"../event-bindings/bind-events\";\nimport { isDragging } from \"../../state/reducer\";\n\nfunction preventDefault(event: Event) {\n event.preventDefault();\n}\n\ntype LockPhase = \"PRE_DRAG\" | \"DRAGGING\" | \"COMPLETED\";\n\n// Exact\ntype IsActiveArgs = {\n expected: LockPhase,\n phase: LockPhase,\n isLockActive: () => boolean,\n shouldWarn: boolean,\n};\n\nfunction isActive({\n expected,\n phase,\n isLockActive,\n shouldWarn,\n}: IsActiveArgs): boolean {\n // lock is no longer active\n if (!isLockActive()) {\n if (shouldWarn) {\n warning(`\n Cannot perform action.\n The sensor no longer has an action lock.\n\n Tips:\n\n - Throw away your action handlers when forceStop() is called\n - Check actions.isActive() if you really need to\n `);\n }\n return false;\n }\n // wrong phase\n if (expected !== phase) {\n if (shouldWarn) {\n warning(`\n Cannot perform action.\n The actions you used belong to an outdated phase\n\n Current phase: ${expected}\n You called an action from outdated phase: ${phase}\n\n Tips:\n\n - Do not use preDragActions actions after calling preDragActions.lift()\n `);\n }\n return false;\n }\n return true;\n}\n\n// Exact\ntype CanStartArgs = {\n lockAPI: LockAPI,\n registry: Registry,\n store: Store,\n draggableId: DraggableId,\n};\n\nfunction canStart({\n lockAPI,\n store,\n registry,\n draggableId,\n}: CanStartArgs): boolean {\n // lock is already claimed - cannot start\n if (lockAPI.isClaimed()) {\n return false;\n }\n\n const entry: DraggableEntry | null = registry.draggable.findById(draggableId);\n\n if (!entry) {\n warning(`Unable to find draggable with id: ${draggableId}`);\n return false;\n }\n\n // draggable is not enabled - cannot start\n if (!entry.options.isEnabled) {\n return false;\n }\n\n // Application might now allow dragging right now\n if (!canStartDrag(store.getState(), draggableId)) {\n return false;\n }\n\n return true;\n}\n\n// Exact\ntype TryStartArgs = {\n lockAPI: LockAPI,\n contextId: ContextId,\n registry: Registry,\n store: Store,\n draggableId: DraggableId,\n forceSensorStop?: () => void,\n sourceEvent: Event | null,\n};\n\nfunction tryStart({\n lockAPI,\n contextId,\n store,\n registry,\n draggableId,\n forceSensorStop,\n sourceEvent,\n}: TryStartArgs): PreDragActions | null {\n const shouldStart: boolean = canStart({\n lockAPI,\n store,\n registry,\n draggableId,\n });\n\n if (!shouldStart) {\n return null;\n }\n\n const entry: DraggableEntry = registry.draggable.getById(draggableId);\n const el: HTMLElement | null = findDraggable(contextId, entry.descriptor.id);\n\n if (!el) {\n warning(`Unable to find draggable element with id: ${draggableId}`);\n return null;\n }\n\n // Do not allow dragging from interactive elements\n if (\n sourceEvent &&\n !entry.options.canDragInteractiveElements &&\n isEventInInteractiveElement(el, sourceEvent)\n ) {\n return null;\n }\n\n // claiming lock\n const lock: Lock = lockAPI.claim(forceSensorStop || noop);\n let phase: LockPhase = \"PRE_DRAG\";\n\n function getShouldRespectForcePress(): boolean {\n // not looking up the entry as it might have been removed in a virtual list\n return entry.options.shouldRespectForcePress;\n }\n\n function isLockActive(): boolean {\n return lockAPI.isActive(lock);\n }\n\n function tryDispatch(expected: LockPhase, getAction: () => Action): void {\n if (isActive({ expected, phase, isLockActive, shouldWarn: true })) {\n store.dispatch(getAction());\n }\n }\n\n const tryDispatchWhenDragging = tryDispatch.bind(null, \"DRAGGING\");\n\n // Exact\n type LiftArgs = {\n liftActionArgs: LiftActionArgs,\n cleanup: () => void,\n actions: Object,\n };\n\n function lift(args: LiftArgs) {\n function completed() {\n lockAPI.release();\n phase = \"COMPLETED\";\n }\n // Double lift = bad\n if (phase !== \"PRE_DRAG\") {\n completed();\n // invariant(phase === \"PRE_DRAG\", `Cannot lift in phase ${phase}`);\n }\n\n store.dispatch(liftAction(args.liftActionArgs));\n\n // We are now in the DRAGGING phase\n phase = \"DRAGGING\";\n\n function finish(\n reason: \"CANCEL\" | \"DROP\",\n options: StopDragOptions = { shouldBlockNextClick: false },\n ) {\n args.cleanup();\n\n // block next click if requested\n if (options.shouldBlockNextClick) {\n const unbind = bindEvents(window, [\n {\n eventName: \"click\",\n fn: preventDefault,\n options: {\n // only blocking a single click\n once: true,\n passive: false,\n capture: true,\n },\n },\n ], {});\n // Sometimes the click is swallowed, such as when there is reparenting\n // The click event (in the message queue) will occur before the next setTimeout expiry\n // https://codesandbox.io/s/click-behaviour-pkfk2\n setTimeout(unbind);\n }\n\n // releasing\n completed();\n store.dispatch(dropAction({ reason }));\n }\n\n return {\n isActive: () =>\n isActive({\n expected: \"DRAGGING\",\n phase,\n isLockActive,\n // Do not want to want warnings for boolean checks\n shouldWarn: false,\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n drop: (options?: StopDragOptions) => finish(\"DROP\", options),\n cancel: (options?: StopDragOptions) => finish(\"CANCEL\", options),\n ...args.actions,\n };\n }\n\n function fluidLift(clientSelection: Position): FluidDragActions {\n const move = rafSchd((client: Position) => {\n tryDispatchWhenDragging(() => moveAction({ client }));\n });\n\n const api = lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection,\n movementMode: \"FLUID\",\n },\n cleanup: () => move.cancel(),\n actions: { move },\n });\n\n return {\n ...api,\n move,\n };\n }\n\n function snapLift(): SnapDragActions {\n const actions = {\n moveUp: () => tryDispatchWhenDragging(moveUpAction),\n moveRight: () => tryDispatchWhenDragging(moveRightAction),\n moveDown: () => tryDispatchWhenDragging(moveDownAction),\n moveLeft: () => tryDispatchWhenDragging(moveLeftAction),\n };\n\n return lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection: getBorderBoxCenterPosition(el as HTMLElement),\n movementMode: \"SNAP\",\n },\n cleanup: noop,\n actions,\n });\n }\n\n function abortPreDrag() {\n const shouldRelease: boolean = isActive({\n expected: \"PRE_DRAG\",\n phase,\n isLockActive,\n shouldWarn: true,\n });\n\n if (shouldRelease) {\n lockAPI.release();\n }\n }\n\n const preDrag: PreDragActions = {\n isActive: () =>\n isActive({\n expected: \"PRE_DRAG\",\n phase,\n isLockActive,\n // Do not want to want warnings for boolean checks\n shouldWarn: false,\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n fluidLift,\n snapLift,\n abort: abortPreDrag,\n };\n\n return preDrag;\n}\n\n// Exact\ntype SensorMarshalArgs = {\n contextId: ContextId,\n registry: Registry,\n store: Store,\n customSensors?: (Sensor[]) | null,\n enableDefaultSensors: boolean,\n};\n\n// default sensors are now exported to library consumers\nconst defaultSensors: Sensor[] = [\n useMouseSensor,\n useKeyboardSensor,\n useTouchSensor,\n];\n\nexport default function useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors,\n enableDefaultSensors,\n}: SensorMarshalArgs) {\n const useSensors: Sensor[] = [\n ...(enableDefaultSensors ? defaultSensors : []),\n ...(customSensors || []),\n ];\n const lockAPI: LockAPI = useState(() => create())[0];\n\n const tryAbandonLock = useCallback(\n function tryAbandonLock(previous: State, current: State) {\n if (isDragging(previous) && !isDragging(current)) {\n lockAPI.tryAbandon();\n }\n // if (previous.isDragging && !current.isDragging) {\n // lockAPI.tryAbandon();\n // }\n },\n [lockAPI],\n );\n\n // We need to abort any capturing if there is no longer a drag\n useLayoutEffect(\n function listenToStore() {\n let previous: State = store.getState();\n const unsubscribe = store.subscribe(() => {\n const current: State = store.getState();\n tryAbandonLock(previous, current);\n previous = current;\n });\n\n // unsubscribe from store when unmounting\n return unsubscribe;\n },\n [lockAPI, store, tryAbandonLock],\n );\n\n // abort any lock on unmount\n useLayoutEffect(() => {\n return lockAPI.tryAbandon;\n }, [lockAPI.tryAbandon]);\n\n const canGetLock = useCallback(\n (draggableId: DraggableId): boolean => {\n return canStart({\n lockAPI,\n registry,\n store,\n draggableId,\n });\n },\n [lockAPI, registry, store],\n );\n\n const tryGetLock: TryGetLock = useCallback(\n (\n draggableId: DraggableId,\n forceStop?: () => void,\n options?: TryGetLockOptions,\n ): PreDragActions | null =>\n tryStart({\n lockAPI,\n registry,\n contextId,\n store,\n draggableId,\n forceSensorStop: forceStop,\n sourceEvent:\n options && options.sourceEvent ? options.sourceEvent : null,\n }),\n [contextId, lockAPI, registry, store],\n );\n\n const findClosestDraggableId = useCallback(\n (event: Event): DraggableId | null =>\n findClosestDraggableIdFromEvent(contextId, event),\n [contextId],\n );\n\n const findOptionsForDraggable = useCallback(\n (id: DraggableId): DraggableOptions | null => {\n const entry: DraggableEntry | null = registry.draggable.findById(id);\n return entry ? entry.options : null;\n },\n [registry.draggable],\n );\n\n const tryReleaseLock = useCallback(\n function tryReleaseLock() {\n if (!lockAPI.isClaimed()) {\n return;\n }\n\n lockAPI.tryAbandon();\n\n if (store.getState().phase !== \"IDLE\") {\n store.dispatch(flush());\n }\n },\n [lockAPI, store],\n );\n const isLockClaimed = useCallback(lockAPI.isClaimed, [lockAPI]);\n\n const api: SensorAPI = useMemo(\n () => ({\n canGetLock,\n tryGetLock,\n findClosestDraggableId,\n findOptionsForDraggable,\n tryReleaseLock,\n isLockClaimed,\n }),\n [\n canGetLock,\n tryGetLock,\n findClosestDraggableId,\n findOptionsForDraggable,\n tryReleaseLock,\n isLockClaimed,\n ],\n );\n\n // Bad ass\n useValidateSensorHooks(useSensors);\n for (let i = 0; i < useSensors.length; i++) {\n useSensors[i](api);\n }\n}\n","// @flow\nimport { useEffect, useRef, type ReactNode } from \"react\";\n// import { bindActionCreators } from \"redux\";\nimport { Provider } from \"react-redux\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { invariant } from \"../../invariant\";\nimport createStore from \"../../state/create-store\";\nimport createDimensionMarshal from \"../../state/dimension-marshal/dimension-marshal\";\nimport canStartDrag from \"../../state/can-start-drag\";\nimport scrollWindow from \"../window/scroll-window\";\nimport createAutoScroller from \"../../state/auto-scroller\";\nimport useStyleMarshal from \"../use-style-marshal/use-style-marshal\";\nimport useFocusMarshal from \"../use-focus-marshal\";\nimport useRegistry from \"../../state/registry/use-registry\";\nimport type { Registry } from \"../../state/registry/registry-types\";\nimport type { FocusMarshal } from \"../use-focus-marshal/focus-marshal-types\";\nimport type { AutoScroller } from \"../../state/auto-scroller/auto-scroller-types\";\nimport type { StyleMarshal } from \"../use-style-marshal/style-marshal-types\";\nimport type {\n DimensionMarshal,\n Callbacks as DimensionMarshalCallbacks,\n} from \"../../state/dimension-marshal/dimension-marshal-types\";\nimport type {\n DraggableId,\n State,\n Responders,\n Announce,\n Sensor,\n ElementId,\n} from \"../../types\";\nimport type { Store, Action } from \"../../state/store-types\";\nimport type { SetAppCallbacks, AppCallbacks } from \"./drag-drop-context-types\";\nimport StoreContext from \"../context/store-context\";\nimport {\n move,\n publishWhileDragging,\n updateDroppableScroll,\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n collectionStarting,\n flush,\n} from \"../../state/action-creators\";\nimport isMovementAllowed from \"../../state/is-movement-allowed\";\nimport useAnnouncer from \"../use-announcer\";\nimport useHiddenTextElement from \"../use-hidden-text-element\";\nimport AppContext, { type AppContextValue } from \"../context/app-context\";\nimport useStartupValidation from \"./use-startup-validation\";\nimport usePrevious from \"../use-previous-ref\";\nimport { warning } from \"../../dev-warning\";\nimport useSensorMarshal from \"../use-sensor-marshal/use-sensor-marshal\";\nimport { isDragging } from \"../../state/reducer\";\n\n// Exact\nexport type Props = Responders & {\n contextId: string,\n setCallbacks: SetAppCallbacks,\n nonce?: string,\n // we do not technically need any children for this component\n children: ReactNode,\n\n // sensors\n sensors?: Sensor[] | null,\n enableDefaultSensors?: boolean | null,\n\n // screen reader\n dragHandleUsageInstructions: string,\n};\n\nconst createResponders = (props: Props): Responders => ({\n onBeforeCapture: props.onBeforeCapture,\n onBeforeDragStart: props.onBeforeDragStart,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragUpdate: props.onDragUpdate,\n});\n\n// flow does not support MutableRefObject\n// type LazyStoreRef = MutableRefObject<?Store>;\ntype LazyStoreRef = { current: Store | null };\n\nfunction getStore(lazyRef: LazyStoreRef): Store {\n invariant(lazyRef.current, \"Could not find store from lazy ref\");\n return lazyRef.current;\n}\n\nexport default function App(props: Props) {\n const {\n contextId,\n setCallbacks,\n sensors,\n nonce,\n dragHandleUsageInstructions,\n } = props;\n const lazyStoreRef: LazyStoreRef = useRef<Store | null>(null);\n\n useStartupValidation();\n\n // lazy collection of responders using a ref - update on ever render\n const lastPropsRef = usePrevious<Props>(props);\n\n const getResponders: () => Responders = useCallback(() => {\n return createResponders(lastPropsRef.current);\n }, [lastPropsRef]);\n\n const announce: Announce = useAnnouncer(contextId);\n\n const dragHandleUsageInstructionsId: ElementId = useHiddenTextElement({\n contextId,\n text: dragHandleUsageInstructions,\n });\n const styleMarshal: StyleMarshal = useStyleMarshal(contextId, nonce);\n\n // const lazyDispatch: (arg: Action) => void = useCallback((action: Action): void => {\n // getStore(lazyStoreRef).dispatch(action);\n // }, []);\n\n // const marshalCallbacks: DimensionMarshalCallbacks = useMemo(\n // () =>\n // bindActionCreators(\n // {\n // publishWhileDragging,\n // updateDroppableScroll,\n // updateDroppableIsEnabled,\n // updateDroppableIsCombineEnabled,\n // collectionStarting,\n // },\n // // $FlowFixMe - not sure why this is wrong\n // lazyDispatch as LazyDispatch, // Changed to LazyDispatch but can have error to fix\n // ),\n // [lazyDispatch],\n // );\n\n const lazyDispatch = useCallback(\n (action: Action) => getStore(lazyStoreRef).dispatch(action),\n [],\n );\n\n const marshalCallbacks: DimensionMarshalCallbacks = useMemo(\n () => ({\n publishWhileDragging: (...args) =>\n lazyDispatch(publishWhileDragging(...args)),\n\n updateDroppableScroll: (...args) =>\n lazyDispatch(updateDroppableScroll(...args)),\n\n updateDroppableIsEnabled: (...args) =>\n lazyDispatch(updateDroppableIsEnabled(...args)),\n\n updateDroppableIsCombineEnabled: (...args) =>\n lazyDispatch(updateDroppableIsCombineEnabled(...args)),\n\n collectionStarting: (...args) =>\n lazyDispatch(collectionStarting(...args)),\n }),\n [lazyDispatch],\n );\n\n const registry: Registry = useRegistry();\n\n const dimensionMarshal: DimensionMarshal = useMemo<DimensionMarshal>(() => {\n return createDimensionMarshal(registry, marshalCallbacks);\n }, [registry, marshalCallbacks]);\n\n // const autoScroller: AutoScroller = useMemo<AutoScroller>(\n // () =>\n // createAutoScroller({\n // scrollWindow,\n // scrollDroppable: dimensionMarshal.scrollDroppable,\n // ...bindActionCreators(\n // {\n // move,\n // },\n // // $FlowFixMe - not sure why this is wrong\n // lazyDispatch,\n // ),\n // }),\n // [dimensionMarshal.scrollDroppable, lazyDispatch],\n // );\n\n const autoScroller: AutoScroller = useMemo(\n () =>\n createAutoScroller({\n scrollWindow,\n scrollDroppable: dimensionMarshal.scrollDroppable,\n move: (...args) => lazyDispatch(move(...args)),\n }),\n [dimensionMarshal.scrollDroppable, lazyDispatch, scrollWindow, move],\n );\n\n const focusMarshal: FocusMarshal = useFocusMarshal(contextId);\n\n const store: Store = useMemo<Store>(\n () =>\n createStore({\n announce,\n autoScroller,\n dimensionMarshal,\n focusMarshal,\n getResponders,\n styleMarshal,\n }),\n [\n announce,\n autoScroller,\n dimensionMarshal,\n focusMarshal,\n getResponders,\n styleMarshal,\n ],\n );\n\n // Checking for unexpected store changes\n if (process.env.NODE_ENV !== \"production\") {\n if (lazyStoreRef.current && lazyStoreRef.current !== store) {\n warning(\"unexpected store change\");\n }\n }\n\n // assigning lazy store ref\n lazyStoreRef.current = store;\n\n const tryResetStore = useCallback(() => {\n const current: Store = getStore(lazyStoreRef);\n const state: State = current.getState();\n if (state.phase !== \"IDLE\") {\n current.dispatch(flush());\n }\n }, []);\n\n // Added Check for isDragging\n const isDraggingState = useCallback((): boolean => {\n const state: State = getStore(lazyStoreRef).getState();\n return isDragging(state) || state.phase === \"DROP_ANIMATING\";\n }, []);\n\n const appCallbacks: AppCallbacks = useMemo(\n () => ({\n isDragging: isDraggingState,\n tryAbort: tryResetStore,\n }),\n [isDraggingState, tryResetStore],\n );\n\n // doing this in render rather than a side effect so any errors on the\n // initial mount are caught\n setCallbacks(appCallbacks);\n\n const getCanLift = useCallback(\n (id: DraggableId) => canStartDrag(getStore(lazyStoreRef).getState(), id),\n [],\n );\n\n const getIsMovementAllowed = useCallback(\n () => isMovementAllowed(getStore(lazyStoreRef).getState()),\n [],\n );\n\n const appContext: AppContextValue = useMemo(\n () => ({\n marshal: dimensionMarshal,\n focus: focusMarshal,\n contextId,\n canLift: getCanLift,\n isMovementAllowed: getIsMovementAllowed,\n dragHandleUsageInstructionsId,\n registry,\n }),\n [\n contextId,\n dimensionMarshal,\n dragHandleUsageInstructionsId,\n focusMarshal,\n getCanLift,\n getIsMovementAllowed,\n registry,\n ],\n );\n\n useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors: sensors,\n // default to 'true' unless 'false' is explicitly passed\n enableDefaultSensors: props.enableDefaultSensors !== false,\n });\n\n // Clean store when unmounting\n useEffect(() => {\n return tryResetStore;\n }, [tryResetStore]);\n\n return (\n <AppContext.Provider value={appContext}>\n <Provider context={StoreContext} store={store}>\n {props.children}\n </Provider>\n </AppContext.Provider>\n );\n}\n","// @flow\nimport { useMemo } from \"@helpdice/memoizer\";\nimport type { ContextId } from \"../../types\";\n\nlet count = 0;\n\nexport function reset() {\n count = 0;\n}\n\nexport default function useInstanceCount(): ContextId {\n return useMemo(() => `${count++}`, []);\n}\n","// @flow\nimport { type ReactNode } from 'react';\nimport type { Responders, ContextId, Sensor } from '../../types';\nimport ErrorBoundary from './error-boundary';\nimport preset from '../../screen-reader-message-preset';\nimport App from './app';\nimport useUniqueContextId, {\n reset as resetContextId,\n} from './use-unique-context-id';\nimport { reset as resetUniqueIds } from '../use-unique-id';\n\n// Exact\ntype Props = Responders & {\n // We do not technically need any children for this component\n children: ReactNode,\n // Read out by screen readers when focusing on a drag handle\n dragHandleUsageInstructions?: string,\n // Used for strict content security policies\n // See our [content security policy guide](/docs/guides/content-security-policy.md)\n nonce?: string,\n // See our [sensor api](/docs/sensors/sensor-api.md)\n sensors?: Sensor[],\n enableDefaultSensors?: boolean | null,\n};\n\n// Reset any context that gets persisted across server side renders\nexport function resetServerContext() {\n resetContextId();\n resetUniqueIds();\n}\n\nexport default function DragDropContext(props: Props) {\n const contextId: ContextId = useUniqueContextId();\n const dragHandleUsageInstructions: string =\n props.dragHandleUsageInstructions || preset.dragHandleUsageInstructions;\n\n // We need the error boundary to be on the outside of App\n // so that it can catch any errors caused by App\n return (\n <ErrorBoundary>\n {(setCallbacks: any) => (\n <App\n nonce={props.nonce}\n contextId={contextId}\n setCallbacks={setCallbacks}\n dragHandleUsageInstructions={dragHandleUsageInstructions}\n enableDefaultSensors={props.enableDefaultSensors}\n sensors={props.sensors}\n onBeforeCapture={props.onBeforeCapture}\n onBeforeDragStart={props.onBeforeDragStart}\n onDragStart={props.onDragStart}\n onDragUpdate={props.onDragUpdate}\n onDragEnd={props.onDragEnd}\n >\n {props.children}\n </App>\n )}\n </ErrorBoundary>\n );\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport { warning } from '../../dev-warning';\nimport getBodyElement from '../get-body-element';\n\n// Exact\ntype Overflow = {\n overflowX: string,\n overflowY: string,\n};\n\nconst isEqual = (base: string) => (value: string): boolean => base === value;\nconst isScroll = isEqual('scroll');\nconst isAuto = isEqual('auto');\nconst isVisible = isEqual('visible');\nconst isEither = (overflow: Overflow, fn: (value: string) => boolean) =>\n fn(overflow.overflowX) || fn(overflow.overflowY);\nconst isBoth = (overflow: Overflow, fn: (value: string) => boolean) =>\n fn(overflow.overflowX) && fn(overflow.overflowY);\n\nconst isElementScrollable = (el: Element): boolean => {\n const style: CSSStyleDeclaration = window.getComputedStyle(el);\n const overflow: Overflow = {\n overflowX: style.overflowX,\n overflowY: style.overflowY,\n };\n\n return isEither(overflow, isScroll) || isEither(overflow, isAuto);\n};\n\n// Special case for a body element\n// Playground: https://codepen.io/alexreardon/pen/ZmyLgX?editors=1111\nconst isBodyScrollable = (): boolean => {\n // Because we always return false for now, we can skip any actual processing in production\n if (process.env.NODE_ENV === 'production') {\n return false;\n }\n\n const body: HTMLElement = getBodyElement(); // HTMLBodyElement\n const html: HTMLElement | null = document.documentElement;\n invariant(html);\n\n // 1. The `body` has `overflow-[x|y]: auto | scroll`\n if (!isElementScrollable(body)) {\n return false;\n }\n\n const htmlStyle: CSSStyleDeclaration = window.getComputedStyle(html);\n const htmlOverflow: Overflow = {\n overflowX: htmlStyle.overflowX,\n overflowY: htmlStyle.overflowY,\n };\n\n if (isBoth(htmlOverflow, isVisible)) {\n return false;\n }\n\n warning(`\n We have detected that your <body> element might be a scroll container.\n We have found no reliable way of detecting whether the <body> element is a scroll container.\n Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)\n\n Because we cannot determine if the <body> is a scroll container, and generally it is not one,\n we will be treating the <body> as *not* a scroll container\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/how-we-detect-scroll-containers.md\n `);\n return false;\n};\n\nconst getClosestScrollable = (el: Element | null): Element | null => {\n // cannot do anything else!\n if (el == null) {\n return null;\n }\n\n // not allowing us to go higher then body\n if (el === document.body) {\n return isBodyScrollable() ? el : null;\n }\n\n // Should never get here, but just being safe\n if (el === document.documentElement) {\n return null;\n }\n\n if (!isElementScrollable(el)) {\n // keep recursing\n return getClosestScrollable(el.parentElement);\n }\n\n // success!\n return el;\n};\n\nexport default getClosestScrollable;\n","// @flow\nimport getClosestScrollable from './get-closest-scrollable';\nimport { warning } from '../../dev-warning';\n\n// We currently do not support nested scroll containers\n// But will hopefully support this soon!\nexport default (scrollable: Element | null) => {\n if (!scrollable) {\n return;\n }\n\n const anotherScrollParent: Element | null = getClosestScrollable(\n scrollable.parentElement,\n );\n\n if (!anotherScrollParent) {\n return;\n }\n\n warning(`\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n `);\n};\n","// @flow\nimport type { Position } from 'css-box-model';\n\nexport default (el: Element): Position => ({\n x: el.scrollLeft,\n y: el.scrollTop,\n});\n","// @flow\nimport getClosestScrollable from './get-closest-scrollable';\n\n// Exact\nexport type Env = {\n closestScrollable: Element | null,\n isFixedOnPage: boolean,\n};\n\n// TODO: do this check at the same time as the closest scrollable\n// in order to avoid double calling getComputedStyle\n// Do this when we move to multiple scroll containers\nconst getIsFixed = (el: Element | null): boolean => {\n if (!el) {\n return false;\n }\n const style: CSSStyleDeclaration = window.getComputedStyle(el);\n if (style.position === 'fixed') {\n return true;\n }\n return getIsFixed(el.parentElement);\n};\n\nexport default (start: Element): Env => {\n const closestScrollable: Element | null = getClosestScrollable(start);\n const isFixedOnPage: boolean = getIsFixed(start);\n\n return {\n closestScrollable,\n isFixedOnPage,\n };\n};\n","// @flow\nimport { type BoxModel, type Position } from 'css-box-model';\nimport type {\n Axis,\n DroppableDimension,\n DroppableDescriptor,\n Scrollable,\n DroppableSubject,\n ScrollSize,\n} from '../../types';\nimport { vertical, horizontal } from '../axis';\nimport { origin } from '../position';\nimport getMaxScroll from '../get-max-scroll';\nimport getSubject from './util/get-subject';\n\n// Exact\nexport type Closest = {\n client: BoxModel,\n page: BoxModel,\n scroll: Position,\n scrollSize: ScrollSize,\n shouldClipSubject: boolean,\n};\n\n// Exact\ntype Args = {\n descriptor: DroppableDescriptor,\n isEnabled: boolean,\n isCombineEnabled?: boolean,\n isFixedOnPage: boolean,\n direction?: 'vertical' | 'horizontal',\n client: BoxModel,\n // is null when in a fixed container\n page: BoxModel,\n closest?: Closest | null,\n};\n\nexport default ({\n descriptor,\n isEnabled,\n isCombineEnabled,\n isFixedOnPage,\n direction,\n client,\n page,\n closest,\n}: Args): DroppableDimension => {\n const frame: Scrollable | null = (() => {\n if (!closest) {\n return null;\n }\n\n const { scrollSize, client: frameClient } = closest;\n\n // scrollHeight and scrollWidth are based on the padding box\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight\n const maxScroll: Position = getMaxScroll({\n scrollHeight: scrollSize.scrollHeight,\n scrollWidth: scrollSize.scrollWidth,\n height: frameClient.paddingBox.height,\n width: frameClient.paddingBox.width,\n });\n\n return {\n pageMarginBox: closest.page.marginBox,\n frameClient,\n scrollSize,\n shouldClipSubject: closest.shouldClipSubject,\n scroll: {\n initial: closest.scroll,\n current: closest.scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin,\n },\n },\n };\n })();\n\n const axis: Axis = direction === 'vertical' ? vertical : horizontal;\n\n const subject: DroppableSubject = getSubject({\n page,\n withPlaceholder: null,\n axis,\n frame,\n });\n\n const dimension: DroppableDimension = {\n descriptor,\n isCombineEnabled,\n isFixedOnPage,\n axis,\n isEnabled,\n client,\n page,\n frame,\n subject,\n };\n\n return dimension;\n};\n","// @flow\nimport {\n getBox,\n withScroll,\n createBox,\n expand,\n type BoxModel,\n type Position,\n type Spacing,\n} from 'css-box-model';\nimport getDroppableDimension, {\n type Closest,\n} from '../../state/droppable/get-droppable';\nimport type { Env } from './get-env';\nimport type {\n DroppableDimension,\n DroppableDescriptor,\n Direction,\n ScrollSize,\n} from '../../types';\nimport getScroll from './get-scroll';\n\nconst getClient = (\n targetRef: HTMLElement,\n closestScrollable: Element | null,\n): BoxModel => {\n const base: BoxModel = getBox(targetRef);\n\n // Droppable has no scroll parent\n if (!closestScrollable) {\n return base;\n }\n\n // Droppable is not the same as the closest scrollable\n if (targetRef !== closestScrollable) {\n return base;\n }\n\n // Droppable is scrollable\n\n // Element.getBoundingClient() returns a clipped padding box:\n // When not scrollable: the full size of the element\n // When scrollable: the visible size of the element\n // (which is not the full width of its scrollable content)\n // So we recalculate the borderBox of a scrollable droppable to give\n // it its full dimensions. This will be cut to the correct size by the frame\n\n // Creating the paddingBox based on scrollWidth / scrollTop\n // scrollWidth / scrollHeight are based on the paddingBox of an element\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight\n const top: number = base.paddingBox.top - closestScrollable.scrollTop;\n const left: number = base.paddingBox.left - closestScrollable.scrollLeft;\n const bottom: number = top + closestScrollable.scrollHeight;\n const right: number = left + closestScrollable.scrollWidth;\n\n // unclipped padding box\n const paddingBox: Spacing = {\n top,\n right,\n bottom,\n left,\n };\n\n // Creating the borderBox by adding the borders to the paddingBox\n const borderBox: Spacing = expand(paddingBox, base.border);\n\n // We are not accounting for scrollbars\n // Adjusting for scrollbars is hard because:\n // - they are different between browsers\n // - scrollbars can be activated and removed during a drag\n // We instead account for this slightly in our auto scroller\n\n const client: BoxModel = createBox({\n borderBox,\n margin: base.margin,\n border: base.border,\n padding: base.padding,\n });\n return client;\n};\n\n// Exact\ntype Args = {\n ref: HTMLElement,\n descriptor: DroppableDescriptor,\n env: Env,\n windowScroll: Position,\n direction?: Direction,\n isDropDisabled?: boolean,\n isCombineEnabled?: boolean,\n shouldClipSubject: boolean,\n};\n\nexport default ({\n ref,\n descriptor,\n env,\n windowScroll,\n direction,\n isDropDisabled,\n isCombineEnabled,\n shouldClipSubject,\n}: Args): DroppableDimension => {\n const closestScrollable: Element | null = env.closestScrollable;\n const client: BoxModel = getClient(ref, closestScrollable);\n const page: BoxModel = withScroll(client, windowScroll);\n\n const closest: Closest | null = (() => {\n if (!closestScrollable) {\n return null;\n }\n\n const frameClient: BoxModel = getBox(closestScrollable);\n const scrollSize: ScrollSize = {\n scrollHeight: closestScrollable.scrollHeight,\n scrollWidth: closestScrollable.scrollWidth,\n };\n\n return {\n client: frameClient,\n page: withScroll(frameClient, windowScroll),\n scroll: getScroll(closestScrollable),\n scrollSize,\n shouldClipSubject,\n };\n })();\n\n const dimension: DroppableDimension = getDroppableDimension({\n descriptor,\n isEnabled: !isDropDisabled,\n isCombineEnabled,\n isFixedOnPage: env.isFixedOnPage,\n direction,\n client,\n page,\n closest,\n });\n\n return dimension;\n};\n","// @flow\nimport type { ScrollOptions } from '../../types';\n\nconst immediate = {\n passive: false,\n};\nconst delayed = {\n passive: true,\n};\n\nexport default (options: ScrollOptions) =>\n options.shouldPublishImmediately ? immediate : delayed;\n","// @flow\n// import { useContext, type Context as ContextType } from 'react';\n// import { invariant } from '../invariant';\n\n// export default function useRequiredContext<T>(Context: ContextType<?T>): T {\n// const result: ?T = useContext(Context);\n// invariant(result, 'Could not find required context');\n// return result;\n// }\n\nimport { useContext, type Context } from 'react';\nimport { invariant } from '../invariant';\n\nexport default function useRequiredContext<T>(\n Context: Context<T | null>,\n): T { // Removed Null\n const result: T | null = useContext(Context);\n\n invariant(result, 'Could not find required context');\n\n return result;\n}","// @flow\nimport { useRef } from \"react\";\nimport { type Position } from \"css-box-model\";\nimport rafSchedule from \"raf-schd\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport memoizeOne from \"memoize-one\";\nimport { invariant } from \"../../invariant\";\nimport checkForNestedScrollContainers from \"./check-for-nested-scroll-container\";\nimport * as dataAttr from \"../data-attributes\";\nimport { origin } from \"../../state/position\";\nimport getScroll from \"./get-scroll\";\nimport type {\n DroppableEntry,\n DroppableCallbacks,\n} from \"../../state/registry/registry-types\";\nimport getEnv, { type Env } from \"./get-env\";\nimport type {\n Id,\n DroppableId,\n TypeId,\n DroppableDimension,\n DroppableDescriptor,\n Direction,\n ScrollOptions,\n DroppableMode,\n} from \"../../types\";\nimport getDimension from \"./get-dimension\";\nimport AppContext, { type AppContextValue } from \"../context/app-context\";\nimport { warning } from \"../../dev-warning\";\nimport getListenerOptions from \"./get-listener-options\";\nimport useRequiredContext from \"../use-required-context\";\nimport usePreviousRef from \"../use-previous-ref\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport useUniqueId from \"../use-unique-id\";\n\n// Exact\ntype Props = {\n droppableId: DroppableId,\n type?: TypeId,\n mode?: DroppableMode,\n direction?: Direction,\n isDropDisabled?: boolean,\n isCombineEnabled?: boolean,\n ignoreContainerClipping?: boolean,\n getDroppableRef?: () => HTMLElement | null,\n};\n\n// Exact\ntype WhileDragging = {\n ref: HTMLElement,\n descriptor: DroppableDescriptor,\n env: Env,\n scrollOptions: ScrollOptions,\n};\n\nconst getClosestScrollableFromDrag = (dragging: WhileDragging | null): Element | null =>\n (dragging && dragging.env.closestScrollable) || null;\n\nexport default function useDroppablePublisher(args: Props) {\n const whileDraggingRef = useRef<WhileDragging | null>(null);\n const appContext: AppContextValue = useRequiredContext(AppContext);\n const uniqueId: Id = useUniqueId(\"droppable\");\n const { registry, marshal } = appContext;\n const previousRef = usePreviousRef(args);\n\n const descriptor = useMemo<DroppableDescriptor>(\n () => ({\n id: args.droppableId,\n type: args.type ?? \"\",\n mode: args.mode ?? \"standard\", // By default\n }),\n [args.droppableId, args.mode, args.type],\n );\n const publishedDescriptorRef = useRef<DroppableDescriptor>(descriptor);\n\n const memoizedUpdateScroll = useMemo(\n () =>\n memoizeOne((x: number, y: number) => {\n invariant(\n whileDraggingRef.current,\n \"Can only update scroll when dragging\",\n );\n const scroll: Position = { x, y };\n marshal.updateDroppableScroll(descriptor.id, scroll);\n }),\n [descriptor.id, marshal],\n );\n\n const getClosestScroll = useCallback((): Position => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n if (!dragging || !dragging.env.closestScrollable) {\n return origin;\n }\n\n return getScroll(dragging.env.closestScrollable);\n }, []);\n\n const updateScroll = useCallback(() => {\n // reading scroll value when called so value will be the latest\n const scroll: Position = getClosestScroll();\n memoizedUpdateScroll(scroll.x, scroll.y);\n }, [getClosestScroll, memoizedUpdateScroll]);\n\n const scheduleScrollUpdate = useMemo(\n () => rafSchedule(updateScroll),\n [updateScroll],\n );\n\n const onClosestScroll = useCallback(() => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n\n invariant(\n dragging && closest,\n \"Could not find scroll options while scrolling\",\n );\n const options: ScrollOptions = dragging.scrollOptions;\n if (options.shouldPublishImmediately) {\n updateScroll();\n return;\n }\n scheduleScrollUpdate();\n }, [scheduleScrollUpdate, updateScroll]);\n\n const getDimensionAndWatchScroll = useCallback(\n (windowScroll: Position, options: ScrollOptions) => {\n invariant(\n !whileDraggingRef.current,\n \"Cannot collect a droppable while a drag is occurring\",\n );\n const previous: Props = previousRef.current;\n const ref: HTMLElement | null = previous.getDroppableRef ? previous.getDroppableRef() : null;\n invariant(ref, \"Cannot collect without a droppable ref\");\n const env: Env = getEnv(ref);\n\n const dragging: WhileDragging = {\n ref,\n descriptor,\n env,\n scrollOptions: options,\n };\n // side effect\n whileDraggingRef.current = dragging;\n\n const dimension: DroppableDimension = getDimension({\n ref,\n descriptor,\n env,\n windowScroll,\n direction: previous.direction,\n isDropDisabled: previous.isDropDisabled,\n isCombineEnabled: previous.isCombineEnabled,\n shouldClipSubject: !previous.ignoreContainerClipping,\n });\n\n const scrollable: Element | null = env.closestScrollable;\n\n if (scrollable) {\n scrollable.setAttribute(\n dataAttr.scrollContainer.contextId,\n appContext.contextId,\n );\n\n // bind scroll listener\n scrollable.addEventListener(\n \"scroll\",\n onClosestScroll,\n getListenerOptions(dragging.scrollOptions),\n );\n // print a debug warning if using an unsupported nested scroll container setup\n if (process.env.NODE_ENV !== \"production\") {\n checkForNestedScrollContainers(scrollable);\n }\n }\n\n return dimension;\n },\n [appContext.contextId, descriptor, onClosestScroll, previousRef],\n );\n\n const getScrollWhileDragging = useCallback((): Position => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n invariant(\n dragging && closest,\n \"Can only recollect Droppable client for Droppables that have a scroll container\",\n );\n\n return getScroll(closest);\n }, []);\n\n const dragStopped = useCallback(() => {\n const dragging: WhileDragging | null = whileDraggingRef.current;\n invariant(dragging, \"Cannot stop drag when no active drag\");\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n\n // goodbye old friend\n whileDraggingRef.current = null;\n\n if (!closest) {\n return;\n }\n\n // unwatch scroll\n scheduleScrollUpdate.cancel();\n closest.removeAttribute(dataAttr.scrollContainer.contextId);\n const listenerOptions: AddEventListenerOptions = \n getListenerOptions(dragging.scrollOptions);\n closest.removeEventListener(\n \"scroll\",\n onClosestScroll,\n listenerOptions,\n );\n }, [onClosestScroll, scheduleScrollUpdate]);\n\n const scroll = useCallback((change: Position) => {\n // arrange\n const dragging: WhileDragging | null = whileDraggingRef.current;\n invariant(dragging, \"Cannot scroll when there is no drag\");\n const closest: Element | null = getClosestScrollableFromDrag(dragging);\n invariant(closest, \"Cannot scroll a droppable with no closest scrollable\");\n\n // act\n closest.scrollTop += change.y;\n closest.scrollLeft += change.x;\n }, []);\n\n const callbacks: DroppableCallbacks = useMemo(() => {\n return {\n getDimensionAndWatchScroll,\n getScrollWhileDragging,\n dragStopped,\n scroll,\n };\n }, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);\n\n const entry: DroppableEntry = useMemo(\n () => ({\n uniqueId,\n descriptor,\n callbacks,\n }),\n [callbacks, descriptor, uniqueId],\n );\n\n // Register with the marshal and let it know of:\n // - any descriptor changes\n // - when it unmounts\n useLayoutEffect(() => {\n publishedDescriptorRef.current = entry.descriptor;\n registry.droppable.register(entry);\n\n return () => {\n if (whileDraggingRef.current) {\n warning(\n \"Unsupported: changing the droppableId or type of a Droppable during a drag\",\n );\n dragStopped();\n }\n\n registry.droppable.unregister(entry);\n };\n }, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);\n\n // update is enabled with the marshal\n // only need to update when there is a drag\n useLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsEnabled(\n publishedDescriptorRef.current.id,\n !args.isDropDisabled,\n );\n }, [args.isDropDisabled, marshal]);\n\n // update is combine enabled with the marshal\n // only need to update when there is a drag\n useLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsCombineEnabled(\n publishedDescriptorRef.current.id,\n args.isCombineEnabled ?? false, // by default\n );\n }, [args.isCombineEnabled, marshal]);\n}\n","// @flow\nimport React, { useState, useRef, useEffect, type ReactNode } from \"react\";\nimport { useCallback } from \"@helpdice/memoizer\";\nimport type { Spacing } from \"css-box-model\";\nimport type {\n Placeholder as PlaceholderType,\n InOutAnimationMode,\n ContextId,\n TimeoutID,\n} from \"../../types\";\nimport { transitions } from \"../../animation\";\nimport { noSpacing } from \"../../state/spacing\";\n\nfunction noop() {}\n\n// Exact\nexport type PlaceholderStyle = {\n display: string,\n boxSizing: \"border-box\",\n width: number,\n height: number,\n marginTop: number,\n marginRight: number,\n marginBottom: number,\n marginLeft: number,\n flexShrink: \"0\",\n flexGrow: \"0\",\n pointerEvents: \"none\",\n transition: string | null,\n};\n\n// Exact\nexport type Props = {\n placeholder: PlaceholderType,\n animate: InOutAnimationMode,\n onClose: () => void,\n innerRef: (value: HTMLElement | null) => void,\n onTransitionEnd: () => void,\n contextId: ContextId,\n};\n\n// Exact\ntype Size = {\n width: number,\n height: number,\n // Need to animate in/out animation as well as size\n margin: Spacing,\n};\n\n// Exact\ntype HelperArgs = {\n isAnimatingOpenOnMount: boolean,\n placeholder: PlaceholderType,\n animate: InOutAnimationMode,\n};\n\nconst empty: Size = {\n width: 0,\n height: 0,\n margin: noSpacing,\n};\n\nconst getSize = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate,\n}: HelperArgs): Size => {\n if (isAnimatingOpenOnMount) {\n return empty;\n }\n\n if (animate === \"close\") {\n return empty;\n }\n\n return {\n height: placeholder.client.borderBox.height,\n width: placeholder.client.borderBox.width,\n margin: placeholder.client.margin,\n };\n};\n\nconst getStyle = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate,\n}: HelperArgs): PlaceholderStyle => {\n const size: Size = getSize({ isAnimatingOpenOnMount, placeholder, animate });\n\n return {\n display: placeholder.display,\n // ## Recreating the box model\n // We created the borderBox and then apply the margins directly\n // this is to maintain any margin collapsing behaviour\n\n // creating borderBox\n // background: 'green',\n boxSizing: \"border-box\",\n width: size.width,\n height: size.height,\n // creating marginBox\n marginTop: size.margin.top,\n marginRight: size.margin.right,\n marginBottom: size.margin.bottom,\n marginLeft: size.margin.left,\n\n // ## Avoiding collapsing\n // Avoiding the collapsing or growing of this element when pushed by flex child siblings.\n // We have already taken a snapshot the current dimensions we do not want this element\n // to recalculate its dimensions\n // It is okay for these properties to be applied on elements that are not flex children\n flexShrink: \"0\",\n flexGrow: \"0\",\n // Just a little performance optimisation: avoiding the browser needing\n // to worry about pointer events for this element\n pointerEvents: \"none\",\n\n // Animate the placeholder size and margin\n transition: animate !== \"none\" ? transitions.placeholder : null,\n };\n};\n\nfunction Placeholder(props: Props): ReactNode {\n const animateOpenTimerRef = useRef<TimeoutID | null>(null);\n\n const tryClearAnimateOpenTimer = useCallback(() => {\n if (!animateOpenTimerRef.current) {\n return;\n }\n clearTimeout(animateOpenTimerRef.current);\n animateOpenTimerRef.current = null;\n }, []);\n\n const { animate, onTransitionEnd, onClose, contextId } = props;\n const [isAnimatingOpenOnMount, setIsAnimatingOpenOnMount] = useState<boolean>(\n props.animate === \"open\",\n );\n\n // Will run after a render is flushed\n // Still need to wait a timeout to ensure that the\n // update is completely applied to the DOM\n useEffect(() => {\n // No need to do anything\n if (!isAnimatingOpenOnMount) {\n return noop;\n }\n\n // might need to clear the timer\n if (animate !== \"open\") {\n tryClearAnimateOpenTimer();\n setIsAnimatingOpenOnMount(false);\n return noop;\n }\n\n // timer already pending\n if (animateOpenTimerRef.current) {\n return noop;\n }\n\n animateOpenTimerRef.current = setTimeout(() => {\n animateOpenTimerRef.current = null;\n setIsAnimatingOpenOnMount(false);\n });\n\n // clear the timer if needed\n return tryClearAnimateOpenTimer;\n }, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);\n\n const onSizeChangeEnd = useCallback(\n (event: TransitionEvent) => {\n // We transition height, width and margin\n // each of those transitions will independently call this callback\n // Because they all have the same duration we can just respond to one of them\n // 'height' was chosen for no particular reason :D\n if (event.propertyName !== \"height\") {\n return;\n }\n\n onTransitionEnd();\n\n if (animate === \"close\") {\n onClose();\n }\n },\n [animate, onClose, onTransitionEnd],\n );\n\n const style: PlaceholderStyle = getStyle({\n isAnimatingOpenOnMount,\n animate: props.animate,\n placeholder: props.placeholder,\n });\n\n return React.createElement(props.placeholder.tagName, {\n style,\n \"data-rbd-placeholder-context-id\": contextId,\n onTransitionEnd: onSizeChangeEnd,\n ref: props.innerRef,\n });\n}\n\nexport default React.memo<Props>(Placeholder);\n// enzyme does not work well with memo, so exporting the non-memo version\nexport const WithoutMemo = Placeholder;\n","// @flow\nimport React from 'react';\nimport type { DraggableId, DroppableId, TypeId } from '../../types';\n\n// Exact\nexport type DroppableContextValue = {\n isUsingCloneFor?: DraggableId | null,\n droppableId: DroppableId,\n type?: TypeId,\n};\n\nexport default React.createContext<DroppableContextValue | null>(null);\n","// @flow\nimport { invariant } from '../invariant';\nimport isHtmlElement from './is-type-of-element/is-html-element';\n\nexport default function checkIsValidInnerRef(el: HTMLElement | null) {\n invariant(\n el && isHtmlElement(el),\n `\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md\n `,\n );\n}\n","// @flow\nimport { invariant } from '../../invariant';\nimport type { Props } from './droppable-types';\nimport { warning } from '../../dev-warning';\nimport checkIsValidInnerRef from '../check-is-valid-inner-ref';\nimport useDevSetupWarning from '../use-dev-setup-warning';\n\n// Exact\ntype Args = {\n props: Props,\n getDroppableRef: () => HTMLElement | null,\n getPlaceholderRef: () => HTMLElement | null,\n};\n\ntype CheckFn = (args: Args) => void;\n\nfunction isBoolean(value: unknown): boolean {\n return typeof value === 'boolean';\n}\n\nfunction runChecks(args: Args, checks: CheckFn[]) {\n checks.forEach((check: CheckFn) => check(args));\n}\n\nconst shared: CheckFn[] = [\n function required({ props }: Args) {\n invariant(props.droppableId, 'A Droppable requires a droppableId prop');\n invariant(\n typeof props.droppableId === 'string',\n `A Droppable requires a [string] droppableId. Provided: [${typeof props.droppableId}]`,\n );\n },\n function boolean({ props }: Args) {\n invariant(\n isBoolean(props.isDropDisabled),\n 'isDropDisabled must be a boolean',\n );\n invariant(\n isBoolean(props.isCombineEnabled),\n 'isCombineEnabled must be a boolean',\n );\n invariant(\n isBoolean(props.ignoreContainerClipping),\n 'ignoreContainerClipping must be a boolean',\n );\n },\n function ref({ getDroppableRef }: Args) {\n checkIsValidInnerRef(getDroppableRef());\n },\n];\n\nconst standard: CheckFn[] = [\n function placeholder({ props, getPlaceholderRef }: Args) {\n if (!props.placeholder) {\n return;\n }\n\n const ref: HTMLElement | null = getPlaceholderRef();\n\n if (ref) {\n return;\n }\n\n warning(`\n Droppable setup issue [droppableId: \"${props.droppableId}\"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/droppable.md\n `);\n },\n];\n\nconst virtual: CheckFn[] = [\n function hasClone({ props }: Args) {\n invariant(\n props.renderClone,\n 'Must provide a clone render function (renderClone) for virtual lists',\n );\n },\n function hasNoPlaceholder({ getPlaceholderRef }: Args) {\n invariant(\n !getPlaceholderRef(),\n 'Expected virtual list to not have a placeholder',\n );\n },\n];\n\nexport default function useValidation(args: Args) {\n useDevSetupWarning(() => {\n // wrapping entire block for better minification\n runChecks(args, shared);\n\n if (args.props.mode === 'standard') {\n runChecks(args, standard);\n }\n\n if (args.props.mode === 'virtual') {\n runChecks(args, virtual);\n }\n });\n}\n","// @flow\nimport React, { type ReactNode } from 'react';\nimport type { InOutAnimationMode } from '../../types';\n\n// Exact\nexport type AnimateProvided = {\n onClose: () => void,\n animate: InOutAnimationMode,\n data: unknown,\n};\n\n// Exact\ntype Props = {\n on: unknown,\n shouldAnimate: boolean,\n children: (provided: AnimateProvided) => ReactNode,\n};\n\n// Exact\ntype State = {\n data: unknown,\n isVisible: boolean,\n animate: InOutAnimationMode,\n};\n\n// Using a class here rather than hooks because\n// getDerivedStateFromProps results in far less renders.\n// Using hooks to implement this was quite messy and resulted in lots of additional renders\n\nexport default class AnimateInOut extends React.PureComponent<Props, State> {\n state: State = {\n isVisible: Boolean(this.props.on),\n data: this.props.on,\n // not allowing to animate close on mount\n animate: this.props.shouldAnimate && this.props.on ? 'open' : 'none',\n };\n\n static getDerivedStateFromProps(props: Props, state: State): State {\n if (!props.shouldAnimate) {\n return {\n isVisible: Boolean(props.on),\n data: props.on,\n animate: 'none',\n };\n }\n\n // need to animate in\n if (props.on) {\n return {\n isVisible: true,\n // have new data to animate in with\n data: props.on,\n animate: 'open',\n };\n }\n\n // need to animate out if there was data\n\n if (state.isVisible) {\n return {\n isVisible: true,\n // use old data for animating out\n data: state.data,\n animate: 'close',\n };\n }\n\n // close animation no longer visible\n return {\n isVisible: false,\n animate: 'close',\n data: null,\n };\n }\n\n onClose = () => {\n if (this.state.animate !== 'close') {\n return;\n }\n\n this.setState({\n isVisible: false,\n });\n };\n\n render() {\n if (!this.state.isVisible) {\n return null;\n }\n\n const provided: AnimateProvided = {\n onClose: this.onClose,\n data: this.state.data,\n animate: this.state.animate,\n };\n return this.props.children(provided);\n }\n}\n","// @flow\nimport type { BoxModel } from 'css-box-model';\nimport { combine, transforms, transitions } from '../../animation';\nimport type { DraggableDimension } from '../../types';\nimport type {\n DraggingStyle,\n NotDraggingStyle,\n ZIndexOptions,\n DropAnimation,\n SecondaryMapProps,\n DraggingMapProps,\n DraggableStyle,\n MappedProps,\n} from './draggable-types';\n\nexport const zIndexOptions: ZIndexOptions = {\n dragging: 5000,\n dropAnimating: 4500,\n};\n\nconst getDraggingTransition = (\n shouldAnimateDragMovement: boolean,\n dropping: DropAnimation | null,\n): string => {\n if (dropping) {\n return transitions.drop(dropping.duration);\n }\n if (shouldAnimateDragMovement) {\n return transitions.snap;\n }\n return transitions.fluid;\n};\n\nconst getDraggingOpacity = (\n isCombining: boolean,\n isDropAnimating: boolean,\n): number | null => {\n // if not combining: no not impact opacity\n if (!isCombining) {\n return null;\n }\n\n return isDropAnimating ? combine.opacity.drop : combine.opacity.combining;\n};\n\nconst getShouldDraggingAnimate = (dragging: DraggingMapProps): boolean => {\n if (dragging.forceShouldAnimate != null) {\n return dragging.forceShouldAnimate;\n }\n return dragging.mode === 'SNAP';\n};\n\nfunction getDraggingStyle(dragging: DraggingMapProps): DraggingStyle {\n const dimension: DraggableDimension = dragging.dimension;\n const box: BoxModel = dimension.client;\n const { offset, combineWith, dropping } = dragging;\n\n const isCombining: boolean = Boolean(combineWith);\n\n const shouldAnimate: boolean = getShouldDraggingAnimate(dragging);\n const isDropAnimating: boolean = Boolean(dropping);\n\n const transform: string | null = isDropAnimating\n ? transforms.drop(offset, isCombining)\n : transforms.moveTo(offset);\n\n const style: DraggingStyle = {\n // ## Placement\n position: 'fixed',\n // As we are applying the margins we need to align to the start of the marginBox\n top: box.marginBox.top,\n left: box.marginBox.left,\n\n // ## Sizing\n // Locking these down as pulling the node out of the DOM could cause it to change size\n boxSizing: 'border-box',\n width: box.borderBox.width,\n height: box.borderBox.height,\n\n // ## Movement\n // Opting out of the standard css transition for the dragging item\n transition: getDraggingTransition(shouldAnimate, dropping),\n transform,\n opacity: getDraggingOpacity(isCombining, isDropAnimating),\n // ## Layering\n zIndex: isDropAnimating\n ? zIndexOptions.dropAnimating\n : zIndexOptions.dragging,\n\n // ## Blocking any pointer events on the dragging or dropping item\n // global styles on cover while dragging\n pointerEvents: 'none',\n };\n return style;\n}\n\nfunction getSecondaryStyle(secondary: SecondaryMapProps): NotDraggingStyle {\n return {\n transform: transforms.moveTo(secondary.offset),\n // transition style is applied in the head\n transition: secondary.shouldAnimateDisplacement ? null : 'none',\n };\n}\n\nexport default function getStyle(mapped: MappedProps): DraggableStyle {\n return mapped.type === 'DRAGGING'\n ? getDraggingStyle(mapped)\n : getSecondaryStyle(mapped);\n}\n","// @flow\nimport {\n type BoxModel,\n type Position,\n calculateBox,\n withScroll,\n} from 'css-box-model';\nimport type {\n DraggableDescriptor,\n DraggableDimension,\n Placeholder,\n} from '../../types';\nimport { origin } from '../../state/position';\n\nexport default function getDimension(\n descriptor: DraggableDescriptor,\n el: HTMLElement,\n windowScroll: Position = origin,\n): DraggableDimension {\n const computedStyles: CSSStyleDeclaration = window.getComputedStyle(el);\n const borderBox: ClientRect = el.getBoundingClientRect();\n const client: BoxModel = calculateBox(borderBox, computedStyles);\n const page: BoxModel = withScroll(client, windowScroll);\n\n const placeholder: Placeholder = {\n client,\n tagName: el.tagName.toLowerCase(),\n display: computedStyles.display,\n };\n const displaceBy: Position = {\n x: client.marginBox.width,\n y: client.marginBox.height,\n };\n\n const dimension: DraggableDimension = {\n descriptor,\n placeholder,\n displaceBy,\n client,\n page,\n };\n\n return dimension;\n}\n","// @flow\nimport { type Position } from \"css-box-model\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { useRef } from \"react\";\nimport { invariant } from \"../../invariant\";\nimport type {\n DraggableDescriptor,\n DraggableDimension,\n Id,\n DraggableOptions,\n} from \"../../types\";\nimport type {\n Registry,\n DraggableEntry,\n} from \"../../state/registry/registry-types\";\nimport makeDimension from \"./get-dimension\";\nimport useLayoutEffect from \"../use-isomorphic-layout-effect\";\nimport useUniqueId from \"../use-unique-id\";\n\n// Exact\nexport type Args = {\n descriptor: DraggableDescriptor,\n getDraggableRef: () => HTMLElement | null,\n registry: Registry,\n} & DraggableOptions;\n\nexport default function useDraggablePublisher(args: Args) {\n const uniqueId: Id = useUniqueId(\"draggable\");\n\n const {\n descriptor,\n registry,\n getDraggableRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n } = args;\n\n const options: DraggableOptions = useMemo(\n () => ({\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n }),\n [canDragInteractiveElements, isEnabled, shouldRespectForcePress],\n );\n\n const getDimension = useCallback(\n (windowScroll?: Position): DraggableDimension => {\n const el: HTMLElement | null = getDraggableRef();\n invariant(el, \"Cannot get dimension when no ref is set\");\n return makeDimension(descriptor, el, windowScroll);\n },\n [descriptor, getDraggableRef],\n );\n\n const entry: DraggableEntry = useMemo(\n () => ({\n uniqueId,\n descriptor,\n options,\n getDimension,\n }),\n [descriptor, getDimension, options, uniqueId],\n );\n\n const publishedRef = useRef<DraggableEntry>(entry);\n const isFirstPublishRef = useRef<boolean>(true);\n\n // mounting and unmounting\n useLayoutEffect(() => {\n registry.draggable.register(publishedRef.current);\n return () => registry.draggable.unregister(publishedRef.current);\n }, [registry.draggable]);\n\n // updates while mounted\n useLayoutEffect(() => {\n if (isFirstPublishRef.current) {\n isFirstPublishRef.current = false;\n return;\n }\n\n const last: DraggableEntry = publishedRef.current;\n publishedRef.current = entry;\n registry.draggable.update(entry, last);\n }, [entry, registry.draggable]);\n}\n","// @flow\nimport { useRef } from 'react';\nimport { invariant } from '../../invariant';\nimport { isInteger } from '../../native-with-fallback';\nimport type { DraggableId, ContextId } from '../../types';\nimport type { Props } from './draggable-types';\nimport checkIsValidInnerRef from '../check-is-valid-inner-ref';\nimport findDragHandle from '../get-elements/find-drag-handle';\nimport useDevSetupWarning from '../use-dev-setup-warning';\nimport useDev from '../use-dev';\n\nexport function useValidation(\n props: Props,\n contextId: ContextId,\n getRef: () => HTMLElement | null,\n) {\n // running after every update in development\n useDevSetupWarning(() => {\n function prefix(id: DraggableId): string {\n return `Draggable[id: ${id}]: `;\n }\n\n // wrapping entire block for better minification\n const id: DraggableId | null = props.draggableId;\n invariant(id, 'Draggable requires a draggableId');\n invariant(\n typeof id === 'string',\n `Draggable requires a [string] draggableId.\n Provided: [type: ${typeof id}] (value: ${id})`,\n );\n\n invariant(\n isInteger(props.index),\n `${prefix(id)} requires an integer index prop`,\n );\n\n if (props.mapped.type === 'DRAGGING') {\n return;\n }\n\n // Checking provided ref (only when not dragging as it might be removed)\n checkIsValidInnerRef(getRef());\n\n // Checking that drag handle is provided\n // Only running check when enabled.\n // When not enabled there is no drag handle props\n if (props.isEnabled) {\n invariant(\n findDragHandle(contextId, id),\n `${prefix(id)} Unable to find drag handle`,\n );\n }\n });\n}\n\n// we expect isClone not to change for entire component's life\nexport function useClonePropValidation(isClone: boolean) {\n useDev(() => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const initialRef = useRef<boolean>(isClone);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useDevSetupWarning(() => {\n invariant(\n isClone === initialRef.current,\n 'Draggable isClone prop value changed during component life',\n );\n }, [isClone]);\n });\n}\n","// @flow\nimport { useRef } from \"react\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport type { DraggableRubric, DraggableDescriptor } from \"../../types\";\nimport getStyle from \"./get-style\";\nimport useDraggablePublisher, {\n type Args as PublisherArgs,\n} from \"../use-draggable-publisher/use-draggable-publisher\";\nimport AppContext from \"../context/app-context\";\nimport DroppableContext from \"../context/droppable-context\";\nimport type {\n Props,\n Provided,\n DraggableStyle,\n DragHandleProps,\n} from \"./draggable-types\";\nimport { useValidation, useClonePropValidation } from \"./use-validation\";\nimport useRequiredContext from \"../use-required-context\";\n\nfunction preventHtml5Dnd(event: DragEvent) {\n event.preventDefault();\n}\n\nexport default function Draggable(props: Props) {\n // reference to DOM node\n const ref = useRef<HTMLElement | null>(null);\n const setRef = useCallback((el: HTMLElement | null) => {\n ref.current = el;\n }, []);\n const getRef = useCallback((): HTMLElement | null => ref.current, []);\n\n // context\n const { contextId, dragHandleUsageInstructionsId, registry } = useRequiredContext(AppContext);\n const { type, droppableId } = useRequiredContext(DroppableContext);\n\n const descriptor: DraggableDescriptor = useMemo(\n () => ({\n id: props.draggableId,\n index: props.index,\n type: type ?? \"\", // Empty by default Marked for review\n droppableId,\n }),\n [props.draggableId, props.index, type, droppableId],\n );\n\n // props\n const {\n // ownProps\n children,\n draggableId,\n isEnabled,\n shouldRespectForcePress,\n canDragInteractiveElements,\n isClone,\n\n // mapProps\n mapped,\n\n // dispatchProps\n dropAnimationFinished: dropAnimationFinishedAction,\n } = props;\n\n // Validating props and innerRef\n useValidation(props, contextId, getRef);\n\n // Clones do not speak to the dimension marshal\n // We are violating the rules of hooks here: conditional hooks.\n // In this specific use case it is okay as an item will always either be a\n // clone or not for it's whole lifecycle\n /* eslint-disable react-hooks/rules-of-hooks */\n\n // Being super sure that isClone is not changing during a draggable lifecycle\n useClonePropValidation(isClone);\n if (!isClone) {\n const forPublisher: PublisherArgs = useMemo(\n () => ({\n descriptor,\n registry,\n getDraggableRef: getRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n }),\n [\n descriptor,\n registry,\n getRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled,\n ],\n );\n useDraggablePublisher(forPublisher);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const dragHandleProps: DragHandleProps | null = useMemo(\n () =>\n isEnabled\n ? {\n // See `draggable-types` for an explanation of why these are used\n tabIndex: 0,\n role: \"button\",\n \"aria-describedby\": dragHandleUsageInstructionsId,\n \"data-rbd-drag-handle-draggable-id\": draggableId,\n \"data-rbd-drag-handle-context-id\": contextId,\n draggable: false,\n onDragStart: preventHtml5Dnd,\n }\n : null,\n [contextId, dragHandleUsageInstructionsId, draggableId, isEnabled],\n );\n\n const onMoveEnd = useCallback(\n (event: TransitionEvent) => {\n if (mapped.type !== \"DRAGGING\") {\n return;\n }\n\n if (!mapped.dropping) {\n return;\n }\n\n // There might be other properties on the element that are\n // being transitioned. We do not want those to end a drop animation!\n if (event.propertyName !== \"transform\") {\n return;\n }\n\n dropAnimationFinishedAction();\n },\n [dropAnimationFinishedAction, mapped],\n );\n\n const provided: Provided = useMemo(() => {\n const style: DraggableStyle = getStyle(mapped);\n const onTransitionEnd =\n mapped.type === \"DRAGGING\" && mapped.dropping ? onMoveEnd : null;\n\n const result: Provided = {\n innerRef: setRef,\n draggableProps: {\n \"data-rbd-draggable-context-id\": contextId,\n \"data-rbd-draggable-id\": draggableId,\n style,\n onTransitionEnd,\n },\n dragHandleProps,\n };\n\n return result;\n }, [contextId, dragHandleProps, draggableId, mapped, onMoveEnd, setRef]);\n\n const rubric: DraggableRubric = useMemo(\n () => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId,\n },\n }),\n [descriptor.droppableId, descriptor.id, descriptor.index, descriptor.type],\n );\n\n return children(provided, mapped.snapshot, rubric);\n}\n","// @flow\nimport type { DroppableId, DropResult } from '../../types';\n\nexport default (result: DropResult): DroppableId | null => {\n const { combine, destination } = result;\n\n if (destination) {\n return destination.droppableId;\n }\n\n if (combine) {\n return combine.droppableId;\n }\n\n return null;\n};\n","import {\r\n createDispatchHook,\r\n createSelectorHook,\r\n createStoreHook,\r\n} from 'react-redux';\r\n\r\n// import type { Dispatch } from 'redux';\r\nimport type { State, Action } from '../../state/store-types';\r\n\r\nimport StoreContext from './store-context';\r\n\r\nexport const useAppDispatch = createDispatchHook<\r\n State,\r\n Action\r\n>(StoreContext);\r\n\r\nexport const useAppSelector = createSelectorHook(\r\n StoreContext,\r\n);\r\n\r\nexport const useAppStore = createStoreHook(StoreContext);","// @flow Marked for Review\nimport { type Position } from 'css-box-model';\n// eslint-disable-next-line\n// import { Component } from 'react';\nimport memoizeOne from 'memoize-one';\n// import { connect } from 'react-redux';\nimport Draggable from './draggable';\nimport { origin, negate } from '../../state/position';\n// import isStrictEqual from '../is-strict-equal';\nimport * as animation from '../../animation';\nimport { dropAnimationFinished as dropAnimationFinishedAction } from '../../state/action-creators';\nimport type {\n State,\n DraggableId,\n DroppableId,\n DraggableDimension,\n Displacement,\n CompletedDrag,\n DragImpact,\n MovementMode,\n DropResult,\n LiftEffect,\n Combine,\n} from '../../types';\nimport type {\n MapProps,\n OwnProps,\n // DispatchProps,\n Selector,\n StateSnapshot,\n DropAnimation,\n} from './draggable-types';\nimport whatIsDraggedOver from '../../state/droppable/what-is-dragged-over';\n// import StoreContext from '../context/store-context';\nimport whatIsDraggedOverFromResult from '../../state/droppable/what-is-dragged-over-from-result';\nimport { tryGetCombine } from '../../state/get-impact-location';\nimport { isDragging } from '../../state/reducer';\nimport { useCallback, useMemo } from '@helpdice/memoizer';\nimport React from 'react';\nimport { useAppDispatch, useAppSelector } from '../context/hooks';\n\nconst getCombineWithFromResult = (result: DropResult): DraggableId | null => {\n return result.combine ? result.combine.draggableId : null;\n};\n\nconst getCombineWithFromImpact = (impact: DragImpact): DraggableId | null => {\n return impact.at && impact.at.type === 'COMBINE'\n ? impact.at.combine.draggableId\n : null;\n};\n\ntype TrySelect = (state: State, ownProps: OwnProps) => MapProps | null;\n\nfunction getDraggableSelector(): TrySelect {\n const memoizedOffset = memoizeOne((x: number, y: number): Position => ({\n x,\n y,\n }));\n\n const getMemoizedSnapshot = memoizeOne(\n (\n mode: MovementMode,\n isClone: boolean,\n draggingOver: DroppableId | null,\n combineWith: DraggableId | null,\n dropping: DropAnimation | null,\n ): StateSnapshot => ({\n isDragging: true,\n isClone,\n isDropAnimating: Boolean(dropping),\n dropAnimation: dropping,\n mode,\n draggingOver,\n combineWith,\n combineTargetFor: null,\n }),\n );\n\n const getMemoizedProps = memoizeOne((\n offset: Position,\n mode: MovementMode,\n dimension: DraggableDimension,\n isClone: boolean,\n // the id of the droppable you are over\n draggingOver: DroppableId | null,\n // the id of a draggable you are grouping with\n combineWith: DraggableId | null,\n forceShouldAnimate: boolean | null,\n ): MapProps => ({\n mapped: {\n type: 'DRAGGING',\n dropping: null,\n draggingOver,\n combineWith,\n mode,\n offset,\n dimension,\n forceShouldAnimate,\n snapshot: getMemoizedSnapshot(\n mode,\n isClone,\n draggingOver,\n combineWith,\n null,\n ),\n },\n }));\n\n const selector: TrySelect = (state: State, ownProps: OwnProps): MapProps | null => {\n // Dragging Marked for Review\n if (isDragging(state)) {\n // not the dragging item\n if (state.critical.draggable.id !== ownProps.draggableId) {\n return null;\n }\n\n const offset: Position = state.current.client.offset;\n const dimension: DraggableDimension =\n state.dimensions.draggables[ownProps.draggableId];\n // const shouldAnimateDragMovement: boolean = state.shouldAnimate;\n const draggingOver: DroppableId | null = whatIsDraggedOver(state.impact);\n const combineWith: DraggableId | null = getCombineWithFromImpact(state.impact);\n const forceShouldAnimate: boolean | null = state.forceShouldAnimate;\n\n return getMemoizedProps(\n memoizedOffset(offset.x, offset.y),\n state.movementMode,\n dimension,\n ownProps.isClone,\n draggingOver,\n combineWith,\n forceShouldAnimate,\n );\n }\n\n // Dropping\n if (state.phase === 'DROP_ANIMATING') {\n const completed: CompletedDrag = state.completed;\n if (completed.result.draggableId !== ownProps.draggableId) {\n return null;\n }\n\n const isClone: boolean = ownProps.isClone;\n const dimension: DraggableDimension =\n state.dimensions.draggables[ownProps.draggableId];\n const result: DropResult = completed.result;\n const mode: MovementMode = result.mode;\n // these need to be pulled from the result as they can be different to the final impact\n const draggingOver: DroppableId | null = whatIsDraggedOverFromResult(result);\n const combineWith: DraggableId | null = getCombineWithFromResult(result);\n const duration: number = state.dropDuration;\n\n // not memoized as it is the only execution\n const dropping: DropAnimation = {\n duration,\n curve: animation.curves.drop,\n moveTo: state.newHomeClientOffset,\n opacity: combineWith ? animation.combine.opacity.drop : null,\n scale: combineWith ? animation.combine.scale.drop : null,\n };\n\n return {\n mapped: {\n type: 'DRAGGING',\n offset: state.newHomeClientOffset,\n dimension,\n dropping,\n draggingOver,\n combineWith,\n mode,\n forceShouldAnimate: null,\n snapshot: getMemoizedSnapshot(\n mode,\n isClone,\n draggingOver,\n combineWith,\n dropping,\n ),\n },\n };\n }\n\n return null;\n };\n\n return selector;\n}\n\nfunction getSecondarySnapshot(combineTargetFor: DraggableId | null): StateSnapshot {\n return {\n isDragging: false,\n isDropAnimating: false,\n isClone: false,\n dropAnimation: null,\n mode: null,\n draggingOver: null,\n combineTargetFor,\n combineWith: null,\n };\n}\n\nconst atRest: MapProps = {\n mapped: {\n type: 'SECONDARY',\n offset: origin,\n combineTargetFor: null,\n shouldAnimateDisplacement: true,\n snapshot: getSecondarySnapshot(null),\n },\n};\n\nfunction getSecondarySelector(): TrySelect {\n const memoizedOffset = memoizeOne((x: number, y: number): Position => ({\n x,\n y,\n }));\n\n const getMemoizedSnapshot = memoizeOne(getSecondarySnapshot);\n\n const getMemoizedProps = memoizeOne(\n (\n offset: Position,\n combineTargetFor: DraggableId | null = null,\n shouldAnimateDisplacement: boolean,\n ): MapProps => ({\n mapped: {\n type: 'SECONDARY',\n offset,\n combineTargetFor,\n shouldAnimateDisplacement,\n snapshot: getMemoizedSnapshot(combineTargetFor),\n },\n }),\n );\n\n // Is we are the combine target for something then we need to publish that\n // otherwise we will return null to get the default props\n const getFallback = (combineTargetFor: DraggableId | null): MapProps | null => {\n return combineTargetFor\n ? getMemoizedProps(origin, combineTargetFor, true)\n : null;\n };\n\n const getProps = (\n ownId: DraggableId,\n draggingId: DraggableId,\n impact: DragImpact,\n afterCritical: LiftEffect,\n ): MapProps | null => {\n const visualDisplacement: Displacement | null = impact.displaced.visible[ownId];\n const isAfterCriticalInVirtualList: boolean = Boolean(\n afterCritical.inVirtualList && afterCritical.effected[ownId],\n );\n\n const combine: Combine | null = tryGetCombine(impact);\n const combineTargetFor: DraggableId | null =\n combine && combine.draggableId === ownId ? draggingId : null;\n\n if (!visualDisplacement) {\n if (!isAfterCriticalInVirtualList) {\n return getFallback(combineTargetFor);\n }\n\n // After critical but not visibly displaced in a virtual list\n // This can occur if:\n // 1. the item is not visible (displaced.invisible)\n // 2. We have moved out of the home list.\n\n // Don't need to do anything - item is invisible\n if (impact.displaced.invisible[ownId]) {\n return null;\n }\n\n // We are no longer over the home list.\n // We need to move backwards to close the gap that the dragging item has left\n const change: Position = negate(afterCritical.displacedBy.point);\n const offset: Position = memoizedOffset(change.x, change.y);\n return getMemoizedProps(offset, combineTargetFor, true);\n }\n\n if (isAfterCriticalInVirtualList) {\n // In a virtual list the removal of a dragging item does\n // not cause the list to collapse. So when something is 'displaced'\n // we can just leave it in the original spot.\n return getFallback(combineTargetFor);\n }\n const displaceBy: Position = impact.displacedBy.point;\n const offset: Position = memoizedOffset(displaceBy.x, displaceBy.y);\n\n return getMemoizedProps(\n offset,\n combineTargetFor,\n visualDisplacement.shouldAnimate,\n );\n };\n\n const selector: TrySelect = (state: State, ownProps: OwnProps): MapProps | null => {\n // Dragging Marked for Review\n if (isDragging(state)) {\n // we do not care about the dragging item\n if (state.critical.draggable.id === ownProps.draggableId) {\n return null;\n }\n\n return getProps(\n ownProps.draggableId,\n state.critical.draggable.id,\n state.impact,\n state.afterCritical,\n );\n }\n\n // Dropping\n if (state.phase === 'DROP_ANIMATING') {\n const completed: CompletedDrag = state.completed;\n // do nothing if this was the dragging item\n if (completed.result.draggableId === ownProps.draggableId) {\n return null;\n }\n return getProps(\n ownProps.draggableId,\n completed.result.draggableId,\n completed.impact,\n completed.afterCritical,\n );\n }\n\n // Otherwise\n return null;\n };\n\n return selector;\n}\n\n// Returning a function to ensure each\n// Draggable gets its own selector\nexport const makeMapStateToProps = (): Selector => {\n const draggingSelector: TrySelect = getDraggableSelector();\n const secondarySelector: TrySelect = getSecondarySelector();\n\n const selector = (state: State, ownProps: OwnProps): MapProps =>\n draggingSelector(state, ownProps) ||\n secondarySelector(state, ownProps) ||\n atRest;\n\n return selector;\n};\n\n// const mapDispatchToProps: DispatchProps = {\n// dropAnimationFinished: dropAnimationFinishedAction,\n// };\n\n// Leaning heavily on the default shallow equality checking\n// that `connect` provides.\n// It avoids needing to do it own within `<Draggable />`\n// const ConnectedDraggable = connect(\n// // returning a function so each component can do its own memoization\n// makeMapStateToProps,\n// mapDispatchToProps,\n// // mergeProps: use default\n// null,\n// // options\n// // $FlowFixMe: current react-redux type does not know about context property\n// {\n// // Using our own context for the store to avoid clashing with consumers\n// context: StoreContext,\n// // Default value, but being really clear\n// pure: true,\n// // When pure, compares the result of mapStateToProps to its previous value.\n// // Default value: shallowEqual\n// // Switching to a strictEqual as we return a memoized object on changes\n// areStatePropsEqual: isStrictEqual,\n// },\n// )(Draggable);\n\nconst DraggableWithRedux = (props: OwnProps) => {\n const dispatch = useAppDispatch();\n\n const selector = useMemo(\n () => makeMapStateToProps(),\n [],\n );\n\n const stateProps = useAppSelector((state: State) =>\n selector(state, props),\n );\n\n // const dispatchProps = useMemo(\n // () => mapDispatchToProps(dispatch, props),\n // [dispatch, props],\n // );\n\n // const dispatchProps = useMemo(\n // () => bindActionCreators(mapDispatchToProps, dispatch),\n // [dispatch],\n // );\n\n const dropAnimationFinished = useCallback(\n () => dispatch(dropAnimationFinishedAction()),\n [dispatch],\n );\n\n // return (\n // <Draggable\n // { ...props }\n // {...stateProps }\n // {...dispatchProps }\n // />\n // );\n\n return <Draggable\n {...props}\n {...stateProps}\n dropAnimationFinished={dropAnimationFinished}\n />;\n};\n\nexport default React.memo(DraggableWithRedux);\n\n// export default ConnectedDraggable;\n","// @flow\n// import React from 'react';\nimport type { DraggableId } from '../../types';\nimport type { PublicOwnProps, PrivateOwnProps } from './draggable-types';\nimport ConnectedDraggable from './connected-draggable';\nimport useRequiredContext from '../use-required-context';\nimport DroppableContext, {\n type DroppableContextValue,\n} from '../context/droppable-context';\n\n// We can use this to render a draggable with more control\n// It is used by a Droppable to render a clone\nexport function PrivateDraggable(props: PrivateOwnProps) {\n const droppableContext: DroppableContextValue | null = useRequiredContext(\n DroppableContext,\n );\n // The droppable can render a clone of the draggable item.\n // In that case we unmount the existing dragging item\n const isUsingCloneFor: DraggableId | null | undefined = droppableContext?.isUsingCloneFor;\n if (isUsingCloneFor === props.draggableId && !props.isClone) {\n return null;\n }\n\n return <ConnectedDraggable {...props} />;\n}\n\n// What we give to consumers\nexport function PublicDraggable(props: PublicOwnProps) {\n // default values for props\n const isEnabled: boolean =\n typeof props.isDragDisabled === 'boolean' ? !props.isDragDisabled : true;\n const canDragInteractiveElements: boolean = Boolean(\n props.disableInteractiveElementBlocking,\n );\n const shouldRespectForcePress: boolean = Boolean(\n props.shouldRespectForcePress,\n );\n\n return (\n <PrivateDraggable\n {...props}\n isClone={false}\n isEnabled={isEnabled}\n canDragInteractiveElements={canDragInteractiveElements}\n shouldRespectForcePress={shouldRespectForcePress}\n />\n );\n}\n","// @flow\nimport ReactDOM from \"react-dom\";\nimport { useMemo, useCallback } from \"@helpdice/memoizer\";\nimport { useRef, useContext, type ReactNode } from \"react\";\nimport { invariant } from \"../../invariant\";\nimport type { DraggableId } from \"../../types\";\nimport type { Props, Provided } from \"./droppable-types\";\nimport useDroppablePublisher from \"../use-droppable-publisher\";\nimport Placeholder from \"../placeholder\";\nimport AppContext, { type AppContextValue } from \"../context/app-context\";\nimport DroppableContext, {\n type DroppableContextValue,\n} from \"../context/droppable-context\";\n// import useAnimateInOut from '../use-animate-in-out/use-animate-in-out';\nimport getMaxWindowScroll from \"../window/get-max-window-scroll\";\nimport useValidation from \"./use-validation\";\nimport type {\n StateSnapshot as DraggableStateSnapshot,\n Provided as DraggableProvided,\n} from \"../draggable/draggable-types\";\nimport AnimateInOut, {\n type AnimateProvided,\n} from \"../animate-in-out/animate-in-out\";\nimport { PrivateDraggable } from \"../draggable/draggable-api\";\n\nexport default function Droppable(props: Props) {\n const appContext: AppContextValue | null = useContext<AppContextValue | null>(AppContext);\n invariant(appContext, \"Could not find app context\");\n const { contextId, isMovementAllowed } = appContext;\n const droppableRef = useRef<HTMLElement | null>(null);\n const placeholderRef = useRef<HTMLElement | null>(null);\n\n const {\n // own props\n children,\n droppableId,\n type,\n mode,\n direction,\n ignoreContainerClipping,\n isDropDisabled,\n isCombineEnabled,\n // map props\n snapshot,\n useClone,\n // dispatch props\n updateViewportMaxScroll,\n\n // clone (ownProps)\n getContainerForClone,\n } = props;\n\n const getDroppableRef = useCallback(\n (): HTMLElement | null => droppableRef.current,\n [],\n );\n const setDroppableRef = useCallback((value: HTMLElement | null) => {\n droppableRef.current = value;\n }, []);\n const getPlaceholderRef = useCallback(\n (): HTMLElement | null => placeholderRef.current,\n [],\n );\n const setPlaceholderRef = useCallback((value: HTMLElement | null) => {\n placeholderRef.current = value;\n }, []);\n\n useValidation({\n props,\n getDroppableRef,\n getPlaceholderRef,\n });\n\n const onPlaceholderTransitionEnd = useCallback(() => {\n // A placeholder change can impact the window's max scroll\n if (isMovementAllowed()) {\n updateViewportMaxScroll({ maxScroll: getMaxWindowScroll() });\n }\n }, [isMovementAllowed, updateViewportMaxScroll]);\n\n useDroppablePublisher({\n droppableId,\n type,\n mode,\n direction,\n isDropDisabled,\n isCombineEnabled,\n ignoreContainerClipping,\n getDroppableRef,\n });\n\n const placeholder: ReactNode = (\n <AnimateInOut\n on={props.placeholder}\n shouldAnimate={props.shouldAnimatePlaceholder}\n >\n {({ onClose, data, animate }: AnimateProvided) => (\n <Placeholder\n placeholder={data as any}\n onClose={onClose}\n innerRef={setPlaceholderRef}\n animate={animate}\n contextId={contextId}\n onTransitionEnd={onPlaceholderTransitionEnd}\n />\n )}\n </AnimateInOut>\n );\n\n const provided: Provided = useMemo(\n (): Provided => ({\n innerRef: setDroppableRef,\n placeholder,\n droppableProps: {\n \"data-rbd-droppable-id\": droppableId,\n \"data-rbd-droppable-context-id\": contextId,\n },\n }),\n [contextId, droppableId, placeholder, setDroppableRef],\n );\n\n const isUsingCloneFor: DraggableId | null = useClone\n ? useClone.dragging.draggableId\n : null;\n\n const droppableContext: DroppableContextValue | null = useMemo(\n () => ({\n droppableId,\n type,\n isUsingCloneFor,\n }),\n [droppableId, isUsingCloneFor, type],\n );\n\n function getClone(): ReactNode {\n if (!useClone) {\n return null;\n }\n const { dragging, render } = useClone;\n\n const node: ReactNode = (\n <PrivateDraggable\n draggableId={dragging.draggableId}\n index={dragging.source.index}\n isClone\n isEnabled\n // not important as drag has already started\n shouldRespectForcePress={false}\n canDragInteractiveElements\n >\n {(\n draggableProvided: DraggableProvided,\n draggableSnapshot: DraggableStateSnapshot,\n ) => render(draggableProvided, draggableSnapshot, dragging)}\n </PrivateDraggable>\n );\n\n if (!getContainerForClone) return null;\n\n return ReactDOM.createPortal(node, getContainerForClone());\n }\n\n return (\n <DroppableContext.Provider value={droppableContext}>\n {children(provided, snapshot)}\n {getClone()}\n </DroppableContext.Provider>\n );\n}\n","// @flow\n// eslint-disable-next-line no-unused-vars\n\nimport { memo, useMemo, useCallback } from 'react';\nimport memoizeOne from 'memoize-one';\n\nimport { invariant } from '../../invariant';\n\nimport type {\n State,\n DroppableId,\n DraggableId,\n CompletedDrag,\n DraggableDimension,\n DimensionMap,\n TypeId,\n Critical,\n DraggableRubric,\n DraggableDescriptor,\n} from '../../types';\n\nimport type {\n MapProps,\n OwnProps,\n DefaultProps,\n Selector,\n StateSnapshot,\n UseClone,\n DraggableChildrenFn,\n} from './droppable-types';\n\nimport Droppable from './droppable';\n\nimport whatIsDraggedOver from '../../state/droppable/what-is-dragged-over';\nimport whatIsDraggedOverFromResult from '../../state/droppable/what-is-dragged-over-from-result';\n\nimport {\n updateViewportMaxScroll as updateViewportMaxScrollAction,\n} from '../../state/action-creators';\n\nimport { isDragging } from '../../state/reducer';\n\nimport {\n useAppDispatch,\n useAppSelector,\n} from '../context/hooks';\n\n// -----------------------------------------------------------------------------\n// Helpers\n// -----------------------------------------------------------------------------\n\nconst isMatchingType = (\n type: TypeId,\n critical: Critical,\n): boolean => type === critical.droppable.type;\n\nconst getDraggable = (\n critical: Critical,\n dimensions: DimensionMap,\n): DraggableDimension =>\n dimensions.draggables[critical.draggable.id];\n\n// -----------------------------------------------------------------------------\n// Selector\n// -----------------------------------------------------------------------------\n\nexport const makeMapStateToProps = (): Selector => {\n const idleWithAnimation: MapProps = {\n placeholder: null,\n shouldAnimatePlaceholder: true,\n snapshot: {\n isDraggingOver: false,\n draggingOverWith: null,\n draggingFromThisWith: null,\n isUsingPlaceholder: false,\n },\n useClone: null,\n };\n\n const idleWithoutAnimation: MapProps = {\n ...idleWithAnimation,\n shouldAnimatePlaceholder: false,\n };\n\n const getDraggableRubric = memoizeOne(\n (descriptor: DraggableDescriptor): DraggableRubric => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId,\n },\n }),\n );\n\n const getMapProps = memoizeOne(\n (\n id: DroppableId,\n isEnabled: boolean,\n isDraggingOverForConsumer: boolean,\n isDraggingOverForImpact: boolean,\n dragging: DraggableDimension,\n renderClone: DraggableChildrenFn | null,\n ): MapProps => {\n const draggableId: DraggableId = dragging.descriptor.id;\n const isHome: boolean =\n dragging.descriptor.droppableId === id;\n\n if (isHome) {\n const useClone: UseClone | null = renderClone\n ? {\n render: renderClone,\n dragging: getDraggableRubric(dragging.descriptor),\n }\n : null;\n\n const snapshot: StateSnapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: isDraggingOverForConsumer\n ? draggableId\n : null,\n draggingFromThisWith: draggableId,\n isUsingPlaceholder: true,\n };\n\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: false,\n snapshot,\n useClone,\n };\n }\n\n if (!isEnabled) {\n return idleWithoutAnimation;\n }\n\n if (!isDraggingOverForImpact) {\n return idleWithAnimation;\n }\n\n const snapshot: StateSnapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: draggableId,\n draggingFromThisWith: null,\n isUsingPlaceholder: true,\n };\n\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: true,\n snapshot,\n useClone: null,\n };\n },\n );\n\n const selector: Selector = (\n state: State,\n ownProps: OwnProps,\n ): MapProps => {\n const id: DroppableId = ownProps.droppableId;\n const type: TypeId | undefined = ownProps.type;\n const isEnabled: boolean = !ownProps.isDropDisabled;\n const renderClone: DraggableChildrenFn | null =\n ownProps.renderClone;\n\n if (isDragging(state)) {\n const critical: Critical = state.critical;\n\n if (type && !isMatchingType(type, critical)) {\n return idleWithoutAnimation;\n }\n\n const dragging: DraggableDimension = getDraggable(\n critical,\n state.dimensions,\n );\n\n const isDraggingOver: boolean =\n whatIsDraggedOver(state.impact) === id;\n\n return getMapProps(\n id,\n isEnabled,\n isDraggingOver,\n isDraggingOver,\n dragging,\n renderClone,\n );\n }\n\n if (state.phase === 'DROP_ANIMATING') {\n const completed: CompletedDrag = state.completed;\n\n if (type && !isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n\n const dragging: DraggableDimension = getDraggable(\n completed.critical,\n state.dimensions,\n );\n\n return getMapProps(\n id,\n isEnabled,\n whatIsDraggedOverFromResult(completed.result) === id,\n whatIsDraggedOver(completed.impact) === id,\n dragging,\n renderClone,\n );\n }\n\n if (\n state.phase === 'IDLE' &&\n state.completed &&\n !state.shouldFlush\n ) {\n const completed: CompletedDrag = state.completed;\n\n if (type && !isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n\n const wasOver: boolean =\n whatIsDraggedOver(completed.impact) === id;\n\n const wasCombining: boolean = Boolean(\n completed.impact.at &&\n completed.impact.at.type === 'COMBINE',\n );\n\n const isHome: boolean =\n completed.critical.droppable.id === id;\n\n if (wasOver) {\n return wasCombining\n ? idleWithAnimation\n : idleWithoutAnimation;\n }\n\n if (isHome) {\n return idleWithAnimation;\n }\n\n return idleWithoutAnimation;\n }\n\n return idleWithoutAnimation;\n };\n\n return selector;\n};\n\n// -----------------------------------------------------------------------------\n// Default props\n// -----------------------------------------------------------------------------\n\nfunction getBody(): HTMLElement {\n invariant(document.body, 'document.body is not ready');\n return document.body;\n}\n\nconst defaultProps: DefaultProps = {\n mode: 'standard',\n type: 'DEFAULT',\n direction: 'vertical',\n isDropDisabled: false,\n isCombineEnabled: false,\n ignoreContainerClipping: false,\n renderClone: null,\n getContainerForClone: getBody,\n};\n\n// -----------------------------------------------------------------------------\n// Connected Droppable using hooks\n// -----------------------------------------------------------------------------\n\nconst ConnectedDroppable = (props: OwnProps) => {\n const mergedProps = {\n ...defaultProps,\n ...props,\n } as OwnProps;\n\n // Each Droppable gets its own memoized selector\n const selector = useMemo(\n () => makeMapStateToProps(),\n [],\n );\n\n const mapped: MapProps = useAppSelector(\n (state: State) => selector(state, mergedProps),\n );\n\n const dispatch = useAppDispatch();\n\n const updateViewportMaxScroll = useCallback(\n (...args: Parameters<typeof updateViewportMaxScrollAction>) =>\n dispatch(updateViewportMaxScrollAction(...args)),\n [dispatch],\n );\n\n return (\n <Droppable\n {...mergedProps}\n {...mapped}\n updateViewportMaxScroll={updateViewportMaxScroll}\n />\n );\n};\n\nConnectedDroppable.displayName = 'ConnectedDroppable';\n\nexport default memo(ConnectedDroppable);\n\n\n\n// import { Component } from 'react';\n// import { connect } from 'react-redux';\n// import memoizeOne from 'memoize-one';\n// import { invariant } from '../../invariant';\n// import type {\n// State,\n// DroppableId,\n// DraggableId,\n// CompletedDrag,\n// DraggableDimension,\n// DimensionMap,\n// TypeId,\n// Critical,\n// DraggableRubric,\n// DraggableDescriptor,\n// } from '../../types';\n// import type {\n// MapProps,\n// OwnProps,\n// DefaultProps,\n// Selector,\n// DispatchProps,\n// StateSnapshot,\n// UseClone,\n// DraggableChildrenFn,\n// } from './droppable-types';\n// import Droppable from './droppable';\n// import isStrictEqual from '../is-strict-equal';\n// import whatIsDraggedOver from '../../state/droppable/what-is-dragged-over';\n// import { updateViewportMaxScroll as updateViewportMaxScrollAction } from '../../state/action-creators';\n// import StoreContext from '../context/store-context';\n// import whatIsDraggedOverFromResult from '../../state/droppable/what-is-dragged-over-from-result';\n// import { isDragging } from '../../state/reducer';\n\n// const isMatchingType = (type: TypeId, critical: Critical): boolean =>\n// type === critical.droppable.type;\n\n// const getDraggable = (\n// critical: Critical,\n// dimensions: DimensionMap,\n// ): DraggableDimension => dimensions.draggables[critical.draggable.id];\n\n// // Returning a function to ensure each\n// // Droppable gets its own selector\n// export const makeMapStateToProps = (): Selector => {\n// const idleWithAnimation: MapProps = {\n// placeholder: null,\n// shouldAnimatePlaceholder: true,\n// snapshot: {\n// isDraggingOver: false,\n// draggingOverWith: null,\n// draggingFromThisWith: null,\n// isUsingPlaceholder: false,\n// },\n// useClone: null,\n// };\n\n// const idleWithoutAnimation = {\n// ...idleWithAnimation,\n// shouldAnimatePlaceholder: false,\n// };\n\n// const getDraggableRubric = memoizeOne(\n// (descriptor: DraggableDescriptor): DraggableRubric => ({\n// draggableId: descriptor.id,\n// type: descriptor.type,\n// source: {\n// index: descriptor.index,\n// droppableId: descriptor.droppableId,\n// },\n// }),\n// );\n\n// const getMapProps = memoizeOne(\n// (\n// id: DroppableId,\n// isEnabled: boolean,\n// isDraggingOverForConsumer: boolean,\n// isDraggingOverForImpact: boolean,\n// dragging: DraggableDimension,\n// // snapshot: StateSnapshot,\n// renderClone: ?DraggableChildrenFn,\n// ): MapProps => {\n// const draggableId: DraggableId = dragging.descriptor.id;\n// const isHome: boolean = dragging.descriptor.droppableId === id;\n\n// if (isHome) {\n// const useClone: ?UseClone = renderClone\n// ? {\n// render: renderClone,\n// dragging: getDraggableRubric(dragging.descriptor),\n// }\n// : null;\n\n// const snapshot: StateSnapshot = {\n// isDraggingOver: isDraggingOverForConsumer,\n// draggingOverWith: isDraggingOverForConsumer ? draggableId : null,\n// draggingFromThisWith: draggableId,\n// isUsingPlaceholder: true,\n// };\n\n// return {\n// placeholder: dragging.placeholder,\n// shouldAnimatePlaceholder: false,\n// snapshot,\n// useClone,\n// };\n// }\n\n// if (!isEnabled) {\n// return idleWithoutAnimation;\n// }\n\n// // not over foreign list - return idle\n// if (!isDraggingOverForImpact) {\n// return idleWithAnimation;\n// }\n\n// const snapshot: StateSnapshot = {\n// isDraggingOver: isDraggingOverForConsumer,\n// draggingOverWith: draggableId,\n// draggingFromThisWith: null,\n// isUsingPlaceholder: true,\n// };\n\n// return {\n// placeholder: dragging.placeholder,\n// // Animating placeholder in foreign list\n// shouldAnimatePlaceholder: true,\n// snapshot,\n// useClone: null,\n// };\n// },\n// );\n\n// const selector = (state: State, ownProps: OwnProps): MapProps => {\n// // not checking if item is disabled as we need the home list to display a placeholder\n\n// const id: DroppableId = ownProps.droppableId;\n// const type: TypeId = ownProps.type;\n// const isEnabled: boolean = !ownProps.isDropDisabled;\n// const renderClone: ?DraggableChildrenFn = ownProps.renderClone;\n\n// if (isDragging(state)) { // Marked for Review state.isDragging\n// const critical: Critical = state.critical;\n// if (!isMatchingType(type, critical)) {\n// return idleWithoutAnimation;\n// }\n\n// const dragging: DraggableDimension = getDraggable(\n// critical,\n// state.dimensions,\n// );\n// const isDraggingOver: boolean = whatIsDraggedOver(state.impact) === id;\n\n// return getMapProps(\n// id,\n// isEnabled,\n// isDraggingOver,\n// isDraggingOver,\n// dragging,\n// renderClone,\n// );\n// }\n\n// if (state.phase === 'DROP_ANIMATING') {\n// const completed: CompletedDrag = state.completed;\n// if (!isMatchingType(type, completed.critical)) {\n// return idleWithoutAnimation;\n// }\n\n// const dragging: DraggableDimension = getDraggable(\n// completed.critical,\n// state.dimensions,\n// );\n\n// // Snapshot based on result and not impact\n// // The result might be null (cancel) but the impact is populated\n// // to move everything back\n// return getMapProps(\n// id,\n// isEnabled,\n// whatIsDraggedOverFromResult(completed.result) === id,\n// whatIsDraggedOver(completed.impact) === id,\n// dragging,\n// renderClone,\n// );\n// }\n\n// if (state.phase === 'IDLE' && state.completed && !state.shouldFlush) {\n// const completed: CompletedDrag = state.completed;\n// if (!isMatchingType(type, completed.critical)) {\n// return idleWithoutAnimation;\n// }\n\n// // Looking at impact as this controls the placeholder\n// const wasOver: boolean = whatIsDraggedOver(completed.impact) === id;\n// const wasCombining: boolean = Boolean(\n// completed.impact.at && completed.impact.at.type === 'COMBINE',\n// );\n// const isHome: boolean = completed.critical.droppable.id === id;\n\n// if (wasOver) {\n// // if reordering we need to cut an animation immediately\n// // if merging: animate placeholder closed after drop\n// return wasCombining ? idleWithAnimation : idleWithoutAnimation;\n// }\n\n// // we need to animate the home placeholder closed if it is not\n// // being dropped into\n// if (isHome) {\n// return idleWithAnimation;\n// }\n\n// return idleWithoutAnimation;\n// }\n\n// // default: including when flushed\n// return idleWithoutAnimation;\n// };\n\n// return selector;\n// };\n\n// const mapDispatchToProps: DispatchProps = {\n// updateViewportMaxScroll: updateViewportMaxScrollAction,\n// };\n\n// function getBody(): HTMLElement {\n// invariant(document.body, 'document.body is not ready');\n// return document.body;\n// }\n\n// const defaultProps = ({\n// mode: 'standard',\n// type: 'DEFAULT',\n// direction: 'vertical',\n// isDropDisabled: false,\n// isCombineEnabled: false,\n// ignoreContainerClipping: false,\n// renderClone: null,\n// getContainerForClone: getBody,\n// }: DefaultProps);\n\n// // Abstract class allows to specify props and defaults to component.\n// // All other ways give any or do not let add default props.\n// // eslint-disable-next-line\n// /*::\n// class DroppableType extends Component<OwnProps> {\n// static defaultProps = defaultProps;\n// }\n// */\n\n// // Leaning heavily on the default shallow equality checking\n// // that `connect` provides.\n// // It avoids needing to do it own within `Droppable`\n// const ConnectedDroppable: typeof DroppableType = connect(\n// // returning a function so each component can do its own memoization\n// makeMapStateToProps,\n// // no dispatch props for droppable\n// mapDispatchToProps,\n// // mergeProps - using default\n// null,\n// // $FlowFixMe: current react-redux type does not know about context property\n// {\n// // Ensuring our context does not clash with consumers\n// context: StoreContext,\n// // pure: true is default value, but being really clear\n// pure: true,\n// // When pure, compares the result of mapStateToProps to its previous value.\n// // Default value: shallowEqual\n// // Switching to a strictEqual as we return a memoized object on changes\n// areStatePropsEqual: isStrictEqual,\n// },\n// )(Droppable);\n\n// ConnectedDroppable.defaultProps = defaultProps;\n\n// export default ConnectedDroppable;\n"],"names":["React","require$$0","jsxRuntimeModule","require$$1","isProduction","clean","noop","prefix","invariant","withSelectorModule","useIsomorphicLayoutEffect","useSyncExternalStoreWithSelector","areInputsEqual","useState","useRef","useEffect","createStore","isEqual","closest","noSpacing","getWindowScroll","scroll","isVisible","getDraggables","getPageBorderBoxCenter","getDroppableOver","didStartAfterCritical","getDidStartAfterCritical","recomputeDisplacementVisibility","offset","offsetBox","timings.start","timings.finish","idle","lift","drop","distance","getDistance","messagePreset","getScroll","start","dragHandle","attributes.dragHandle","draggable","attributes.draggable","droppable","attributes.droppable","useLayoutEffect","getStyles","dragHandleAttr","count","reset","keyCodes.enter","keyCodes.tab","keyCodes.escape","supportedPageVisibilityEventName","keyCodes.pageDown","keyCodes.pageUp","keyCodes.home","keyCodes.end","keyCodes.space","keyCodes.arrowDown","keyCodes.arrowUp","keyCodes.arrowRight","keyCodes.arrowLeft","usePreviousRef","liftAction","dropAction","move","moveAction","moveUpAction","moveRightAction","moveDownAction","moveLeftAction","findClosestDraggableIdFromEvent","_jsx","resetContextId","resetUniqueIds","useUniqueContextId","useContext","rafSchedule","getDimension","dataAttr.scrollContainer","getStyle","useValidation","makeDimension","animation.curves","animation.combine","makeMapStateToProps","dropAnimationFinished","dropAnimationFinishedAction","Placeholder","_jsxs","useMemo","updateViewportMaxScroll","useCallback","updateViewportMaxScrollAction","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,CAAA,IAAI,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC;AACjE,GAAE,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;AACpD,CAAA,SAAS,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;GACvC,IAAI,GAAG,GAAG,IAAI;GACd,MAAM,KAAK,QAAQ,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC;AAC9C,GAAE,MAAM,KAAK,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,CAAC,OAAO;AAC7B,QAAA,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;QACrB,MAAM;AACP,KAAA,CAAC;AACJ,CAAC;AAGD;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;ACjTA,4BAAe,CAAC,EACd,QAAQ,EACR,OAAO,EACP,MAAM,EACN,aAAa,EACb,sBAAsB,GACjB,KAAqB;IAC1B,MAAM,MAAM,GAAoBsB,WAAS,CAAC;QACxC,aAAa;QACb,SAAS,EAAE,QAAQ,CAAC,KAAK;QACzB,OAAO;QACP,MAAM;QACN,sBAAsB;AACvB,KAAA,CAAC;AAEF,IAAA,OAAO,MAAM,IAAI,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;AACpE,CAAC;;AChBD,+BAAe,CAAC,EACd,SAAS,EACT,OAAO,EACP,MAAM,EACN,aAAa,EACb,sBAAsB,GACjB,KAAqB;;AAE1B,IAAA,M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