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H,6CAAG,KAAM7tB,EAAU,UAAH,6CAAG,KAEvC,KAAKxE,EAAAA,EAAAA,gBAAeqyB,GAAgB,CACnC,IAAMhrB,EAAOgrB,EAIb,OAHAH,EAAK7qB,EAAM7C,GAGJ6C,EAMR,IAAMmgB,EAA+B6K,EACrCN,EAAiCvK,GAGjC,IAAMtuB,EAAMsL,EAAU,SAAC6C,GAAa,OAAK6qB,EAAK7qB,EAAM7C,EAAQ,EAAG0tB,EAC/D,OAAOI,EAAa9K,EAAStuB,IAcRq5B,CAA2BL,GAC/CD,EAAa35B,GAAO,kBAAM85B,CAAW,MAIhCH,EAGR,SAASO,EAAOt5B,EAAUmO,GACN,oBAARnO,EACVA,EAAImO,GAEJnO,EAAIc,QAAUqN,EAIhB,SAASirB,EAAa9K,EAAciL,GACnC,IAAMC,EAAclL,EAAQtuB,IAQ5B,OAPAkJ,EAAAA,EAAAA,GACwB,kBAAhBswB,EACP,mOAKIA,GAMG1zB,EAAAA,EAAAA,cAAawoB,EAAS,CAC5BtuB,IAAK,SAACmO,GACLmrB,EAAOE,EAAarrB,GACpBmrB,EAAOC,EAAQprB,OAPVrI,EAAAA,EAAAA,cAAawoB,EAAS,CAC5BtuB,IAAKu5B","sources":["../node_modules/fast-deep-equal/index.js","../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/cjs/react.production.min.js","../../node_modules/react/index.js","../../node_modules/react/jsx-runtime.js","../node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js","../node_modules/@react-dnd/invariant/src/index.ts","../node_modules/@react-dnd/shallowequal/src/index.ts","../node_modules/dnd-multi-backend/dist/index.js","../node_modules/react-dnd-html5-backend/src/utils/js_utils.ts","../node_modules/react-dnd-html5-backend/src/EnterLeaveCounter.ts","../node_modules/react-dnd-html5-backend/src/NativeDragSources/NativeDragSource.ts","../node_modules/react-dnd-html5-backend/src/NativeTypes.ts","../node_modules/react-dnd-html5-backend/src/NativeDragSources/getDataFromDataTransfer.ts","../node_modules/react-dnd-html5-backend/src/NativeDragSources/nativeTypesConfig.ts","../node_modules/react-dnd-html5-backend/src/NativeDragSources/index.ts","../node_modules/react-dnd-html5-backend/src/BrowserDetector.ts","../node_modules/react-dnd-html5-backend/src/MonotonicInterpolant.ts","../node_modules/react-dnd-html5-backend/src/OffsetUtils.ts","../node_modules/react-dnd-html5-backend/src/OptionsReader.ts","../node_modules/react-dnd-html5-backend/src/HTML5BackendImpl.ts","../node_modules/react-dnd-html5-backend/src/index.ts","../node_modules/redux/es/redux.js","../node_modules/dnd-core/src/utils/js_utils.ts","../node_modules/dnd-core/src/actions/dragDrop/types.ts","../node_modules/dnd-core/src/actions/dragDrop/local/setClientOffset.ts","../node_modules/dnd-core/src/actions/dragDrop/beginDrag.ts","../node_modules/dnd-core/src/actions/dragDrop/drop.ts","../node_modules/dnd-core/src/actions/dragDrop/endDrag.ts","../node_modules/dnd-core/src/utils/matchesType.ts","../node_modules/dnd-core/src/actions/dragDrop/hover.ts","../node_modules/dnd-core/src/actions/dragDrop/publishDragSource.ts","../node_modules/dnd-core/src/classes/DragDropManagerImpl.ts","../node_modules/dnd-core/src/actions/dragDrop/index.ts","../node_modules/dnd-core/src/utils/coords.ts","../node_modules/dnd-core/src/utils/dirtiness.ts","../node_modules/dnd-core/src/classes/DragDropMonitorImpl.ts","../node_modules/@react-dnd/asap/src/makeRequestCall.ts","../node_modules/@react-dnd/asap/src/AsapQueue.ts","../node_modules/@react-dnd/asap/src/RawTask.ts","../node_modules/@react-dnd/asap/src/TaskFactory.ts","../node_modules/@react-dnd/asap/src/asap.ts","../node_modules/dnd-core/src/actions/registry.ts","../node_modules/dnd-core/src/interfaces.ts","../node_modules/dnd-core/src/contracts.ts","../node_modules/dnd-core/src/utils/getNextUniqueId.ts","../node_modules/dnd-core/src/classes/HandlerRegistryImpl.ts","../node_modules/dnd-core/src/utils/equality.ts","../node_modules/dnd-core/src/reducers/dirtyHandlerIds.ts","../node_modules/dnd-core/src/reducers/dragOffset.ts","../node_modules/dnd-core/src/reducers/dragOperation.ts","../node_modules/dnd-core/src/reducers/refCount.ts","../node_modules/dnd-core/src/reducers/stateId.ts","../node_modules/dnd-core/src/reducers/index.ts","../node_modules/dnd-core/src/createDragDropManager.ts","../node_modules/react-dnd/src/core/DndProvider.tsx","../node_modules/react-dnd-preview/dist/index.js","../node_modules/react-dnd-multi-backend/dist/index.js","../node_modules/react-dnd-touch-backend/src/interfaces.ts","../node_modules/react-dnd-touch-backend/src/OptionsReader.ts","../node_modules/react-dnd-touch-backend/src/utils/predicates.ts","../node_modules/react-dnd-touch-backend/src/utils/offsets.ts","../node_modules/react-dnd-touch-backend/src/utils/supportsPassive.ts","../node_modules/react-dnd-touch-backend/src/TouchBackendImpl.ts","../node_modules/react-dnd-touch-backend/src/utils/math.ts","../node_modules/react-dnd-touch-backend/src/index.ts","../node_modules/react-dnd/src/core/DndContext.ts","../node_modules/react-dnd/src/hooks/useCollectedProps.ts","../node_modules/react-dnd/src/hooks/useMonitorOutput.ts","../node_modules/react-dnd/src/hooks/useCollector.ts","../node_modules/react-dnd/src/hooks/useDragDropManager.ts","../node_modules/react-dnd/src/hooks/useDragLayer.ts","../node_modules/react-dnd/src/hooks/useDrag/connectors.ts","../node_modules/react-dnd/src/internals/SourceConnector.ts","../node_modules/react-dnd/src/internals/DragSourceMonitorImpl.ts","../node_modules/react-dnd/src/hooks/useDrag/DragSourceImpl.ts","../node_modules/react-dnd/src/hooks/useDrag/useRegisteredDragSource.ts","../node_modules/react-dnd/src/hooks/useDrag/useDragSource.ts","../node_modules/react-dnd/src/hooks/useDrag/useDragType.ts","../node_modules/react-dnd/src/hooks/useDrag/useDrag.ts","../node_modules/react-dnd/src/hooks/useDrag/useDragSourceMonitor.ts","../node_modules/react-dnd/src/hooks/useDrag/useDragSourceConnector.ts","../node_modules/react-dnd/src/hooks/useDrop/connectors.ts","../node_modules/react-dnd/src/internals/TargetConnector.ts","../node_modules/react-dnd/src/internals/DropTargetMonitorImpl.ts","../node_modules/react-dnd/src/hooks/useDrop/DropTargetImpl.ts","../node_modules/react-dnd/src/hooks/useDrop/useRegisteredDropTarget.ts","../node_modules/react-dnd/src/hooks/useDrop/useDropTarget.ts","../node_modules/react-dnd/src/hooks/useDrop/useAccept.ts","../node_modules/react-dnd/src/hooks/useDrop/useDrop.ts","../node_modules/react-dnd/src/hooks/useDrop/useDropTargetMonitor.ts","../node_modules/react-dnd/src/hooks/useDrop/useDropTargetConnector.ts","../node_modules/react-dnd/src/hooks/useIsomorphicLayoutEffect.ts","../node_modules/react-dnd/src/hooks/useOptionalFactory.ts","../node_modules/react-dnd/src/internals/isRef.ts","../node_modules/react-dnd/src/internals/registration.ts","../node_modules/react-dnd/src/internals/wrapConnectorHooks.ts"],"sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its 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'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its 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'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}","/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nexport function invariant(condition: any, format: string, ...args: any[]) {\n\tif (isProduction()) {\n\t\tif (format === undefined) {\n\t\t\tthrow new Error('invariant requires an error message argument')\n\t\t}\n\t}\n\n\tif (!condition) {\n\t\tlet error\n\t\tif (format === undefined) {\n\t\t\terror = new Error(\n\t\t\t\t'Minified exception occurred; use the non-minified dev environment ' +\n\t\t\t\t\t'for the full error message and additional helpful warnings.',\n\t\t\t)\n\t\t} else {\n\t\t\tlet argIndex = 0\n\t\t\terror = new Error(\n\t\t\t\tformat.replace(/%s/g, function () {\n\t\t\t\t\treturn args[argIndex++]\n\t\t\t\t}),\n\t\t\t)\n\t\t\terror.name = 'Invariant Violation'\n\t\t}\n\n\t\t;(error as any).framesToPop = 1 // we don't care about invariant's own frame\n\t\tthrow error\n\t}\n}\n\nfunction isProduction() {\n\treturn (\n\t\ttypeof process !== 'undefined' && process.env['NODE_ENV'] === 'production'\n\t)\n}\n","export function shallowEqual(\n\tobjA: T,\n\tobjB: T,\n\tcompare?: (a: T, b: T, key?: string) => boolean | void,\n\tcompareContext?: any,\n) {\n\tlet compareResult = compare\n\t\t? compare.call(compareContext, objA, objB)\n\t\t: void 0\n\tif (compareResult !== void 0) {\n\t\treturn !!compareResult\n\t}\n\n\tif (objA === objB) {\n\t\treturn true\n\t}\n\n\tif (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {\n\t\treturn false\n\t}\n\n\tconst keysA = Object.keys(objA)\n\tconst keysB = Object.keys(objB)\n\n\tif (keysA.length !== keysB.length) {\n\t\treturn false\n\t}\n\n\tconst bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB)\n\n\t// Test for A's keys different from B.\n\tfor (let idx = 0; idx < keysA.length; idx++) {\n\t\tconst key = keysA[idx] as string\n\n\t\tif (!bHasOwnProperty(key)) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst valueA = (objA as any)[key]\n\t\tconst valueB = (objB as any)[key]\n\n\t\tcompareResult = compare\n\t\t\t? compare.call(compareContext, valueA, valueB, key)\n\t\t\t: void 0\n\n\t\tif (\n\t\t\tcompareResult === false ||\n\t\t\t(compareResult === void 0 && valueA !== valueB)\n\t\t) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n","var D=(r,n,e)=>{if(!n.has(r))throw TypeError(\"Cannot \"+e)};var t=(r,n,e)=>(D(r,n,\"read from private field\"),e?e.call(r):n.get(r)),o=(r,n,e)=>{if(n.has(r))throw TypeError(\"Cannot add the same private member more than once\");n instanceof WeakSet?n.add(r):n.set(r,e)},p=(r,n,e,i)=>(D(r,n,\"write to private field\"),i?i.call(r,e):n.set(r,e),e);var w,b=class{constructor(){o(this,w,void 0);this.register=n=>{t(this,w).push(n)};this.unregister=n=>{let e;for(;(e=t(this,w).indexOf(n))!==-1;)t(this,w).splice(e,1)};this.backendChanged=n=>{for(let e of t(this,w))e.backendChanged(n)};p(this,w,[])}};w=new WeakMap;var a,f,c,d,h,x,T,E,v,y,g,l=class l{constructor(n,e,i){o(this,a,void 0);o(this,f,void 0);o(this,c,void 0);o(this,d,void 0);o(this,h,void 0);o(this,x,(n,e,i)=>{if(!i.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(i)}`);let u=i.backend(n,e,i.options),s=i.id,k=!i.id&&u&&u.constructor;if(k&&(s=u.constructor.name),s)k&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.\n This might be unsupported in the future, please specify 'id' explicitely for every backend.`);else throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(i)}\n see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(t(this,c)[s])throw new Error(`You must specify a unique 'id' property in your Backend entry:\n ${JSON.stringify(i)} (conflicts with: ${JSON.stringify(t(this,c)[s])})`);return{id:s,instance:u,preview:i.preview??!1,transition:i.transition,skipDispatchOnTransition:i.skipDispatchOnTransition??!1}});this.setup=()=>{if(!(typeof window>\"u\")){if(l.isSetUp)throw new Error(\"Cannot have two MultiBackends at the same time.\");l.isSetUp=!0,t(this,T).call(this,window),t(this,c)[t(this,a)].instance.setup()}};this.teardown=()=>{typeof window>\"u\"||(l.isSetUp=!1,t(this,E).call(this,window),t(this,c)[t(this,a)].instance.teardown())};this.connectDragSource=(n,e,i)=>t(this,g).call(this,\"connectDragSource\",n,e,i);this.connectDragPreview=(n,e,i)=>t(this,g).call(this,\"connectDragPreview\",n,e,i);this.connectDropTarget=(n,e,i)=>t(this,g).call(this,\"connectDropTarget\",n,e,i);this.profile=()=>t(this,c)[t(this,a)].instance.profile();this.previewEnabled=()=>t(this,c)[t(this,a)].preview;this.previewsList=()=>t(this,f);this.backendsList=()=>t(this,d);o(this,T,n=>{t(this,d).forEach(e=>{e.transition&&n.addEventListener(e.transition.event,t(this,v))})});o(this,E,n=>{t(this,d).forEach(e=>{e.transition&&n.removeEventListener(e.transition.event,t(this,v))})});o(this,v,n=>{let e=t(this,a);if(t(this,d).some(i=>i.id!==t(this,a)&&i.transition&&i.transition.check(n)?(p(this,a,i.id),!0):!1),t(this,a)!==e){t(this,c)[e].instance.teardown(),Object.keys(t(this,h)).forEach(k=>{let B=t(this,h)[k];B.unsubscribe(),B.unsubscribe=t(this,y).call(this,B.func,...B.args)}),t(this,f).backendChanged(this);let i=t(this,c)[t(this,a)];if(i.instance.setup(),i.skipDispatchOnTransition)return;let u=n.constructor,s=new u(n.type,n);n.target?.dispatchEvent(s)}});o(this,y,(n,e,i,u)=>t(this,c)[t(this,a)].instance[n](e,i,u));o(this,g,(n,e,i,u)=>{let s=`${n}_${e}`,k=t(this,y).call(this,n,e,i,u);return t(this,h)[s]={func:n,args:[e,i,u],unsubscribe:k},()=>{t(this,h)[s].unsubscribe(),delete t(this,h)[s]}});if(!i||!i.backends||i.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)\n see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);p(this,f,new b),p(this,c,{}),p(this,d,[]),i.backends.forEach(u=>{let s=t(this,x).call(this,n,e,u);t(this,c)[s.id]=s,t(this,d).push(s)}),p(this,a,t(this,d)[0].id),p(this,h,{})}};a=new WeakMap,f=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,x=new WeakMap,T=new WeakMap,E=new WeakMap,v=new WeakMap,y=new WeakMap,g=new WeakMap,l.isSetUp=!1;var M=l;var P=(r,n,e)=>new M(r,n,e);var m=(r,n)=>({event:r,check:n});var S=m(\"touchstart\",r=>{let n=r;return n.touches!==null&&n.touches!==void 0}),L=m(\"dragstart\",r=>r.type.indexOf(\"drag\")!==-1||r.type.indexOf(\"drop\")!==-1),O=m(\"mousedown\",r=>r.type.indexOf(\"touch\")===-1&&r.type.indexOf(\"mouse\")!==-1),C=m(\"pointerdown\",r=>r.pointerType==\"mouse\");export{L as HTML5DragTransition,O as MouseTransition,P as MultiBackend,C as PointerTransition,S as TouchTransition,m as createTransition};\n","// cheap lodash replacements\n\nexport function memoize(fn: () => T): () => T {\n\tlet result: T | null = null\n\tconst memoized = () => {\n\t\tif (result == null) {\n\t\t\tresult = fn()\n\t\t}\n\t\treturn result\n\t}\n\treturn memoized\n}\n\n/**\n * drop-in replacement for _.without\n */\nexport function without(items: T[], item: T) {\n\treturn items.filter((i) => i !== item)\n}\n\nexport function union(itemsA: T[], itemsB: T[]) {\n\tconst set = new Set()\n\tconst insertItem = (item: T) => set.add(item)\n\titemsA.forEach(insertItem)\n\titemsB.forEach(insertItem)\n\n\tconst result: T[] = []\n\tset.forEach((key) => result.push(key))\n\treturn result\n}\n","import { union, without } from './utils/js_utils.js'\n\ntype NodePredicate = (node: Node | null | undefined) => boolean\n\nexport class EnterLeaveCounter {\n\tprivate entered: any[] = []\n\tprivate isNodeInDocument: NodePredicate\n\n\tpublic constructor(isNodeInDocument: NodePredicate) {\n\t\tthis.isNodeInDocument = isNodeInDocument\n\t}\n\n\tpublic enter(enteringNode: EventTarget | null): boolean {\n\t\tconst previousLength = this.entered.length\n\n\t\tconst isNodeEntered = (node: Node): boolean =>\n\t\t\tthis.isNodeInDocument(node) &&\n\t\t\t(!node.contains || node.contains(enteringNode as Node))\n\n\t\tthis.entered = union(this.entered.filter(isNodeEntered), [enteringNode])\n\n\t\treturn previousLength === 0 && this.entered.length > 0\n\t}\n\n\tpublic leave(leavingNode: EventTarget | null): boolean {\n\t\tconst previousLength = this.entered.length\n\n\t\tthis.entered = without(\n\t\t\tthis.entered.filter(this.isNodeInDocument),\n\t\t\tleavingNode,\n\t\t)\n\n\t\treturn previousLength > 0 && this.entered.length === 0\n\t}\n\n\tpublic reset(): void {\n\t\tthis.entered = []\n\t}\n}\n","import type { DragDropMonitor } from 'dnd-core'\n\nimport type { NativeItemConfig } from './nativeTypesConfig.js'\n\nexport class NativeDragSource {\n\tpublic item: any\n\tprivate config: NativeItemConfig\n\n\tpublic constructor(config: NativeItemConfig) {\n\t\tthis.config = config\n\t\tthis.item = {}\n\t\tthis.initializeExposedProperties()\n\t}\n\n\tprivate initializeExposedProperties() {\n\t\tObject.keys(this.config.exposeProperties).forEach((property) => {\n\t\t\tObject.defineProperty(this.item, property, {\n\t\t\t\tconfigurable: true, // This is needed to allow redefining it later\n\t\t\t\tenumerable: true,\n\t\t\t\tget() {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`Browser doesn't allow reading \"${property}\" until the drop event.`,\n\t\t\t\t\t)\n\t\t\t\t\treturn null\n\t\t\t\t},\n\t\t\t})\n\t\t})\n\t}\n\n\tpublic loadDataTransfer(dataTransfer: DataTransfer | null | undefined): void {\n\t\tif (dataTransfer) {\n\t\t\tconst newProperties: PropertyDescriptorMap = {}\n\t\t\tObject.keys(this.config.exposeProperties).forEach((property) => {\n\t\t\t\tconst propertyFn = this.config.exposeProperties[property]\n\t\t\t\tif (propertyFn != null) {\n\t\t\t\t\tnewProperties[property] = {\n\t\t\t\t\t\tvalue: propertyFn(dataTransfer, this.config.matchesTypes),\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\tObject.defineProperties(this.item, newProperties)\n\t\t}\n\t}\n\n\tpublic canDrag(): boolean {\n\t\treturn true\n\t}\n\n\tpublic beginDrag(): any {\n\t\treturn this.item\n\t}\n\n\tpublic isDragging(monitor: DragDropMonitor, handle: string): boolean {\n\t\treturn handle === monitor.getSourceId()\n\t}\n\n\tpublic endDrag(): void {\n\t\t// empty\n\t}\n}\n","export const FILE = '__NATIVE_FILE__'\nexport const URL = '__NATIVE_URL__'\nexport const TEXT = '__NATIVE_TEXT__'\nexport const HTML = '__NATIVE_HTML__'\n","export function getDataFromDataTransfer(\n\tdataTransfer: DataTransfer,\n\ttypesToTry: string[],\n\tdefaultValue: string,\n): string {\n\tconst result = typesToTry.reduce(\n\t\t(resultSoFar, typeToTry) => resultSoFar || dataTransfer.getData(typeToTry),\n\t\t'',\n\t)\n\n\treturn result != null ? result : defaultValue\n}\n","import * as NativeTypes from '../NativeTypes.js'\nimport { getDataFromDataTransfer } from './getDataFromDataTransfer.js'\n\nexport interface NativeItemConfigExposePropreties {\n\t[property: string]: (\n\t\tdataTransfer: DataTransfer,\n\t\tmatchesTypes: string[],\n\t) => any\n}\n\nexport interface NativeItemConfig {\n\texposeProperties: NativeItemConfigExposePropreties\n\tmatchesTypes: string[]\n}\n\nexport const nativeTypesConfig: {\n\t[key: string]: NativeItemConfig\n} = {\n\t[NativeTypes.FILE]: {\n\t\texposeProperties: {\n\t\t\tfiles: (dataTransfer: DataTransfer): File[] =>\n\t\t\t\tArray.prototype.slice.call(dataTransfer.files),\n\t\t\titems: (dataTransfer: DataTransfer): DataTransferItemList =>\n\t\t\t\tdataTransfer.items,\n\t\t\tdataTransfer: (dataTransfer: DataTransfer): DataTransfer => dataTransfer,\n\t\t},\n\t\tmatchesTypes: ['Files'],\n\t},\n\t[NativeTypes.HTML]: {\n\t\texposeProperties: {\n\t\t\thtml: (dataTransfer: DataTransfer, matchesTypes: string[]): string =>\n\t\t\t\tgetDataFromDataTransfer(dataTransfer, matchesTypes, ''),\n\t\t\tdataTransfer: (dataTransfer: DataTransfer): DataTransfer => dataTransfer,\n\t\t},\n\t\tmatchesTypes: ['Html', 'text/html'],\n\t},\n\t[NativeTypes.URL]: {\n\t\texposeProperties: {\n\t\t\turls: (dataTransfer: DataTransfer, matchesTypes: string[]): string[] =>\n\t\t\t\tgetDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\\n'),\n\t\t\tdataTransfer: (dataTransfer: DataTransfer): DataTransfer => dataTransfer,\n\t\t},\n\t\tmatchesTypes: ['Url', 'text/uri-list'],\n\t},\n\t[NativeTypes.TEXT]: {\n\t\texposeProperties: {\n\t\t\ttext: (dataTransfer: DataTransfer, matchesTypes: string[]): string =>\n\t\t\t\tgetDataFromDataTransfer(dataTransfer, matchesTypes, ''),\n\t\t\tdataTransfer: (dataTransfer: DataTransfer): DataTransfer => dataTransfer,\n\t\t},\n\t\tmatchesTypes: ['Text', 'text/plain'],\n\t},\n}\n","import { NativeDragSource } from './NativeDragSource.js'\nimport { nativeTypesConfig } from './nativeTypesConfig.js'\n\nexport function createNativeDragSource(\n\ttype: string,\n\tdataTransfer?: DataTransfer,\n): NativeDragSource {\n\tconst config = nativeTypesConfig[type]\n\tif (!config) {\n\t\tthrow new Error(`native type ${type} has no configuration`)\n\t}\n\tconst result = new NativeDragSource(config)\n\tresult.loadDataTransfer(dataTransfer)\n\treturn result\n}\n\nexport function matchNativeItemType(\n\tdataTransfer: DataTransfer | null,\n): string | null {\n\tif (!dataTransfer) {\n\t\treturn null\n\t}\n\n\tconst dataTransferTypes = Array.prototype.slice.call(dataTransfer.types || [])\n\treturn (\n\t\tObject.keys(nativeTypesConfig).filter((nativeItemType) => {\n\t\t\tconst typeConfig = nativeTypesConfig[nativeItemType]\n\t\t\tif (!typeConfig?.matchesTypes) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn typeConfig.matchesTypes.some(\n\t\t\t\t(t) => dataTransferTypes.indexOf(t) > -1,\n\t\t\t)\n\t\t})[0] || null\n\t)\n}\n","import { memoize } from './utils/js_utils.js'\n\ndeclare global {\n\tinterface Window extends HTMLElement {\n\t\tsafari: any\n\t}\n}\n\nexport type Predicate = () => boolean\nexport const isFirefox: Predicate = memoize(() =>\n\t/firefox/i.test(navigator.userAgent),\n)\nexport const isSafari: Predicate = memoize(() => Boolean(window.safari))\n","export class MonotonicInterpolant {\n\tprivate xs: any\n\tprivate ys: any\n\tprivate c1s: any\n\tprivate c2s: any\n\tprivate c3s: any\n\n\tpublic constructor(xs: number[], ys: number[]) {\n\t\tconst { length } = xs\n\n\t\t// Rearrange xs and ys so that xs is sorted\n\t\tconst indexes = []\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tindexes.push(i)\n\t\t}\n\t\tindexes.sort((a, b) => ((xs[a] as number) < (xs[b] as number) ? -1 : 1))\n\n\t\t// Get consecutive differences and slopes\n\t\tconst dys = []\n\t\tconst dxs = []\n\t\tconst ms = []\n\t\tlet dx\n\t\tlet dy\n\t\tfor (let i = 0; i < length - 1; i++) {\n\t\t\tdx = (xs[i + 1] as number) - (xs[i] as number)\n\t\t\tdy = (ys[i + 1] as number) - (ys[i] as number)\n\t\t\tdxs.push(dx)\n\t\t\tdys.push(dy)\n\t\t\tms.push(dy / dx)\n\t\t}\n\n\t\t// Get degree-1 coefficients\n\t\tconst c1s = [ms[0]]\n\t\tfor (let i = 0; i < dxs.length - 1; i++) {\n\t\t\tconst m2 = ms[i] as number\n\t\t\tconst mNext = ms[i + 1] as number\n\t\t\tif (m2 * mNext <= 0) {\n\t\t\t\tc1s.push(0)\n\t\t\t} else {\n\t\t\t\tdx = dxs[i] as number\n\t\t\t\tconst dxNext = dxs[i + 1] as number\n\t\t\t\tconst common = dx + dxNext\n\t\t\t\tc1s.push(\n\t\t\t\t\t(3 * common) / ((common + dxNext) / m2 + (common + dx) / mNext),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tc1s.push(ms[ms.length - 1])\n\n\t\t// Get degree-2 and degree-3 coefficients\n\t\tconst c2s = []\n\t\tconst c3s = []\n\t\tlet m\n\t\tfor (let i = 0; i < c1s.length - 1; i++) {\n\t\t\tm = ms[i] as number\n\t\t\tconst c1 = c1s[i] as number\n\t\t\tconst invDx = 1 / (dxs[i] as number)\n\t\t\tconst common = c1 + (c1s[i + 1] as number) - m - m\n\t\t\tc2s.push((m - c1 - common) * invDx)\n\t\t\tc3s.push(common * invDx * invDx)\n\t\t}\n\n\t\tthis.xs = xs\n\t\tthis.ys = ys\n\t\tthis.c1s = c1s\n\t\tthis.c2s = c2s\n\t\tthis.c3s = c3s\n\t}\n\n\tpublic interpolate(x: number): number {\n\t\tconst { xs, ys, c1s, c2s, c3s } = this\n\n\t\t// The rightmost point in the dataset should give an exact result\n\t\tlet i = xs.length - 1\n\t\tif (x === xs[i]) {\n\t\t\treturn ys[i]\n\t\t}\n\n\t\t// Search for the interval x is in, returning the corresponding y if x is one of the original xs\n\t\tlet low = 0\n\t\tlet high = c3s.length - 1\n\t\tlet mid\n\t\twhile (low <= high) {\n\t\t\tmid = Math.floor(0.5 * (low + high))\n\t\t\tconst xHere = xs[mid]\n\t\t\tif (xHere < x) {\n\t\t\t\tlow = mid + 1\n\t\t\t} else if (xHere > x) {\n\t\t\t\thigh = mid - 1\n\t\t\t} else {\n\t\t\t\treturn ys[mid]\n\t\t\t}\n\t\t}\n\t\ti = Math.max(0, high)\n\n\t\t// Interpolate\n\t\tconst diff = x - xs[i]\n\t\tconst diffSq = diff * diff\n\t\treturn ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq\n\t}\n}\n","import type { XYCoord } from 'dnd-core'\n\nimport { isFirefox, isSafari } from './BrowserDetector.js'\nimport { MonotonicInterpolant } from './MonotonicInterpolant.js'\n\nconst ELEMENT_NODE = 1\n\nexport function getNodeClientOffset(node: Node): XYCoord | null {\n\tconst el = node.nodeType === ELEMENT_NODE ? node : node.parentElement\n\n\tif (!el) {\n\t\treturn null\n\t}\n\n\tconst { top, left } = (el as HTMLElement).getBoundingClientRect()\n\treturn { x: left, y: top }\n}\n\nexport function getEventClientOffset(e: MouseEvent): XYCoord {\n\treturn {\n\t\tx: e.clientX,\n\t\ty: e.clientY,\n\t}\n}\n\nfunction isImageNode(node: any) {\n\treturn (\n\t\tnode.nodeName === 'IMG' &&\n\t\t(isFirefox() || !document.documentElement?.contains(node))\n\t)\n}\n\nfunction getDragPreviewSize(\n\tisImage: boolean,\n\tdragPreview: any,\n\tsourceWidth: number,\n\tsourceHeight: number,\n) {\n\tlet dragPreviewWidth = isImage ? dragPreview.width : sourceWidth\n\tlet dragPreviewHeight = isImage ? dragPreview.height : sourceHeight\n\n\t// Work around @2x coordinate discrepancies in browsers\n\tif (isSafari() && isImage) {\n\t\tdragPreviewHeight /= window.devicePixelRatio\n\t\tdragPreviewWidth /= window.devicePixelRatio\n\t}\n\treturn { dragPreviewWidth, dragPreviewHeight }\n}\n\nexport function getDragPreviewOffset(\n\tsourceNode: HTMLElement,\n\tdragPreview: HTMLElement,\n\tclientOffset: XYCoord,\n\tanchorPoint: { anchorX: number; anchorY: number },\n\toffsetPoint: { offsetX: number; offsetY: number },\n): XYCoord {\n\t// The browsers will use the image intrinsic size under different conditions.\n\t// Firefox only cares if it's an image, but WebKit also wants it to be detached.\n\tconst isImage = isImageNode(dragPreview)\n\tconst dragPreviewNode = isImage ? sourceNode : dragPreview\n\tconst dragPreviewNodeOffsetFromClient = getNodeClientOffset(\n\t\tdragPreviewNode,\n\t) as XYCoord\n\tconst offsetFromDragPreview = {\n\t\tx: clientOffset.x - dragPreviewNodeOffsetFromClient.x,\n\t\ty: clientOffset.y - dragPreviewNodeOffsetFromClient.y,\n\t}\n\tconst { offsetWidth: sourceWidth, offsetHeight: sourceHeight } = sourceNode\n\tconst { anchorX, anchorY } = anchorPoint\n\tconst { dragPreviewWidth, dragPreviewHeight } = getDragPreviewSize(\n\t\tisImage,\n\t\tdragPreview,\n\t\tsourceWidth,\n\t\tsourceHeight,\n\t)\n\n\tconst calculateYOffset = () => {\n\t\tconst interpolantY = new MonotonicInterpolant(\n\t\t\t[0, 0.5, 1],\n\t\t\t[\n\t\t\t\t// Dock to the top\n\t\t\t\toffsetFromDragPreview.y,\n\t\t\t\t// Align at the center\n\t\t\t\t(offsetFromDragPreview.y / sourceHeight) * dragPreviewHeight,\n\t\t\t\t// Dock to the bottom\n\t\t\t\toffsetFromDragPreview.y + dragPreviewHeight - sourceHeight,\n\t\t\t],\n\t\t)\n\t\tlet y = interpolantY.interpolate(anchorY)\n\t\t// Work around Safari 8 positioning bug\n\t\tif (isSafari() && isImage) {\n\t\t\t// We'll have to wait for @3x to see if this is entirely correct\n\t\t\ty += (window.devicePixelRatio - 1) * dragPreviewHeight\n\t\t}\n\t\treturn y\n\t}\n\n\tconst calculateXOffset = () => {\n\t\t// Interpolate coordinates depending on anchor point\n\t\t// If you know a simpler way to do this, let me know\n\t\tconst interpolantX = new MonotonicInterpolant(\n\t\t\t[0, 0.5, 1],\n\t\t\t[\n\t\t\t\t// Dock to the left\n\t\t\t\toffsetFromDragPreview.x,\n\t\t\t\t// Align at the center\n\t\t\t\t(offsetFromDragPreview.x / sourceWidth) * dragPreviewWidth,\n\t\t\t\t// Dock to the right\n\t\t\t\toffsetFromDragPreview.x + dragPreviewWidth - sourceWidth,\n\t\t\t],\n\t\t)\n\t\treturn interpolantX.interpolate(anchorX)\n\t}\n\n\t// Force offsets if specified in the options.\n\tconst { offsetX, offsetY } = offsetPoint\n\tconst isManualOffsetX = offsetX === 0 || offsetX\n\tconst isManualOffsetY = offsetY === 0 || offsetY\n\treturn {\n\t\tx: isManualOffsetX ? offsetX : calculateXOffset(),\n\t\ty: isManualOffsetY ? offsetY : calculateYOffset(),\n\t}\n}\n","import type { HTML5BackendContext, HTML5BackendOptions } from './types.js'\n\nexport class OptionsReader {\n\tpublic ownerDocument: Document | null = null\n\tprivate globalContext: HTML5BackendContext\n\tprivate optionsArgs: HTML5BackendOptions | undefined\n\n\tpublic constructor(\n\t\tglobalContext: HTML5BackendContext,\n\t\toptions?: HTML5BackendOptions,\n\t) {\n\t\tthis.globalContext = globalContext\n\t\tthis.optionsArgs = options\n\t}\n\n\tpublic get window(): Window | undefined {\n\t\tif (this.globalContext) {\n\t\t\treturn this.globalContext\n\t\t} else if (typeof window !== 'undefined') {\n\t\t\treturn window\n\t\t}\n\t\treturn undefined\n\t}\n\n\tpublic get document(): Document | undefined {\n\t\tif (this.globalContext?.document) {\n\t\t\treturn this.globalContext.document\n\t\t} else if (this.window) {\n\t\t\treturn this.window.document\n\t\t} else {\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\tpublic get rootElement(): Node | undefined {\n\t\treturn this.optionsArgs?.rootElement || this.window\n\t}\n}\n","import type {\n\tBackend,\n\tDragDropActions,\n\tDragDropManager,\n\tDragDropMonitor,\n\tHandlerRegistry,\n\tIdentifier,\n\tUnsubscribe,\n\tXYCoord,\n} from 'dnd-core'\n\nimport { EnterLeaveCounter } from './EnterLeaveCounter.js'\nimport {\n\tcreateNativeDragSource,\n\tmatchNativeItemType,\n} from './NativeDragSources/index.js'\nimport type { NativeDragSource } from './NativeDragSources/NativeDragSource.js'\nimport * as NativeTypes from './NativeTypes.js'\nimport {\n\tgetDragPreviewOffset,\n\tgetEventClientOffset,\n\tgetNodeClientOffset,\n} from './OffsetUtils.js'\nimport { OptionsReader } from './OptionsReader.js'\nimport type { HTML5BackendContext, HTML5BackendOptions } from './types.js'\n\ntype RootNode = Node & { __isReactDndBackendSetUp: boolean | undefined }\n\nexport class HTML5BackendImpl implements Backend {\n\tprivate options: OptionsReader\n\n\t// React-Dnd Components\n\tprivate actions: DragDropActions\n\tprivate monitor: DragDropMonitor\n\tprivate registry: HandlerRegistry\n\n\t// Internal State\n\tprivate enterLeaveCounter: EnterLeaveCounter\n\n\tprivate sourcePreviewNodes: Map = new Map()\n\tprivate sourcePreviewNodeOptions: Map = new Map()\n\tprivate sourceNodes: Map = new Map()\n\tprivate sourceNodeOptions: Map = new Map()\n\n\tprivate dragStartSourceIds: string[] | null = null\n\tprivate dropTargetIds: string[] = []\n\tprivate dragEnterTargetIds: string[] = []\n\tprivate currentNativeSource: NativeDragSource | null = null\n\tprivate currentNativeHandle: Identifier | null = null\n\tprivate currentDragSourceNode: Element | null = null\n\tprivate altKeyPressed = false\n\tprivate mouseMoveTimeoutTimer: number | null = null\n\tprivate asyncEndDragFrameId: number | null = null\n\tprivate dragOverTargetIds: string[] | null = null\n\n\tprivate lastClientOffset: XYCoord | null = null\n\tprivate hoverRafId: number | null = null\n\n\tpublic constructor(\n\t\tmanager: DragDropManager,\n\t\tglobalContext?: HTML5BackendContext,\n\t\toptions?: HTML5BackendOptions,\n\t) {\n\t\tthis.options = new OptionsReader(globalContext, options)\n\t\tthis.actions = manager.getActions()\n\t\tthis.monitor = manager.getMonitor()\n\t\tthis.registry = manager.getRegistry()\n\t\tthis.enterLeaveCounter = new EnterLeaveCounter(this.isNodeInDocument)\n\t}\n\n\t/**\n\t * Generate profiling statistics for the HTML5Backend.\n\t */\n\tpublic profile(): Record {\n\t\treturn {\n\t\t\tsourcePreviewNodes: this.sourcePreviewNodes.size,\n\t\t\tsourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,\n\t\t\tsourceNodeOptions: this.sourceNodeOptions.size,\n\t\t\tsourceNodes: this.sourceNodes.size,\n\t\t\tdragStartSourceIds: this.dragStartSourceIds?.length || 0,\n\t\t\tdropTargetIds: this.dropTargetIds.length,\n\t\t\tdragEnterTargetIds: this.dragEnterTargetIds.length,\n\t\t\tdragOverTargetIds: this.dragOverTargetIds?.length || 0,\n\t\t}\n\t}\n\n\t// public for test\n\tpublic get window(): Window | undefined {\n\t\treturn this.options.window\n\t}\n\tpublic get document(): Document | undefined {\n\t\treturn this.options.document\n\t}\n\t/**\n\t * Get the root element to use for event subscriptions\n\t */\n\tprivate get rootElement(): Node | undefined {\n\t\treturn this.options.rootElement as Node\n\t}\n\n\tpublic setup(): void {\n\t\tconst root = this.rootElement as RootNode | undefined\n\t\tif (root === undefined) {\n\t\t\treturn\n\t\t}\n\n\t\tif (root.__isReactDndBackendSetUp) {\n\t\t\tthrow new Error('Cannot have two HTML5 backends at the same time.')\n\t\t}\n\t\troot.__isReactDndBackendSetUp = true\n\t\tthis.addEventListeners(root)\n\t}\n\n\tpublic teardown(): void {\n\t\tconst root = this.rootElement as RootNode\n\t\tif (root === undefined) {\n\t\t\treturn\n\t\t}\n\n\t\troot.__isReactDndBackendSetUp = false\n\t\tthis.removeEventListeners(this.rootElement as Element)\n\t\tthis.clearCurrentDragSourceNode()\n\t\tif (this.asyncEndDragFrameId) {\n\t\t\tthis.window?.cancelAnimationFrame(this.asyncEndDragFrameId)\n\t\t}\n\t}\n\n\tpublic connectDragPreview(\n\t\tsourceId: string,\n\t\tnode: Element,\n\t\toptions: any,\n\t): Unsubscribe {\n\t\tthis.sourcePreviewNodeOptions.set(sourceId, options)\n\t\tthis.sourcePreviewNodes.set(sourceId, node)\n\n\t\treturn (): void => {\n\t\t\tthis.sourcePreviewNodes.delete(sourceId)\n\t\t\tthis.sourcePreviewNodeOptions.delete(sourceId)\n\t\t}\n\t}\n\n\tpublic connectDragSource(\n\t\tsourceId: string,\n\t\tnode: Element,\n\t\toptions: any,\n\t): Unsubscribe {\n\t\tthis.sourceNodes.set(sourceId, node)\n\t\tthis.sourceNodeOptions.set(sourceId, options)\n\n\t\tconst handleDragStart = (e: any) => this.handleDragStart(e, sourceId)\n\t\tconst handleSelectStart = (e: any) => this.handleSelectStart(e)\n\n\t\tnode.setAttribute('draggable', 'true')\n\t\tnode.addEventListener('dragstart', handleDragStart)\n\t\tnode.addEventListener('selectstart', handleSelectStart)\n\n\t\treturn (): void => {\n\t\t\tthis.sourceNodes.delete(sourceId)\n\t\t\tthis.sourceNodeOptions.delete(sourceId)\n\n\t\t\tnode.removeEventListener('dragstart', handleDragStart)\n\t\t\tnode.removeEventListener('selectstart', handleSelectStart)\n\t\t\tnode.setAttribute('draggable', 'false')\n\t\t}\n\t}\n\n\tpublic connectDropTarget(targetId: string, node: HTMLElement): Unsubscribe {\n\t\tconst handleDragEnter = (e: DragEvent) => this.handleDragEnter(e, targetId)\n\t\tconst handleDragOver = (e: DragEvent) => this.handleDragOver(e, targetId)\n\t\tconst handleDrop = (e: DragEvent) => this.handleDrop(e, targetId)\n\n\t\tnode.addEventListener('dragenter', handleDragEnter)\n\t\tnode.addEventListener('dragover', handleDragOver)\n\t\tnode.addEventListener('drop', handleDrop)\n\n\t\treturn (): void => {\n\t\t\tnode.removeEventListener('dragenter', handleDragEnter)\n\t\t\tnode.removeEventListener('dragover', handleDragOver)\n\t\t\tnode.removeEventListener('drop', handleDrop)\n\t\t}\n\t}\n\n\tprivate addEventListeners(target: Node) {\n\t\t// SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n\t\tif (!target.addEventListener) {\n\t\t\treturn\n\t\t}\n\t\ttarget.addEventListener(\n\t\t\t'dragstart',\n\t\t\tthis.handleTopDragStart as EventListener,\n\t\t)\n\t\ttarget.addEventListener('dragstart', this.handleTopDragStartCapture, true)\n\t\ttarget.addEventListener('dragend', this.handleTopDragEndCapture, true)\n\t\ttarget.addEventListener(\n\t\t\t'dragenter',\n\t\t\tthis.handleTopDragEnter as EventListener,\n\t\t)\n\t\ttarget.addEventListener(\n\t\t\t'dragenter',\n\t\t\tthis.handleTopDragEnterCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t\ttarget.addEventListener(\n\t\t\t'dragleave',\n\t\t\tthis.handleTopDragLeaveCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t\ttarget.addEventListener('dragover', this.handleTopDragOver as EventListener)\n\t\ttarget.addEventListener(\n\t\t\t'dragover',\n\t\t\tthis.handleTopDragOverCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t\ttarget.addEventListener('drop', this.handleTopDrop as EventListener)\n\t\ttarget.addEventListener(\n\t\t\t'drop',\n\t\t\tthis.handleTopDropCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t}\n\n\tprivate removeEventListeners(target: Node) {\n\t\t// SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n\t\tif (!target.removeEventListener) {\n\t\t\treturn\n\t\t}\n\t\ttarget.removeEventListener('dragstart', this.handleTopDragStart as any)\n\t\ttarget.removeEventListener(\n\t\t\t'dragstart',\n\t\t\tthis.handleTopDragStartCapture,\n\t\t\ttrue,\n\t\t)\n\t\ttarget.removeEventListener('dragend', this.handleTopDragEndCapture, true)\n\t\ttarget.removeEventListener(\n\t\t\t'dragenter',\n\t\t\tthis.handleTopDragEnter as EventListener,\n\t\t)\n\t\ttarget.removeEventListener(\n\t\t\t'dragenter',\n\t\t\tthis.handleTopDragEnterCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t\ttarget.removeEventListener(\n\t\t\t'dragleave',\n\t\t\tthis.handleTopDragLeaveCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t\ttarget.removeEventListener(\n\t\t\t'dragover',\n\t\t\tthis.handleTopDragOver as EventListener,\n\t\t)\n\t\ttarget.removeEventListener(\n\t\t\t'dragover',\n\t\t\tthis.handleTopDragOverCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t\ttarget.removeEventListener('drop', this.handleTopDrop as EventListener)\n\t\ttarget.removeEventListener(\n\t\t\t'drop',\n\t\t\tthis.handleTopDropCapture as EventListener,\n\t\t\ttrue,\n\t\t)\n\t}\n\n\tprivate getCurrentSourceNodeOptions() {\n\t\tconst sourceId = this.monitor.getSourceId() as string\n\t\tconst sourceNodeOptions = this.sourceNodeOptions.get(sourceId)\n\n\t\treturn {\n\t\t\tdropEffect: this.altKeyPressed ? 'copy' : 'move',\n\t\t\t...(sourceNodeOptions || {}),\n\t\t}\n\t}\n\n\tprivate getCurrentDropEffect() {\n\t\tif (this.isDraggingNativeItem()) {\n\t\t\t// It makes more sense to default to 'copy' for native resources\n\t\t\treturn 'copy'\n\t\t}\n\n\t\treturn this.getCurrentSourceNodeOptions().dropEffect\n\t}\n\n\tprivate getCurrentSourcePreviewNodeOptions() {\n\t\tconst sourceId = this.monitor.getSourceId() as string\n\t\tconst sourcePreviewNodeOptions = this.sourcePreviewNodeOptions.get(sourceId)\n\n\t\treturn {\n\t\t\tanchorX: 0.5,\n\t\t\tanchorY: 0.5,\n\t\t\tcaptureDraggingState: false,\n\t\t\t...(sourcePreviewNodeOptions || {}),\n\t\t}\n\t}\n\n\tprivate getSourceClientOffset = (sourceId: string): XYCoord | null => {\n\t\tconst source = this.sourceNodes.get(sourceId)\n\t\treturn (source && getNodeClientOffset(source as HTMLElement)) || null\n\t}\n\n\tprivate isDraggingNativeItem() {\n\t\tconst itemType = this.monitor.getItemType()\n\t\treturn Object.keys(NativeTypes).some(\n\t\t\t(key: string) => (NativeTypes as any)[key] === itemType,\n\t\t)\n\t}\n\n\tprivate beginDragNativeItem(type: string, dataTransfer?: DataTransfer) {\n\t\tthis.clearCurrentDragSourceNode()\n\n\t\tthis.currentNativeSource = createNativeDragSource(type, dataTransfer)\n\t\tthis.currentNativeHandle = this.registry.addSource(\n\t\t\ttype,\n\t\t\tthis.currentNativeSource,\n\t\t)\n\t\tthis.actions.beginDrag([this.currentNativeHandle])\n\t}\n\n\tprivate endDragNativeItem = (): void => {\n\t\tif (!this.isDraggingNativeItem()) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.actions.endDrag()\n\t\tif (this.currentNativeHandle) {\n\t\t\tthis.registry.removeSource(this.currentNativeHandle)\n\t\t}\n\t\tthis.currentNativeHandle = null\n\t\tthis.currentNativeSource = null\n\t}\n\n\tprivate isNodeInDocument = (node: Node | null | undefined): boolean => {\n\t\t// Check the node either in the main document or in the current context\n\t\treturn Boolean(\n\t\t\tnode &&\n\t\t\t\tthis.document &&\n\t\t\t\tthis.document.body &&\n\t\t\t\tthis.document.body.contains(node),\n\t\t)\n\t}\n\n\tprivate endDragIfSourceWasRemovedFromDOM = (): void => {\n\t\tconst node = this.currentDragSourceNode\n\t\tif (node == null || this.isNodeInDocument(node)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.clearCurrentDragSourceNode() && this.monitor.isDragging()) {\n\t\t\tthis.actions.endDrag()\n\t\t}\n\t\tthis.cancelHover()\n\t}\n\n\tprivate setCurrentDragSourceNode(node: Element | null) {\n\t\tthis.clearCurrentDragSourceNode()\n\t\tthis.currentDragSourceNode = node\n\n\t\t// A timeout of > 0 is necessary to resolve Firefox issue referenced\n\t\t// See:\n\t\t// * https://github.com/react-dnd/react-dnd/pull/928\n\t\t// * https://github.com/react-dnd/react-dnd/issues/869\n\t\tconst MOUSE_MOVE_TIMEOUT = 1000\n\n\t\t// Receiving a mouse event in the middle of a dragging operation\n\t\t// means it has ended and the drag source node disappeared from DOM,\n\t\t// so the browser didn't dispatch the dragend event.\n\t\t//\n\t\t// We need to wait before we start listening for mousemove events.\n\t\t// This is needed because the drag preview needs to be drawn or else it fires an 'mousemove' event\n\t\t// immediately in some browsers.\n\t\t//\n\t\t// See:\n\t\t// * https://github.com/react-dnd/react-dnd/pull/928\n\t\t// * https://github.com/react-dnd/react-dnd/issues/869\n\t\t//\n\t\tthis.mouseMoveTimeoutTimer = setTimeout(() => {\n\t\t\treturn this.rootElement?.addEventListener(\n\t\t\t\t'mousemove',\n\t\t\t\tthis.endDragIfSourceWasRemovedFromDOM,\n\t\t\t\ttrue,\n\t\t\t)\n\t\t}, MOUSE_MOVE_TIMEOUT) as any as number\n\t}\n\n\tprivate clearCurrentDragSourceNode() {\n\t\tif (this.currentDragSourceNode) {\n\t\t\tthis.currentDragSourceNode = null\n\n\t\t\tif (this.rootElement) {\n\t\t\t\tthis.window?.clearTimeout(this.mouseMoveTimeoutTimer || undefined)\n\t\t\t\tthis.rootElement.removeEventListener(\n\t\t\t\t\t'mousemove',\n\t\t\t\t\tthis.endDragIfSourceWasRemovedFromDOM,\n\t\t\t\t\ttrue,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tthis.mouseMoveTimeoutTimer = null\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tprivate scheduleHover = (dragOverTargetIds: string[] | null) => {\n\t\tif (\n\t\t\tthis.hoverRafId === null &&\n\t\t\ttypeof requestAnimationFrame !== 'undefined'\n\t\t) {\n\t\t\tthis.hoverRafId = requestAnimationFrame(() => {\n\t\t\t\tif (this.monitor.isDragging()) {\n\t\t\t\t\tthis.actions.hover(dragOverTargetIds || [], {\n\t\t\t\t\t\tclientOffset: this.lastClientOffset,\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tthis.hoverRafId = null\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate cancelHover = () => {\n\t\tif (\n\t\t\tthis.hoverRafId !== null &&\n\t\t\ttypeof cancelAnimationFrame !== 'undefined'\n\t\t) {\n\t\t\tcancelAnimationFrame(this.hoverRafId)\n\t\t\tthis.hoverRafId = null\n\t\t}\n\t}\n\n\tpublic handleTopDragStartCapture = (): void => {\n\t\tthis.clearCurrentDragSourceNode()\n\t\tthis.dragStartSourceIds = []\n\t}\n\n\tpublic handleDragStart(e: DragEvent, sourceId: string): void {\n\t\tif (e.defaultPrevented) {\n\t\t\treturn\n\t\t}\n\n\t\tif (!this.dragStartSourceIds) {\n\t\t\tthis.dragStartSourceIds = []\n\t\t}\n\t\tthis.dragStartSourceIds.unshift(sourceId)\n\t}\n\n\tpublic handleTopDragStart = (e: DragEvent): void => {\n\t\tif (e.defaultPrevented) {\n\t\t\treturn\n\t\t}\n\n\t\tconst { dragStartSourceIds } = this\n\t\tthis.dragStartSourceIds = null\n\n\t\tconst clientOffset = getEventClientOffset(e)\n\n\t\t// Avoid crashing if we missed a drop event or our previous drag died\n\t\tif (this.monitor.isDragging()) {\n\t\t\tthis.actions.endDrag()\n\t\t\tthis.cancelHover()\n\t\t}\n\n\t\t// Don't publish the source just yet (see why below)\n\t\tthis.actions.beginDrag(dragStartSourceIds || [], {\n\t\t\tpublishSource: false,\n\t\t\tgetSourceClientOffset: this.getSourceClientOffset,\n\t\t\tclientOffset,\n\t\t})\n\n\t\tconst { dataTransfer } = e\n\t\tconst nativeType = matchNativeItemType(dataTransfer)\n\n\t\tif (this.monitor.isDragging()) {\n\t\t\tif (dataTransfer && typeof dataTransfer.setDragImage === 'function') {\n\t\t\t\t// Use custom drag image if user specifies it.\n\t\t\t\t// If child drag source refuses drag but parent agrees,\n\t\t\t\t// use parent's node as drag image. Neither works in IE though.\n\t\t\t\tconst sourceId: string = this.monitor.getSourceId() as string\n\t\t\t\tconst sourceNode = this.sourceNodes.get(sourceId)\n\t\t\t\tconst dragPreview = this.sourcePreviewNodes.get(sourceId) || sourceNode\n\n\t\t\t\tif (dragPreview) {\n\t\t\t\t\tconst { anchorX, anchorY, offsetX, offsetY } =\n\t\t\t\t\t\tthis.getCurrentSourcePreviewNodeOptions()\n\t\t\t\t\tconst anchorPoint = { anchorX, anchorY }\n\t\t\t\t\tconst offsetPoint = { offsetX, offsetY }\n\t\t\t\t\tconst dragPreviewOffset = getDragPreviewOffset(\n\t\t\t\t\t\tsourceNode as HTMLElement,\n\t\t\t\t\t\tdragPreview as HTMLElement,\n\t\t\t\t\t\tclientOffset,\n\t\t\t\t\t\tanchorPoint,\n\t\t\t\t\t\toffsetPoint,\n\t\t\t\t\t)\n\n\t\t\t\t\tdataTransfer.setDragImage(\n\t\t\t\t\t\tdragPreview,\n\t\t\t\t\t\tdragPreviewOffset.x,\n\t\t\t\t\t\tdragPreviewOffset.y,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Firefox won't drag without setting data\n\t\t\t\tdataTransfer?.setData('application/json', {} as any)\n\t\t\t} catch (err) {\n\t\t\t\t// IE doesn't support MIME types in setData\n\t\t\t}\n\n\t\t\t// Store drag source node so we can check whether\n\t\t\t// it is removed from DOM and trigger endDrag manually.\n\t\t\tthis.setCurrentDragSourceNode(e.target as Element)\n\n\t\t\t// Now we are ready to publish the drag source.. or are we not?\n\t\t\tconst { captureDraggingState } = this.getCurrentSourcePreviewNodeOptions()\n\t\t\tif (!captureDraggingState) {\n\t\t\t\t// Usually we want to publish it in the next tick so that browser\n\t\t\t\t// is able to screenshot the current (not yet dragging) state.\n\t\t\t\t//\n\t\t\t\t// It also neatly avoids a situation where render() returns null\n\t\t\t\t// in the same tick for the source element, and browser freaks out.\n\t\t\t\tsetTimeout(() => this.actions.publishDragSource(), 0)\n\t\t\t} else {\n\t\t\t\t// In some cases the user may want to override this behavior, e.g.\n\t\t\t\t// to work around IE not supporting custom drag previews.\n\t\t\t\t//\n\t\t\t\t// When using a custom drag layer, the only way to prevent\n\t\t\t\t// the default drag preview from drawing in IE is to screenshot\n\t\t\t\t// the dragging state in which the node itself has zero opacity\n\t\t\t\t// and height. In this case, though, returning null from render()\n\t\t\t\t// will abruptly end the dragging, which is not obvious.\n\t\t\t\t//\n\t\t\t\t// This is the reason such behavior is strictly opt-in.\n\t\t\t\tthis.actions.publishDragSource()\n\t\t\t}\n\t\t} else if (nativeType) {\n\t\t\t// A native item (such as URL) dragged from inside the document\n\t\t\tthis.beginDragNativeItem(nativeType)\n\t\t} else if (\n\t\t\tdataTransfer &&\n\t\t\t!dataTransfer.types &&\n\t\t\t((e.target && !(e.target as Element).hasAttribute) ||\n\t\t\t\t!(e.target as Element).hasAttribute('draggable'))\n\t\t) {\n\t\t\t// Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.\n\t\t\t// Just let it drag. It's a native type (URL or text) and will be picked up in\n\t\t\t// dragenter handler.\n\t\t\treturn\n\t\t} else {\n\t\t\t// If by this time no drag source reacted, tell browser not to drag.\n\t\t\te.preventDefault()\n\t\t}\n\t}\n\n\tpublic handleTopDragEndCapture = (): void => {\n\t\tif (this.clearCurrentDragSourceNode() && this.monitor.isDragging()) {\n\t\t\t// Firefox can dispatch this event in an infinite loop\n\t\t\t// if dragend handler does something like showing an alert.\n\t\t\t// Only proceed if we have not handled it already.\n\t\t\tthis.actions.endDrag()\n\t\t}\n\t\tthis.cancelHover()\n\t}\n\n\tpublic handleTopDragEnterCapture = (e: DragEvent): void => {\n\t\tthis.dragEnterTargetIds = []\n\n\t\tif (this.isDraggingNativeItem()) {\n\t\t\tthis.currentNativeSource?.loadDataTransfer(e.dataTransfer)\n\t\t}\n\n\t\tconst isFirstEnter = this.enterLeaveCounter.enter(e.target)\n\t\tif (!isFirstEnter || this.monitor.isDragging()) {\n\t\t\treturn\n\t\t}\n\n\t\tconst { dataTransfer } = e\n\t\tconst nativeType = matchNativeItemType(dataTransfer)\n\n\t\tif (nativeType) {\n\t\t\t// A native item (such as file or URL) dragged from outside the document\n\t\t\tthis.beginDragNativeItem(nativeType, dataTransfer as DataTransfer)\n\t\t}\n\t}\n\n\tpublic handleDragEnter(_e: DragEvent, targetId: string): void {\n\t\tthis.dragEnterTargetIds.unshift(targetId)\n\t}\n\n\tpublic handleTopDragEnter = (e: DragEvent): void => {\n\t\tconst { dragEnterTargetIds } = this\n\t\tthis.dragEnterTargetIds = []\n\n\t\tif (!this.monitor.isDragging()) {\n\t\t\t// This is probably a native item type we don't understand.\n\t\t\treturn\n\t\t}\n\n\t\tthis.altKeyPressed = e.altKey\n\n\t\t// If the target changes position as the result of `dragenter`, `dragover` might still\n\t\t// get dispatched despite target being no longer there. The easy solution is to check\n\t\t// whether there actually is a target before firing `hover`.\n\t\tif (dragEnterTargetIds.length > 0) {\n\t\t\tthis.actions.hover(dragEnterTargetIds, {\n\t\t\t\tclientOffset: getEventClientOffset(e),\n\t\t\t})\n\t\t}\n\n\t\tconst canDrop = dragEnterTargetIds.some((targetId) =>\n\t\t\tthis.monitor.canDropOnTarget(targetId),\n\t\t)\n\n\t\tif (canDrop) {\n\t\t\t// IE requires this to fire dragover events\n\t\t\te.preventDefault()\n\t\t\tif (e.dataTransfer) {\n\t\t\t\te.dataTransfer.dropEffect = this.getCurrentDropEffect()\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleTopDragOverCapture = (e: DragEvent): void => {\n\t\tthis.dragOverTargetIds = []\n\n\t\tif (this.isDraggingNativeItem()) {\n\t\t\tthis.currentNativeSource?.loadDataTransfer(e.dataTransfer)\n\t\t}\n\t}\n\n\tpublic handleDragOver(_e: DragEvent, targetId: string): void {\n\t\tif (this.dragOverTargetIds === null) {\n\t\t\tthis.dragOverTargetIds = []\n\t\t}\n\t\tthis.dragOverTargetIds.unshift(targetId)\n\t}\n\n\tpublic handleTopDragOver = (e: DragEvent): void => {\n\t\tconst { dragOverTargetIds } = this\n\t\tthis.dragOverTargetIds = []\n\n\t\tif (!this.monitor.isDragging()) {\n\t\t\t// This is probably a native item type we don't understand.\n\t\t\t// Prevent default \"drop and blow away the whole document\" action.\n\t\t\te.preventDefault()\n\t\t\tif (e.dataTransfer) {\n\t\t\t\te.dataTransfer.dropEffect = 'none'\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tthis.altKeyPressed = e.altKey\n\t\tthis.lastClientOffset = getEventClientOffset(e)\n\n\t\tthis.scheduleHover(dragOverTargetIds)\n\n\t\tconst canDrop = (dragOverTargetIds || []).some((targetId) =>\n\t\t\tthis.monitor.canDropOnTarget(targetId),\n\t\t)\n\n\t\tif (canDrop) {\n\t\t\t// Show user-specified drop effect.\n\t\t\te.preventDefault()\n\t\t\tif (e.dataTransfer) {\n\t\t\t\te.dataTransfer.dropEffect = this.getCurrentDropEffect()\n\t\t\t}\n\t\t} else if (this.isDraggingNativeItem()) {\n\t\t\t// Don't show a nice cursor but still prevent default\n\t\t\t// \"drop and blow away the whole document\" action.\n\t\t\te.preventDefault()\n\t\t} else {\n\t\t\te.preventDefault()\n\t\t\tif (e.dataTransfer) {\n\t\t\t\te.dataTransfer.dropEffect = 'none'\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleTopDragLeaveCapture = (e: DragEvent): void => {\n\t\tif (this.isDraggingNativeItem()) {\n\t\t\te.preventDefault()\n\t\t}\n\n\t\tconst isLastLeave = this.enterLeaveCounter.leave(e.target)\n\t\tif (!isLastLeave) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.isDraggingNativeItem()) {\n\t\t\tsetTimeout(() => this.endDragNativeItem(), 0)\n\t\t}\n\t\tthis.cancelHover()\n\t}\n\n\tpublic handleTopDropCapture = (e: DragEvent): void => {\n\t\tthis.dropTargetIds = []\n\n\t\tif (this.isDraggingNativeItem()) {\n\t\t\te.preventDefault()\n\t\t\tthis.currentNativeSource?.loadDataTransfer(e.dataTransfer)\n\t\t} else if (matchNativeItemType(e.dataTransfer)) {\n\t\t\t// Dragging some elements, like and may still behave like a native drag event,\n\t\t\t// even if the current drag event matches a user-defined type.\n\t\t\t// Stop the default behavior when we're not expecting a native item to be dropped.\n\n\t\t\te.preventDefault()\n\t\t}\n\n\t\tthis.enterLeaveCounter.reset()\n\t}\n\n\tpublic handleDrop(_e: DragEvent, targetId: string): void {\n\t\tthis.dropTargetIds.unshift(targetId)\n\t}\n\n\tpublic handleTopDrop = (e: DragEvent): void => {\n\t\tconst { dropTargetIds } = this\n\t\tthis.dropTargetIds = []\n\n\t\tthis.actions.hover(dropTargetIds, {\n\t\t\tclientOffset: getEventClientOffset(e),\n\t\t})\n\t\tthis.actions.drop({ dropEffect: this.getCurrentDropEffect() })\n\n\t\tif (this.isDraggingNativeItem()) {\n\t\t\tthis.endDragNativeItem()\n\t\t} else if (this.monitor.isDragging()) {\n\t\t\tthis.actions.endDrag()\n\t\t}\n\t\tthis.cancelHover()\n\t}\n\n\tpublic handleSelectStart = (e: DragEvent): void => {\n\t\tconst target = e.target as HTMLElement & { dragDrop: () => void }\n\n\t\t// Only IE requires us to explicitly say\n\t\t// we want drag drop operation to start\n\t\tif (typeof target.dragDrop !== 'function') {\n\t\t\treturn\n\t\t}\n\n\t\t// Inputs and textareas should be selectable\n\t\tif (\n\t\t\ttarget.tagName === 'INPUT' ||\n\t\t\ttarget.tagName === 'SELECT' ||\n\t\t\ttarget.tagName === 'TEXTAREA' ||\n\t\t\ttarget.isContentEditable\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\t// For other targets, ask IE\n\t\t// to enable drag and drop\n\t\te.preventDefault()\n\t\ttarget.dragDrop()\n\t}\n}\n","import type { BackendFactory, DragDropManager } from 'dnd-core'\n\nimport { HTML5BackendImpl } from './HTML5BackendImpl.js'\nimport type { HTML5BackendContext, HTML5BackendOptions } from './types.js'\nexport { getEmptyImage } from './getEmptyImage.js'\nexport * as NativeTypes from './NativeTypes.js'\nexport type { HTML5BackendContext, HTML5BackendOptions } from './types.js'\n\nexport const HTML5Backend: BackendFactory = function createBackend(\n\tmanager: DragDropManager,\n\tcontext?: HTML5BackendContext,\n\toptions?: HTML5BackendOptions,\n): HTML5BackendImpl {\n\treturn new HTML5BackendImpl(manager, context, options)\n}\n","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\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// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\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 if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\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 } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\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\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\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\n return enhancer(createStore)(reducer, preloadedState);\n }\n\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\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\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\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\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\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\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\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\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\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\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\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\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\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} 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: function 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\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nvar legacy_createStore = createStore;\n\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 /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\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\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\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\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}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\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\n if (typeof reducer(undefined, {\n type: ActionTypes.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.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}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var 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\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\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\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function 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\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };\n","// cheap lodash replacements\n\n/**\n * drop-in replacement for _.get\n * @param obj\n * @param path\n * @param defaultValue\n */\nexport function get(obj: any, path: string, defaultValue: T): T {\n\treturn path\n\t\t.split('.')\n\t\t.reduce((a, c) => (a && a[c] ? a[c] : defaultValue || null), obj) as T\n}\n\n/**\n * drop-in replacement for _.without\n */\nexport function without(items: T[], item: T): T[] {\n\treturn items.filter((i) => i !== item)\n}\n\n/**\n * drop-in replacement for _.isString\n * @param input\n */\nexport function isString(input: any): boolean {\n\treturn typeof input === 'string'\n}\n\n/**\n * drop-in replacement for _.isString\n * @param input\n */\nexport function isObject(input: any): boolean {\n\treturn typeof input === 'object'\n}\n\n/**\n * replacement for _.xor\n * @param itemsA\n * @param itemsB\n */\nexport function xor(itemsA: T[], itemsB: T[]): T[] {\n\tconst map = new Map()\n\tconst insertItem = (item: T) => {\n\t\tmap.set(item, map.has(item) ? (map.get(item) as number) + 1 : 1)\n\t}\n\titemsA.forEach(insertItem)\n\titemsB.forEach(insertItem)\n\n\tconst result: T[] = []\n\tmap.forEach((count, key) => {\n\t\tif (count === 1) {\n\t\t\tresult.push(key)\n\t\t}\n\t})\n\treturn result\n}\n\n/**\n * replacement for _.intersection\n * @param itemsA\n * @param itemsB\n */\nexport function intersection(itemsA: T[], itemsB: T[]): T[] {\n\treturn itemsA.filter((t) => itemsB.indexOf(t) > -1)\n}\n","export const INIT_COORDS = 'dnd-core/INIT_COORDS'\nexport const BEGIN_DRAG = 'dnd-core/BEGIN_DRAG'\nexport const PUBLISH_DRAG_SOURCE = 'dnd-core/PUBLISH_DRAG_SOURCE'\nexport const HOVER = 'dnd-core/HOVER'\nexport const DROP = 'dnd-core/DROP'\nexport const END_DRAG = 'dnd-core/END_DRAG'\n","import type { AnyAction } from 'redux'\n\nimport type { XYCoord } from '../../../interfaces.js'\nimport { INIT_COORDS } from '../types.js'\n\nexport function setClientOffset(\n\tclientOffset: XYCoord | null | undefined,\n\tsourceClientOffset?: XYCoord | null | undefined,\n): AnyAction {\n\treturn {\n\t\ttype: INIT_COORDS,\n\t\tpayload: {\n\t\t\tsourceClientOffset: sourceClientOffset || null,\n\t\t\tclientOffset: clientOffset || null,\n\t\t},\n\t}\n}\n","import { invariant } from '@react-dnd/invariant'\n\nimport type {\n\tAction,\n\tBeginDragOptions,\n\tBeginDragPayload,\n\tDragDropManager,\n\tDragDropMonitor,\n\tHandlerRegistry,\n\tIdentifier,\n\tXYCoord,\n} from '../../interfaces.js'\nimport { isObject } from '../../utils/js_utils.js'\nimport { setClientOffset } from './local/setClientOffset.js'\nimport { BEGIN_DRAG, INIT_COORDS } from './types.js'\n\nconst ResetCoordinatesAction = {\n\ttype: INIT_COORDS,\n\tpayload: {\n\t\tclientOffset: null,\n\t\tsourceClientOffset: null,\n\t},\n}\n\nexport function createBeginDrag(manager: DragDropManager) {\n\treturn function beginDrag(\n\t\tsourceIds: Identifier[] = [],\n\t\toptions: BeginDragOptions = {\n\t\t\tpublishSource: true,\n\t\t},\n\t): Action | undefined {\n\t\tconst {\n\t\t\tpublishSource = true,\n\t\t\tclientOffset,\n\t\t\tgetSourceClientOffset,\n\t\t}: BeginDragOptions = options\n\t\tconst monitor = manager.getMonitor()\n\t\tconst registry = manager.getRegistry()\n\n\t\t// Initialize the coordinates using the client offset\n\t\tmanager.dispatch(setClientOffset(clientOffset))\n\n\t\tverifyInvariants(sourceIds, monitor, registry)\n\n\t\t// Get the draggable source\n\t\tconst sourceId = getDraggableSource(sourceIds, monitor)\n\t\tif (sourceId == null) {\n\t\t\tmanager.dispatch(ResetCoordinatesAction)\n\t\t\treturn\n\t\t}\n\n\t\t// Get the source client offset\n\t\tlet sourceClientOffset: XYCoord | null = null\n\t\tif (clientOffset) {\n\t\t\tif (!getSourceClientOffset) {\n\t\t\t\tthrow new Error('getSourceClientOffset must be defined')\n\t\t\t}\n\t\t\tverifyGetSourceClientOffsetIsFunction(getSourceClientOffset)\n\t\t\tsourceClientOffset = getSourceClientOffset(sourceId)\n\t\t}\n\n\t\t// Initialize the full coordinates\n\t\tmanager.dispatch(setClientOffset(clientOffset, sourceClientOffset))\n\n\t\tconst source = registry.getSource(sourceId)\n\t\tconst item = source.beginDrag(monitor, sourceId)\n\t\t// If source.beginDrag returns null, this is an indicator to cancel the drag\n\t\tif (item == null) {\n\t\t\treturn undefined\n\t\t}\n\t\tverifyItemIsObject(item)\n\t\tregistry.pinSource(sourceId)\n\n\t\tconst itemType = registry.getSourceType(sourceId)\n\t\treturn {\n\t\t\ttype: BEGIN_DRAG,\n\t\t\tpayload: {\n\t\t\t\titemType,\n\t\t\t\titem,\n\t\t\t\tsourceId,\n\t\t\t\tclientOffset: clientOffset || null,\n\t\t\t\tsourceClientOffset: sourceClientOffset || null,\n\t\t\t\tisSourcePublic: !!publishSource,\n\t\t\t},\n\t\t}\n\t}\n}\n\nfunction verifyInvariants(\n\tsourceIds: Identifier[],\n\tmonitor: DragDropMonitor,\n\tregistry: HandlerRegistry,\n) {\n\tinvariant(!monitor.isDragging(), 'Cannot call beginDrag while dragging.')\n\tsourceIds.forEach(function (sourceId) {\n\t\tinvariant(\n\t\t\tregistry.getSource(sourceId),\n\t\t\t'Expected sourceIds to be registered.',\n\t\t)\n\t})\n}\n\nfunction verifyGetSourceClientOffsetIsFunction(getSourceClientOffset: any) {\n\tinvariant(\n\t\ttypeof getSourceClientOffset === 'function',\n\t\t'When clientOffset is provided, getSourceClientOffset must be a function.',\n\t)\n}\n\nfunction verifyItemIsObject(item: any) {\n\tinvariant(isObject(item), 'Item must be an object.')\n}\n\nfunction getDraggableSource(sourceIds: Identifier[], monitor: DragDropMonitor) {\n\tlet sourceId = null\n\tfor (let i = sourceIds.length - 1; i >= 0; i--) {\n\t\tif (monitor.canDragSource(sourceIds[i])) {\n\t\t\tsourceId = sourceIds[i]\n\t\t\tbreak\n\t\t}\n\t}\n\treturn sourceId\n}\n","import { invariant } from '@react-dnd/invariant'\n\nimport type {\n\tAction,\n\tDragDropManager,\n\tDragDropMonitor,\n\tDropPayload,\n\tHandlerRegistry,\n\tIdentifier,\n} from '../../interfaces.js'\nimport { isObject } from '../../utils/js_utils.js'\nimport { DROP } from './types.js'\n\nexport function createDrop(manager: DragDropManager) {\n\treturn function drop(options = {}): void {\n\t\tconst monitor = manager.getMonitor()\n\t\tconst registry = manager.getRegistry()\n\t\tverifyInvariants(monitor)\n\t\tconst targetIds = getDroppableTargets(monitor)\n\n\t\t// Multiple actions are dispatched here, which is why this doesn't return an action\n\t\ttargetIds.forEach((targetId, index) => {\n\t\t\tconst dropResult = determineDropResult(targetId, index, registry, monitor)\n\t\t\tconst action: Action = {\n\t\t\t\ttype: DROP,\n\t\t\t\tpayload: {\n\t\t\t\t\tdropResult: {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\t...dropResult,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tmanager.dispatch(action)\n\t\t})\n\t}\n}\n\nfunction verifyInvariants(monitor: DragDropMonitor) {\n\tinvariant(monitor.isDragging(), 'Cannot call drop while not dragging.')\n\tinvariant(\n\t\t!monitor.didDrop(),\n\t\t'Cannot call drop twice during one drag operation.',\n\t)\n}\n\nfunction determineDropResult(\n\ttargetId: Identifier,\n\tindex: number,\n\tregistry: HandlerRegistry,\n\tmonitor: DragDropMonitor,\n) {\n\tconst target = registry.getTarget(targetId)\n\tlet dropResult = target ? target.drop(monitor, targetId) : undefined\n\tverifyDropResultType(dropResult)\n\tif (typeof dropResult === 'undefined') {\n\t\tdropResult = index === 0 ? {} : monitor.getDropResult()\n\t}\n\treturn dropResult\n}\n\nfunction verifyDropResultType(dropResult: any) {\n\tinvariant(\n\t\ttypeof dropResult === 'undefined' || isObject(dropResult),\n\t\t'Drop result must either be an object or undefined.',\n\t)\n}\n\nfunction getDroppableTargets(monitor: DragDropMonitor) {\n\tconst targetIds = monitor\n\t\t.getTargetIds()\n\t\t.filter(monitor.canDropOnTarget, monitor)\n\ttargetIds.reverse()\n\treturn targetIds\n}\n","import { invariant } from '@react-dnd/invariant'\n\nimport type {\n\tDragDropManager,\n\tDragDropMonitor,\n\tSentinelAction,\n} from '../../interfaces.js'\nimport { END_DRAG } from './types.js'\n\nexport function createEndDrag(manager: DragDropManager) {\n\treturn function endDrag(): SentinelAction {\n\t\tconst monitor = manager.getMonitor()\n\t\tconst registry = manager.getRegistry()\n\t\tverifyIsDragging(monitor)\n\n\t\tconst sourceId = monitor.getSourceId()\n\t\tif (sourceId != null) {\n\t\t\tconst source = registry.getSource(sourceId, true)\n\t\t\tsource.endDrag(monitor, sourceId)\n\t\t\tregistry.unpinSource()\n\t\t}\n\t\treturn { type: END_DRAG }\n\t}\n}\n\nfunction verifyIsDragging(monitor: DragDropMonitor) {\n\tinvariant(monitor.isDragging(), 'Cannot call endDrag while not dragging.')\n}\n","import type { Identifier } from '../interfaces.js'\n\nexport function matchesType(\n\ttargetType: Identifier | Identifier[] | null,\n\tdraggedItemType: Identifier | null,\n): boolean {\n\tif (draggedItemType === null) {\n\t\treturn targetType === null\n\t}\n\treturn Array.isArray(targetType)\n\t\t? (targetType as Identifier[]).some((t) => t === draggedItemType)\n\t\t: targetType === draggedItemType\n}\n","import { invariant } from '@react-dnd/invariant'\n\nimport type {\n\tAction,\n\tDragDropManager,\n\tDragDropMonitor,\n\tHandlerRegistry,\n\tHoverOptions,\n\tHoverPayload,\n\tIdentifier,\n} from '../../interfaces.js'\nimport { matchesType } from '../../utils/matchesType.js'\nimport { HOVER } from './types.js'\n\nexport function createHover(manager: DragDropManager) {\n\treturn function hover(\n\t\ttargetIdsArg: string[],\n\t\t{ clientOffset }: HoverOptions = {},\n\t): Action {\n\t\tverifyTargetIdsIsArray(targetIdsArg)\n\t\tconst targetIds = targetIdsArg.slice(0)\n\t\tconst monitor = manager.getMonitor()\n\t\tconst registry = manager.getRegistry()\n\t\tconst draggedItemType = monitor.getItemType()\n\t\tremoveNonMatchingTargetIds(targetIds, registry, draggedItemType)\n\t\tcheckInvariants(targetIds, monitor, registry)\n\t\thoverAllTargets(targetIds, monitor, registry)\n\n\t\treturn {\n\t\t\ttype: HOVER,\n\t\t\tpayload: {\n\t\t\t\ttargetIds,\n\t\t\t\tclientOffset: clientOffset || null,\n\t\t\t},\n\t\t}\n\t}\n}\n\nfunction verifyTargetIdsIsArray(targetIdsArg: string[]) {\n\tinvariant(Array.isArray(targetIdsArg), 'Expected targetIds to be an array.')\n}\n\nfunction checkInvariants(\n\ttargetIds: string[],\n\tmonitor: DragDropMonitor,\n\tregistry: HandlerRegistry,\n) {\n\tinvariant(monitor.isDragging(), 'Cannot call hover while not dragging.')\n\tinvariant(!monitor.didDrop(), 'Cannot call hover after drop.')\n\tfor (let i = 0; i < targetIds.length; i++) {\n\t\tconst targetId = targetIds[i] as string\n\t\tinvariant(\n\t\t\ttargetIds.lastIndexOf(targetId) === i,\n\t\t\t'Expected targetIds to be unique in the passed array.',\n\t\t)\n\n\t\tconst target = registry.getTarget(targetId)\n\t\tinvariant(target, 'Expected targetIds to be registered.')\n\t}\n}\n\nfunction removeNonMatchingTargetIds(\n\ttargetIds: string[],\n\tregistry: HandlerRegistry,\n\tdraggedItemType: Identifier | null,\n) {\n\t// Remove those targetIds that don't match the targetType. This\n\t// fixes shallow isOver which would only be non-shallow because of\n\t// non-matching targets.\n\tfor (let i = targetIds.length - 1; i >= 0; i--) {\n\t\tconst targetId = targetIds[i] as string\n\t\tconst targetType = registry.getTargetType(targetId)\n\t\tif (!matchesType(targetType, draggedItemType)) {\n\t\t\ttargetIds.splice(i, 1)\n\t\t}\n\t}\n}\n\nfunction hoverAllTargets(\n\ttargetIds: string[],\n\tmonitor: DragDropMonitor,\n\tregistry: HandlerRegistry,\n) {\n\t// Finally call hover on all matching targets.\n\ttargetIds.forEach(function (targetId) {\n\t\tconst target = registry.getTarget(targetId)\n\t\ttarget.hover(monitor, targetId)\n\t})\n}\n","import type { DragDropManager, SentinelAction } from '../../interfaces.js'\nimport { PUBLISH_DRAG_SOURCE } from './types.js'\n\nexport function createPublishDragSource(manager: DragDropManager) {\n\treturn function publishDragSource(): SentinelAction | undefined {\n\t\tconst monitor = manager.getMonitor()\n\t\tif (monitor.isDragging()) {\n\t\t\treturn { type: PUBLISH_DRAG_SOURCE }\n\t\t}\n\t\treturn\n\t}\n}\n","import type { Action, Store } from 'redux'\n\nimport { createDragDropActions } from '../actions/dragDrop/index.js'\nimport type {\n\tActionCreator,\n\tBackend,\n\tDragDropActions,\n\tDragDropManager,\n\tDragDropMonitor,\n\tHandlerRegistry,\n} from '../interfaces.js'\nimport type { State } from '../reducers/index.js'\nimport type { DragDropMonitorImpl } from './DragDropMonitorImpl.js'\n\nexport class DragDropManagerImpl implements DragDropManager {\n\tprivate store: Store\n\tprivate monitor: DragDropMonitor\n\tprivate backend: Backend | undefined\n\tprivate isSetUp = false\n\n\tpublic constructor(store: Store, monitor: DragDropMonitor) {\n\t\tthis.store = store\n\t\tthis.monitor = monitor\n\t\tstore.subscribe(this.handleRefCountChange)\n\t}\n\n\tpublic receiveBackend(backend: Backend): void {\n\t\tthis.backend = backend\n\t}\n\n\tpublic getMonitor(): DragDropMonitor {\n\t\treturn this.monitor\n\t}\n\n\tpublic getBackend(): Backend {\n\t\treturn this.backend as Backend\n\t}\n\n\tpublic getRegistry(): HandlerRegistry {\n\t\treturn (this.monitor as DragDropMonitorImpl).registry\n\t}\n\n\tpublic getActions(): DragDropActions {\n\t\t/* eslint-disable-next-line @typescript-eslint/no-this-alias */\n\t\tconst manager = this\n\t\tconst { dispatch } = this.store\n\n\t\tfunction bindActionCreator(actionCreator: ActionCreator) {\n\t\t\treturn (...args: any[]) => {\n\t\t\t\tconst action = actionCreator.apply(manager, args as any)\n\t\t\t\tif (typeof action !== 'undefined') {\n\t\t\t\t\tdispatch(action)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst actions = createDragDropActions(this)\n\n\t\treturn Object.keys(actions).reduce(\n\t\t\t(boundActions: DragDropActions, key: string) => {\n\t\t\t\tconst action: ActionCreator = (actions as any)[\n\t\t\t\t\tkey\n\t\t\t\t] as ActionCreator\n\t\t\t\t;(boundActions as any)[key] = bindActionCreator(action)\n\t\t\t\treturn boundActions\n\t\t\t},\n\t\t\t{} as DragDropActions,\n\t\t)\n\t}\n\n\tpublic dispatch(action: Action): void {\n\t\tthis.store.dispatch(action)\n\t}\n\n\tprivate handleRefCountChange = (): void => {\n\t\tconst shouldSetUp = this.store.getState().refCount > 0\n\t\tif (this.backend) {\n\t\t\tif (shouldSetUp && !this.isSetUp) {\n\t\t\t\tthis.backend.setup()\n\t\t\t\tthis.isSetUp = true\n\t\t\t} else if (!shouldSetUp && this.isSetUp) {\n\t\t\t\tthis.backend.teardown()\n\t\t\t\tthis.isSetUp = false\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { DragDropActions, DragDropManager } from '../../interfaces.js'\nimport { createBeginDrag } from './beginDrag.js'\nimport { createDrop } from './drop.js'\nimport { createEndDrag } from './endDrag.js'\nimport { createHover } from './hover.js'\nimport { createPublishDragSource } from './publishDragSource.js'\n\nexport * from './types.js'\n\nexport function createDragDropActions(\n\tmanager: DragDropManager,\n): DragDropActions {\n\treturn {\n\t\tbeginDrag: createBeginDrag(manager),\n\t\tpublishDragSource: createPublishDragSource(manager),\n\t\thover: createHover(manager),\n\t\tdrop: createDrop(manager),\n\t\tendDrag: createEndDrag(manager),\n\t}\n}\n","import type { XYCoord } from '../interfaces.js'\nimport type { State } from '../reducers/dragOffset.js'\n\n/**\n * Coordinate addition\n * @param a The first coordinate\n * @param b The second coordinate\n */\nexport function add(a: XYCoord, b: XYCoord): XYCoord {\n\treturn {\n\t\tx: a.x + b.x,\n\t\ty: a.y + b.y,\n\t}\n}\n\n/**\n * Coordinate subtraction\n * @param a The first coordinate\n * @param b The second coordinate\n */\nexport function subtract(a: XYCoord, b: XYCoord): XYCoord {\n\treturn {\n\t\tx: a.x - b.x,\n\t\ty: a.y - b.y,\n\t}\n}\n\n/**\n * Returns the cartesian distance of the drag source component's position, based on its position\n * at the time when the current drag operation has started, and the movement difference.\n *\n * Returns null if no item is being dragged.\n *\n * @param state The offset state to compute from\n */\nexport function getSourceClientOffset(state: State): XYCoord | null {\n\tconst { clientOffset, initialClientOffset, initialSourceClientOffset } = state\n\tif (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {\n\t\treturn null\n\t}\n\treturn subtract(\n\t\tadd(clientOffset, initialSourceClientOffset),\n\t\tinitialClientOffset,\n\t)\n}\n\n/**\n * Determines the x,y offset between the client offset and the initial client offset\n *\n * @param state The offset state to compute from\n */\nexport function getDifferenceFromInitialOffset(state: State): XYCoord | null {\n\tconst { clientOffset, initialClientOffset } = state\n\tif (!clientOffset || !initialClientOffset) {\n\t\treturn null\n\t}\n\treturn subtract(clientOffset, initialClientOffset)\n}\n","import { intersection } from './js_utils.js'\n\nexport const NONE: string[] = []\nexport const ALL: string[] = []\n// Add these flags for debug\n;(NONE as any).__IS_NONE__ = true\n;(ALL as any).__IS_ALL__ = true\n\n/**\n * Determines if the given handler IDs are dirty or not.\n *\n * @param dirtyIds The set of dirty handler ids\n * @param handlerIds The set of handler ids to check\n */\nexport function areDirty(\n\tdirtyIds: string[],\n\thandlerIds: string[] | undefined,\n): boolean {\n\tif (dirtyIds === NONE) {\n\t\treturn false\n\t}\n\n\tif (dirtyIds === ALL || typeof handlerIds === 'undefined') {\n\t\treturn true\n\t}\n\n\tconst commonIds = intersection(handlerIds, dirtyIds)\n\treturn commonIds.length > 0\n}\n","import { invariant } from '@react-dnd/invariant'\nimport type { Store } from 'redux'\n\nimport type {\n\tDragDropMonitor,\n\tHandlerRegistry,\n\tIdentifier,\n\tListener,\n\tUnsubscribe,\n\tXYCoord,\n} from '../interfaces.js'\nimport type { State } from '../reducers/index.js'\nimport {\n\tgetDifferenceFromInitialOffset,\n\tgetSourceClientOffset,\n} from '../utils/coords.js'\nimport { areDirty } from '../utils/dirtiness.js'\nimport { matchesType } from '../utils/matchesType.js'\n\nexport class DragDropMonitorImpl implements DragDropMonitor {\n\tprivate store: Store\n\tpublic readonly registry: HandlerRegistry\n\n\tpublic constructor(store: Store, registry: HandlerRegistry) {\n\t\tthis.store = store\n\t\tthis.registry = registry\n\t}\n\n\tpublic subscribeToStateChange(\n\t\tlistener: Listener,\n\t\toptions: { handlerIds?: string[] } = {},\n\t): Unsubscribe {\n\t\tconst { handlerIds } = options\n\t\tinvariant(typeof listener === 'function', 'listener must be a function.')\n\t\tinvariant(\n\t\t\ttypeof handlerIds === 'undefined' || Array.isArray(handlerIds),\n\t\t\t'handlerIds, when specified, must be an array of strings.',\n\t\t)\n\n\t\tlet prevStateId = this.store.getState().stateId\n\t\tconst handleChange = () => {\n\t\t\tconst state = this.store.getState()\n\t\t\tconst currentStateId = state.stateId\n\t\t\ttry {\n\t\t\t\tconst canSkipListener =\n\t\t\t\t\tcurrentStateId === prevStateId ||\n\t\t\t\t\t(currentStateId === prevStateId + 1 &&\n\t\t\t\t\t\t!areDirty(state.dirtyHandlerIds, handlerIds))\n\n\t\t\t\tif (!canSkipListener) {\n\t\t\t\t\tlistener()\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tprevStateId = currentStateId\n\t\t\t}\n\t\t}\n\n\t\treturn this.store.subscribe(handleChange)\n\t}\n\n\tpublic subscribeToOffsetChange(listener: Listener): Unsubscribe {\n\t\tinvariant(typeof listener === 'function', 'listener must be a function.')\n\n\t\tlet previousState = this.store.getState().dragOffset\n\t\tconst handleChange = () => {\n\t\t\tconst nextState = this.store.getState().dragOffset\n\t\t\tif (nextState === previousState) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tpreviousState = nextState\n\t\t\tlistener()\n\t\t}\n\n\t\treturn this.store.subscribe(handleChange)\n\t}\n\n\tpublic canDragSource(sourceId: string | undefined): boolean {\n\t\tif (!sourceId) {\n\t\t\treturn false\n\t\t}\n\t\tconst source = this.registry.getSource(sourceId)\n\t\tinvariant(source, `Expected to find a valid source. sourceId=${sourceId}`)\n\n\t\tif (this.isDragging()) {\n\t\t\treturn false\n\t\t}\n\n\t\treturn source.canDrag(this, sourceId)\n\t}\n\n\tpublic canDropOnTarget(targetId: string | undefined): boolean {\n\t\t// undefined on initial render\n\t\tif (!targetId) {\n\t\t\treturn false\n\t\t}\n\t\tconst target = this.registry.getTarget(targetId)\n\t\tinvariant(target, `Expected to find a valid target. targetId=${targetId}`)\n\n\t\tif (!this.isDragging() || this.didDrop()) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst targetType = this.registry.getTargetType(targetId)\n\t\tconst draggedItemType = this.getItemType()\n\t\treturn (\n\t\t\tmatchesType(targetType, draggedItemType) && target.canDrop(this, targetId)\n\t\t)\n\t}\n\n\tpublic isDragging(): boolean {\n\t\treturn Boolean(this.getItemType())\n\t}\n\n\tpublic isDraggingSource(sourceId: string | undefined): boolean {\n\t\t// undefined on initial render\n\t\tif (!sourceId) {\n\t\t\treturn false\n\t\t}\n\t\tconst source = this.registry.getSource(sourceId, true)\n\t\tinvariant(source, `Expected to find a valid source. sourceId=${sourceId}`)\n\n\t\tif (!this.isDragging() || !this.isSourcePublic()) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst sourceType = this.registry.getSourceType(sourceId)\n\t\tconst draggedItemType = this.getItemType()\n\t\tif (sourceType !== draggedItemType) {\n\t\t\treturn false\n\t\t}\n\n\t\treturn source.isDragging(this, sourceId)\n\t}\n\n\tpublic isOverTarget(\n\t\ttargetId: string | undefined,\n\t\toptions = { shallow: false },\n\t): boolean {\n\t\t// undefined on initial render\n\t\tif (!targetId) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst { shallow } = options\n\t\tif (!this.isDragging()) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst targetType = this.registry.getTargetType(targetId)\n\t\tconst draggedItemType = this.getItemType()\n\t\tif (draggedItemType && !matchesType(targetType, draggedItemType)) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst targetIds = this.getTargetIds()\n\t\tif (!targetIds.length) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst index = targetIds.indexOf(targetId)\n\t\tif (shallow) {\n\t\t\treturn index === targetIds.length - 1\n\t\t} else {\n\t\t\treturn index > -1\n\t\t}\n\t}\n\n\tpublic getItemType(): Identifier {\n\t\treturn this.store.getState().dragOperation.itemType as Identifier\n\t}\n\n\tpublic getItem(): any {\n\t\treturn this.store.getState().dragOperation.item\n\t}\n\n\tpublic getSourceId(): string | null {\n\t\treturn this.store.getState().dragOperation.sourceId\n\t}\n\n\tpublic getTargetIds(): string[] {\n\t\treturn this.store.getState().dragOperation.targetIds\n\t}\n\n\tpublic getDropResult(): any {\n\t\treturn this.store.getState().dragOperation.dropResult\n\t}\n\n\tpublic didDrop(): boolean {\n\t\treturn this.store.getState().dragOperation.didDrop\n\t}\n\n\tpublic isSourcePublic(): boolean {\n\t\treturn Boolean(this.store.getState().dragOperation.isSourcePublic)\n\t}\n\n\tpublic getInitialClientOffset(): XYCoord | null {\n\t\treturn this.store.getState().dragOffset.initialClientOffset\n\t}\n\n\tpublic getInitialSourceClientOffset(): XYCoord | null {\n\t\treturn this.store.getState().dragOffset.initialSourceClientOffset\n\t}\n\n\tpublic getClientOffset(): XYCoord | null {\n\t\treturn this.store.getState().dragOffset.clientOffset\n\t}\n\n\tpublic getSourceClientOffset(): XYCoord | null {\n\t\treturn getSourceClientOffset(this.store.getState().dragOffset)\n\t}\n\n\tpublic getDifferenceFromInitialOffset(): XYCoord | null {\n\t\treturn getDifferenceFromInitialOffset(this.store.getState().dragOffset)\n\t}\n}\n","// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\nconst scope = typeof global !== 'undefined' ? global : self\nconst BrowserMutationObserver =\n\t(scope as any).MutationObserver || (scope as any).WebKitMutationObserver\n\nexport function makeRequestCallFromTimer(callback: () => void) {\n\treturn function requestCall() {\n\t\t// We dispatch a timeout with a specified delay of 0 for engines that\n\t\t// can reliably accommodate that request. This will usually be snapped\n\t\t// to a 4 milisecond delay, but once we're flushing, there's no delay\n\t\t// between events.\n\t\tconst timeoutHandle = setTimeout(handleTimer, 0)\n\t\t// However, since this timer gets frequently dropped in Firefox\n\t\t// workers, we enlist an interval handle that will try to fire\n\t\t// an event 20 times per second until it succeeds.\n\t\tconst intervalHandle = setInterval(handleTimer, 50)\n\n\t\tfunction handleTimer() {\n\t\t\t// Whichever timer succeeds will cancel both timers and\n\t\t\t// execute the callback.\n\t\t\tclearTimeout(timeoutHandle)\n\t\t\tclearInterval(intervalHandle)\n\t\t\tcallback()\n\t\t}\n\t}\n}\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\nexport function makeRequestCallFromMutationObserver(callback: () => void) {\n\tlet toggle = 1\n\tconst observer = new BrowserMutationObserver(callback)\n\tconst node = document.createTextNode('')\n\tobserver.observe(node, { characterData: true })\n\treturn function requestCall() {\n\t\ttoggle = -toggle\n\t\t;(node as any).data = toggle\n\t}\n}\n\nexport const makeRequestCall =\n\ttypeof BrowserMutationObserver === 'function'\n\t\t? // MutationObservers are desirable because they have high priority and work\n\t\t // reliably everywhere they are implemented.\n\t\t // They are implemented in all modern browsers.\n\t\t //\n\t\t // - Android 4-4.3\n\t\t // - Chrome 26-34\n\t\t // - Firefox 14-29\n\t\t // - Internet Explorer 11\n\t\t // - iPad Safari 6-7.1\n\t\t // - iPhone Safari 7-7.1\n\t\t // - Safari 6-7\n\t\t makeRequestCallFromMutationObserver\n\t\t: // MessageChannels are desirable because they give direct access to the HTML\n\t\t // task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n\t\t // 11-12, and in web workers in many engines.\n\t\t // Although message channels yield to any queued rendering and IO tasks, they\n\t\t // would be better than imposing the 4ms delay of timers.\n\t\t // However, they do not work reliably in Internet Explorer or Safari.\n\n\t\t // Internet Explorer 10 is the only browser that has setImmediate but does\n\t\t // not have MutationObservers.\n\t\t // Although setImmediate yields to the browser's renderer, it would be\n\t\t // preferrable to falling back to setTimeout since it does not have\n\t\t // the minimum 4ms penalty.\n\t\t // Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n\t\t // Desktop to a lesser extent) that renders both setImmediate and\n\t\t // MessageChannel useless for the purposes of ASAP.\n\t\t // https://github.com/kriskowal/q/issues/396\n\n\t\t // Timers are implemented universally.\n\t\t // We fall back to timers in workers in most engines, and in foreground\n\t\t // contexts in the following browsers.\n\t\t // However, note that even this simple case requires nuances to operate in a\n\t\t // broad spectrum of browsers.\n\t\t //\n\t\t // - Firefox 3-13\n\t\t // - Internet Explorer 6-9\n\t\t // - iPad Safari 4.3\n\t\t // - Lynx 2.8.7\n\t\t makeRequestCallFromTimer\n","/* eslint-disable no-restricted-globals, @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-non-null-assertion */\nimport { makeRequestCall, makeRequestCallFromTimer } from './makeRequestCall.js'\nimport type { Task } from './types.js'\n\nexport class AsapQueue {\n\tprivate queue: Task[] = []\n\t// We queue errors to ensure they are thrown in right order (FIFO).\n\t// Array-as-queue is good enough here, since we are just dealing with exceptions.\n\tprivate pendingErrors: any[] = []\n\t// Once a flush has been requested, no further calls to `requestFlush` are\n\t// necessary until the next `flush` completes.\n\t// @ts-ignore\n\tprivate flushing = false\n\t// `requestFlush` is an implementation-specific method that attempts to kick\n\t// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n\t// the event queue before yielding to the browser's own event loop.\n\tprivate requestFlush: () => void\n\n\tprivate requestErrorThrow: () => void\n\t// The position of the next task to execute in the task queue. This is\n\t// preserved between calls to `flush` so that it can be resumed if\n\t// a task throws an exception.\n\tprivate index = 0\n\t// If a task schedules additional tasks recursively, the task queue can grow\n\t// unbounded. To prevent memory exhaustion, the task queue will periodically\n\t// truncate already-completed tasks.\n\tprivate capacity = 1024\n\n\tpublic constructor() {\n\t\t// `requestFlush` requests that the high priority event queue be flushed as\n\t\t// soon as possible.\n\t\t// This is useful to prevent an error thrown in a task from stalling the event\n\t\t// queue if the exception handled by Node.js’s\n\t\t// `process.on(\"uncaughtException\")` or by a domain.\n\n\t\t// `requestFlush` is implemented using a strategy based on data collected from\n\t\t// every available SauceLabs Selenium web driver worker at time of writing.\n\t\t// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\t\tthis.requestFlush = makeRequestCall(this.flush)\n\t\tthis.requestErrorThrow = makeRequestCallFromTimer(() => {\n\t\t\t// Throw first error\n\t\t\tif (this.pendingErrors.length) {\n\t\t\t\tthrow this.pendingErrors.shift()\n\t\t\t}\n\t\t})\n\t}\n\n\t// Use the fastest means possible to execute a task in its own turn, with\n\t// priority over other events including IO, animation, reflow, and redraw\n\t// events in browsers.\n\t//\n\t// An exception thrown by a task will permanently interrupt the processing of\n\t// subsequent tasks. The higher level `asap` function ensures that if an\n\t// exception is thrown by a task, that the task queue will continue flushing as\n\t// soon as possible, but if you use `rawAsap` directly, you are responsible to\n\t// either ensure that no exceptions are thrown from your task, or to manually\n\t// call `rawAsap.requestFlush` if an exception is thrown.\n\tpublic enqueueTask(task: Task): void {\n\t\tconst { queue: q, requestFlush } = this\n\t\tif (!q.length) {\n\t\t\trequestFlush()\n\t\t\tthis.flushing = true\n\t\t}\n\t\t// Equivalent to push, but avoids a function call.\n\t\tq[q.length] = task\n\t}\n\n\t// The flush function processes all tasks that have been scheduled with\n\t// `rawAsap` unless and until one of those tasks throws an exception.\n\t// If a task throws an exception, `flush` ensures that its state will remain\n\t// consistent and will resume where it left off when called again.\n\t// However, `flush` does not make any arrangements to be called again if an\n\t// exception is thrown.\n\tprivate flush = () => {\n\t\tconst { queue: q } = this\n\t\twhile (this.index < q.length) {\n\t\t\tconst currentIndex = this.index\n\t\t\t// Advance the index before calling the task. This ensures that we will\n\t\t\t// begin flushing on the next task the task throws an error.\n\t\t\tthis.index++\n\t\t\tq[currentIndex]!.call()\n\t\t\t// Prevent leaking memory for long chains of recursive calls to `asap`.\n\t\t\t// If we call `asap` within tasks scheduled by `asap`, the queue will\n\t\t\t// grow, but to avoid an O(n) walk for every task we execute, we don't\n\t\t\t// shift tasks off the queue after they have been executed.\n\t\t\t// Instead, we periodically shift 1024 tasks off the queue.\n\t\t\tif (this.index > this.capacity) {\n\t\t\t\t// Manually shift all values starting at the index back to the\n\t\t\t\t// beginning of the queue.\n\t\t\t\tfor (\n\t\t\t\t\tlet scan = 0, newLength = q.length - this.index;\n\t\t\t\t\tscan < newLength;\n\t\t\t\t\tscan++\n\t\t\t\t) {\n\t\t\t\t\tq[scan] = q[scan + this.index]!\n\t\t\t\t}\n\t\t\t\tq.length -= this.index\n\t\t\t\tthis.index = 0\n\t\t\t}\n\t\t}\n\t\tq.length = 0\n\t\tthis.index = 0\n\t\tthis.flushing = false\n\t}\n\n\t// In a web browser, exceptions are not fatal. However, to avoid\n\t// slowing down the queue of pending tasks, we rethrow the error in a\n\t// lower priority turn.\n\tpublic registerPendingError = (err: any) => {\n\t\tthis.pendingErrors.push(err)\n\t\tthis.requestErrorThrow()\n\t}\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// // its existence.\n// rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n","// We wrap tasks with recyclable task objects. A task object implements\n\nimport type { Task, TaskFn } from 'types'\n\n// `call`, just like a function.\nexport class RawTask implements Task {\n\tpublic task: TaskFn | null = null\n\n\tpublic constructor(\n\t\tprivate onError: (err: any) => void,\n\t\tprivate release: (t: RawTask) => void,\n\t) {}\n\n\tpublic call() {\n\t\ttry {\n\t\t\tthis.task && this.task()\n\t\t} catch (error) {\n\t\t\tthis.onError(error)\n\t\t} finally {\n\t\t\tthis.task = null\n\t\t\tthis.release(this)\n\t\t}\n\t}\n}\n","import { RawTask } from './RawTask.js'\nimport type { Task } from './types.js'\n\nexport class TaskFactory {\n\tprivate freeTasks: RawTask[] = []\n\n\tpublic constructor(private onError: (err: any) => void) {}\n\n\tpublic create(task: () => void): Task {\n\t\tconst tasks = this.freeTasks\n\t\tconst t = tasks.length\n\t\t\t? (tasks.pop() as RawTask)\n\t\t\t: new RawTask(this.onError, (t) => (tasks[tasks.length] = t))\n\t\tt.task = task\n\t\treturn t\n\t}\n}\n","import { AsapQueue } from './AsapQueue.js'\nimport { TaskFactory } from './TaskFactory.js'\nimport type { TaskFn } from './types.js'\n\nconst asapQueue = new AsapQueue()\nconst taskFactory = new TaskFactory(asapQueue.registerPendingError)\n\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\nexport function asap(task: TaskFn) {\n\tasapQueue.enqueueTask(taskFactory.create(task))\n}\n","import type { Action, SourceIdPayload, TargetIdPayload } from '../interfaces.js'\n\nexport const ADD_SOURCE = 'dnd-core/ADD_SOURCE'\nexport const ADD_TARGET = 'dnd-core/ADD_TARGET'\nexport const REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE'\nexport const REMOVE_TARGET = 'dnd-core/REMOVE_TARGET'\n\nexport function addSource(sourceId: string): Action {\n\treturn {\n\t\ttype: ADD_SOURCE,\n\t\tpayload: {\n\t\t\tsourceId,\n\t\t},\n\t}\n}\n\nexport function addTarget(targetId: string): Action {\n\treturn {\n\t\ttype: ADD_TARGET,\n\t\tpayload: {\n\t\t\ttargetId,\n\t\t},\n\t}\n}\n\nexport function removeSource(sourceId: string): Action {\n\treturn {\n\t\ttype: REMOVE_SOURCE,\n\t\tpayload: {\n\t\t\tsourceId,\n\t\t},\n\t}\n}\n\nexport function removeTarget(targetId: string): Action {\n\treturn {\n\t\ttype: REMOVE_TARGET,\n\t\tpayload: {\n\t\t\ttargetId,\n\t\t},\n\t}\n}\n","export type Identifier = string | symbol\nexport type SourceType = Identifier\nexport type TargetType = Identifier | Identifier[]\nexport type Unsubscribe = () => void\nexport type Listener = () => void\n\nexport interface XYCoord {\n\tx: number\n\ty: number\n}\n\nexport enum HandlerRole {\n\tSOURCE = 'SOURCE',\n\tTARGET = 'TARGET',\n}\n\nexport interface Backend {\n\tsetup(): void\n\tteardown(): void\n\tconnectDragSource(sourceId: any, node?: any, options?: any): Unsubscribe\n\tconnectDragPreview(sourceId: any, node?: any, options?: any): Unsubscribe\n\tconnectDropTarget(targetId: any, node?: any, options?: any): Unsubscribe\n\tprofile(): Record\n}\n\nexport interface DragDropMonitor {\n\tsubscribeToStateChange(\n\t\tlistener: Listener,\n\t\toptions?: {\n\t\t\thandlerIds?: Identifier[]\n\t\t},\n\t): Unsubscribe\n\tsubscribeToOffsetChange(listener: Listener): Unsubscribe\n\tcanDragSource(sourceId: Identifier | undefined): boolean\n\tcanDropOnTarget(targetId: Identifier | undefined): boolean\n\n\t/**\n\t * Returns true if a drag operation is in progress, and either the owner initiated the drag, or its isDragging()\n\t * is defined and returns true.\n\t */\n\tisDragging(): boolean\n\tisDraggingSource(sourceId: Identifier | undefined): boolean\n\tisOverTarget(\n\t\ttargetId: Identifier | undefined,\n\t\toptions?: {\n\t\t\tshallow?: boolean\n\t\t},\n\t): boolean\n\n\t/**\n\t * Returns a string or a symbol identifying the type of the current dragged item. Returns null if no item is being dragged.\n\t */\n\tgetItemType(): Identifier | null\n\n\t/**\n\t * Returns a plain object representing the currently dragged item. Every drag source must specify it by returning an object\n\t * from its beginDrag() method. Returns null if no item is being dragged.\n\t */\n\tgetItem(): any\n\tgetSourceId(): Identifier | null\n\tgetTargetIds(): Identifier[]\n\t/**\n\t * Returns a plain object representing the last recorded drop result. The drop targets may optionally specify it by returning an\n\t * object from their drop() methods. When a chain of drop() is dispatched for the nested targets, bottom up, any parent that\n\t * explicitly returns its own result from drop() overrides the child drop result previously set by the child. Returns null if\n\t * called outside endDrag().\n\t */\n\tgetDropResult(): any\n\t/**\n\t * Returns true if some drop target has handled the drop event, false otherwise. Even if a target did not return a drop result,\n\t * didDrop() returns true. Use it inside endDrag() to test whether any drop target has handled the drop. Returns false if called\n\t * outside endDrag().\n\t */\n\tdidDrop(): boolean\n\tisSourcePublic(): boolean | null\n\t/**\n\t * Returns the { x, y } client offset of the pointer at the time when the current drag operation has started.\n\t * Returns null if no item is being dragged.\n\t */\n\tgetInitialClientOffset(): XYCoord | null\n\t/**\n\t * Returns the { x, y } client offset of the drag source component's root DOM node at the time when the current drag\n\t * operation has started. Returns null if no item is being dragged.\n\t */\n\tgetInitialSourceClientOffset(): XYCoord | null\n\n\t/**\n\t * Returns the last recorded { x, y } client offset of the pointer while a drag operation is in progress.\n\t * Returns null if no item is being dragged.\n\t */\n\tgetClientOffset(): XYCoord | null\n\n\t/**\n\t * Returns the projected { x, y } client offset of the drag source component's root DOM node, based on its position at the time\n\t * when the current drag operation has started, and the movement difference. Returns null if no item is being dragged.\n\t */\n\tgetSourceClientOffset(): XYCoord | null\n\n\t/**\n\t * Returns the { x, y } difference between the last recorded client offset of the pointer and the client offset when the current\n\t * drag operation has started. Returns null if no item is being dragged.\n\t */\n\tgetDifferenceFromInitialOffset(): XYCoord | null\n}\n\nexport interface HandlerRegistry {\n\taddSource(type: SourceType, source: DragSource): Identifier\n\taddTarget(type: TargetType, target: DropTarget): Identifier\n\tcontainsHandler(handler: DragSource | DropTarget): boolean\n\tgetSource(sourceId: Identifier, includePinned?: boolean): DragSource\n\tgetSourceType(sourceId: Identifier): SourceType\n\tgetTargetType(targetId: Identifier): TargetType\n\tgetTarget(targetId: Identifier): DropTarget\n\tisSourceId(handlerId: Identifier): boolean\n\tisTargetId(handlerId: Identifier): boolean\n\tremoveSource(sourceId: Identifier): void\n\tremoveTarget(targetId: Identifier): void\n\tpinSource(sourceId: Identifier): void\n\tunpinSource(): void\n}\n\nexport interface Action {\n\ttype: Identifier\n\tpayload: Payload\n}\nexport interface SentinelAction {\n\ttype: Identifier\n}\n\nexport type ActionCreator = (args: any[]) => Action\n\nexport interface BeginDragOptions {\n\tpublishSource?: boolean\n\tclientOffset?: XYCoord\n\tgetSourceClientOffset?: (sourceId: Identifier | undefined) => XYCoord\n}\n\nexport interface InitCoordsPayload {\n\tclientOffset: XYCoord | null\n\tsourceClientOffset: XYCoord | null\n}\n\nexport interface BeginDragPayload {\n\titemType: Identifier\n\titem: any\n\tsourceId: Identifier\n\tclientOffset: XYCoord | null\n\tsourceClientOffset: XYCoord | null\n\tisSourcePublic: boolean\n}\n\nexport interface HoverPayload {\n\ttargetIds: Identifier[]\n\tclientOffset: XYCoord | null\n}\n\nexport interface HoverOptions {\n\tclientOffset?: XYCoord\n}\n\nexport interface DropPayload {\n\tdropResult: any\n}\n\nexport interface TargetIdPayload {\n\ttargetId: Identifier\n}\n\nexport interface SourceIdPayload {\n\tsourceId: Identifier\n}\n\nexport interface DragDropActions {\n\tbeginDrag(\n\t\tsourceIds?: Identifier[],\n\t\toptions?: any,\n\t): Action | undefined\n\tpublishDragSource(): SentinelAction | undefined\n\thover(targetIds: Identifier[], options?: any): Action\n\tdrop(options?: any): void\n\tendDrag(): SentinelAction\n}\n\nexport interface DragDropManager {\n\tgetMonitor(): DragDropMonitor\n\tgetBackend(): Backend\n\tgetRegistry(): HandlerRegistry\n\tgetActions(): DragDropActions\n\tdispatch(action: any): void\n}\n\nexport type BackendFactory = (\n\tmanager: DragDropManager,\n\tglobalContext?: any,\n\tconfiguration?: any,\n) => Backend\n\nexport interface DragSource {\n\tbeginDrag(monitor: DragDropMonitor, targetId: Identifier): void\n\tendDrag(monitor: DragDropMonitor, targetId: Identifier): void\n\tcanDrag(monitor: DragDropMonitor, targetId: Identifier): boolean\n\tisDragging(monitor: DragDropMonitor, targetId: Identifier): boolean\n}\n\nexport interface DropTarget {\n\tcanDrop(monitor: DragDropMonitor, targetId: Identifier): boolean\n\thover(monitor: DragDropMonitor, targetId: Identifier): void\n\tdrop(monitor: DragDropMonitor, targetId: Identifier): any\n}\n","import { invariant } from '@react-dnd/invariant'\n\nimport type { DragSource, DropTarget, Identifier } from './interfaces.js'\n\nexport function validateSourceContract(source: DragSource): void {\n\tinvariant(\n\t\ttypeof source.canDrag === 'function',\n\t\t'Expected canDrag to be a function.',\n\t)\n\tinvariant(\n\t\ttypeof source.beginDrag === 'function',\n\t\t'Expected beginDrag to be a function.',\n\t)\n\tinvariant(\n\t\ttypeof source.endDrag === 'function',\n\t\t'Expected endDrag to be a function.',\n\t)\n}\n\nexport function validateTargetContract(target: DropTarget): void {\n\tinvariant(\n\t\ttypeof target.canDrop === 'function',\n\t\t'Expected canDrop to be a function.',\n\t)\n\tinvariant(\n\t\ttypeof target.hover === 'function',\n\t\t'Expected hover to be a function.',\n\t)\n\tinvariant(\n\t\ttypeof target.drop === 'function',\n\t\t'Expected beginDrag to be a function.',\n\t)\n}\n\nexport function validateType(\n\ttype: Identifier | Identifier[],\n\tallowArray?: boolean,\n): void {\n\tif (allowArray && Array.isArray(type)) {\n\t\ttype.forEach((t) => validateType(t, false))\n\t\treturn\n\t}\n\n\tinvariant(\n\t\ttypeof type === 'string' || typeof type === 'symbol',\n\t\tallowArray\n\t\t\t? 'Type can only be a string, a symbol, or an array of either.'\n\t\t\t: 'Type can only be a string or a symbol.',\n\t)\n}\n","let nextUniqueId = 0\n\nexport function getNextUniqueId(): number {\n\treturn nextUniqueId++\n}\n","import { asap } from '@react-dnd/asap'\nimport { invariant } from '@react-dnd/invariant'\nimport type { Store } from 'redux'\n\nimport {\n\taddSource,\n\taddTarget,\n\tremoveSource,\n\tremoveTarget,\n} from '../actions/registry.js'\nimport {\n\tvalidateSourceContract,\n\tvalidateTargetContract,\n\tvalidateType,\n} from '../contracts.js'\nimport type {\n\tDragSource,\n\tDropTarget,\n\tHandlerRegistry,\n\tIdentifier,\n\tSourceType,\n\tTargetType,\n} from '../interfaces.js'\nimport { HandlerRole } from '../interfaces.js'\nimport type { State } from '../reducers/index.js'\nimport { getNextUniqueId } from '../utils/getNextUniqueId.js'\n\nfunction getNextHandlerId(role: HandlerRole): string {\n\tconst id = getNextUniqueId().toString()\n\tswitch (role) {\n\t\tcase HandlerRole.SOURCE:\n\t\t\treturn `S${id}`\n\t\tcase HandlerRole.TARGET:\n\t\t\treturn `T${id}`\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown Handler Role: ${role}`)\n\t}\n}\n\nfunction parseRoleFromHandlerId(handlerId: string) {\n\tswitch (handlerId[0]) {\n\t\tcase 'S':\n\t\t\treturn HandlerRole.SOURCE\n\t\tcase 'T':\n\t\t\treturn HandlerRole.TARGET\n\t\tdefault:\n\t\t\tthrow new Error(`Cannot parse handler ID: ${handlerId}`)\n\t}\n}\n\nfunction mapContainsValue(map: Map, searchValue: T) {\n\tconst entries = map.entries()\n\tlet isDone = false\n\tdo {\n\t\tconst {\n\t\t\tdone,\n\t\t\tvalue: [, value],\n\t\t} = entries.next()\n\t\tif (value === searchValue) {\n\t\t\treturn true\n\t\t}\n\t\tisDone = !!done\n\t} while (!isDone)\n\treturn false\n}\n\nexport class HandlerRegistryImpl implements HandlerRegistry {\n\tprivate types: Map = new Map()\n\tprivate dragSources: Map = new Map()\n\tprivate dropTargets: Map = new Map()\n\tprivate pinnedSourceId: string | null = null\n\tprivate pinnedSource: any = null\n\tprivate store: Store\n\n\tpublic constructor(store: Store) {\n\t\tthis.store = store\n\t}\n\n\tpublic addSource(type: SourceType, source: DragSource): string {\n\t\tvalidateType(type)\n\t\tvalidateSourceContract(source)\n\n\t\tconst sourceId = this.addHandler(HandlerRole.SOURCE, type, source)\n\t\tthis.store.dispatch(addSource(sourceId))\n\t\treturn sourceId\n\t}\n\n\tpublic addTarget(type: TargetType, target: DropTarget): string {\n\t\tvalidateType(type, true)\n\t\tvalidateTargetContract(target)\n\n\t\tconst targetId = this.addHandler(HandlerRole.TARGET, type, target)\n\t\tthis.store.dispatch(addTarget(targetId))\n\t\treturn targetId\n\t}\n\n\tpublic containsHandler(handler: DragSource | DropTarget): boolean {\n\t\treturn (\n\t\t\tmapContainsValue(this.dragSources, handler) ||\n\t\t\tmapContainsValue(this.dropTargets, handler)\n\t\t)\n\t}\n\n\tpublic getSource(sourceId: string, includePinned = false): DragSource {\n\t\tinvariant(this.isSourceId(sourceId), 'Expected a valid source ID.')\n\t\tconst isPinned = includePinned && sourceId === this.pinnedSourceId\n\t\tconst source = isPinned ? this.pinnedSource : this.dragSources.get(sourceId)\n\t\treturn source\n\t}\n\n\tpublic getTarget(targetId: string): DropTarget {\n\t\tinvariant(this.isTargetId(targetId), 'Expected a valid target ID.')\n\t\treturn this.dropTargets.get(targetId) as DropTarget\n\t}\n\n\tpublic getSourceType(sourceId: string): Identifier {\n\t\tinvariant(this.isSourceId(sourceId), 'Expected a valid source ID.')\n\t\treturn this.types.get(sourceId) as Identifier\n\t}\n\n\tpublic getTargetType(targetId: string): Identifier | Identifier[] {\n\t\tinvariant(this.isTargetId(targetId), 'Expected a valid target ID.')\n\t\treturn this.types.get(targetId) as Identifier | Identifier[]\n\t}\n\n\tpublic isSourceId(handlerId: string): boolean {\n\t\tconst role = parseRoleFromHandlerId(handlerId)\n\t\treturn role === HandlerRole.SOURCE\n\t}\n\n\tpublic isTargetId(handlerId: string): boolean {\n\t\tconst role = parseRoleFromHandlerId(handlerId)\n\t\treturn role === HandlerRole.TARGET\n\t}\n\n\tpublic removeSource(sourceId: string): void {\n\t\tinvariant(this.getSource(sourceId), 'Expected an existing source.')\n\t\tthis.store.dispatch(removeSource(sourceId))\n\t\tasap(() => {\n\t\t\tthis.dragSources.delete(sourceId)\n\t\t\tthis.types.delete(sourceId)\n\t\t})\n\t}\n\n\tpublic removeTarget(targetId: string): void {\n\t\tinvariant(this.getTarget(targetId), 'Expected an existing target.')\n\t\tthis.store.dispatch(removeTarget(targetId))\n\t\tthis.dropTargets.delete(targetId)\n\t\tthis.types.delete(targetId)\n\t}\n\n\tpublic pinSource(sourceId: string): void {\n\t\tconst source = this.getSource(sourceId)\n\t\tinvariant(source, 'Expected an existing source.')\n\n\t\tthis.pinnedSourceId = sourceId\n\t\tthis.pinnedSource = source\n\t}\n\n\tpublic unpinSource(): void {\n\t\tinvariant(this.pinnedSource, 'No source is pinned at the time.')\n\n\t\tthis.pinnedSourceId = null\n\t\tthis.pinnedSource = null\n\t}\n\n\tprivate addHandler(\n\t\trole: HandlerRole,\n\t\ttype: SourceType | TargetType,\n\t\thandler: DragSource | DropTarget,\n\t): string {\n\t\tconst id = getNextHandlerId(role)\n\t\tthis.types.set(id, type)\n\t\tif (role === HandlerRole.SOURCE) {\n\t\t\tthis.dragSources.set(id, handler as DragSource)\n\t\t} else if (role === HandlerRole.TARGET) {\n\t\t\tthis.dropTargets.set(id, handler as DropTarget)\n\t\t}\n\t\treturn id\n\t}\n}\n","import type { XYCoord } from '../interfaces.js'\n\nexport type EqualityCheck = (a: T, b: T) => boolean\nexport const strictEquality = (a: T, b: T): boolean => a === b\n\n/**\n * Determine if two cartesian coordinate offsets are equal\n * @param offsetA\n * @param offsetB\n */\nexport function areCoordsEqual(\n\toffsetA: XYCoord | null | undefined,\n\toffsetB: XYCoord | null | undefined,\n): boolean {\n\tif (!offsetA && !offsetB) {\n\t\treturn true\n\t} else if (!offsetA || !offsetB) {\n\t\treturn false\n\t} else {\n\t\treturn offsetA.x === offsetB.x && offsetA.y === offsetB.y\n\t}\n}\n\n/**\n * Determines if two arrays of items are equal\n * @param a The first array of items\n * @param b The second array of items\n */\nexport function areArraysEqual(\n\ta: T[],\n\tb: T[],\n\tisEqual: EqualityCheck = strictEquality,\n): boolean {\n\tif (a.length !== b.length) {\n\t\treturn false\n\t}\n\tfor (let i = 0; i < a.length; ++i) {\n\t\tif (!isEqual(a[i] as T, b[i] as T)) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n","import {\n\tBEGIN_DRAG,\n\tDROP,\n\tEND_DRAG,\n\tHOVER,\n\tPUBLISH_DRAG_SOURCE,\n} from '../actions/dragDrop/index.js'\nimport {\n\tADD_SOURCE,\n\tADD_TARGET,\n\tREMOVE_SOURCE,\n\tREMOVE_TARGET,\n} from '../actions/registry.js'\nimport type { Action } from '../interfaces.js'\nimport { ALL, NONE } from '../utils/dirtiness.js'\nimport { areArraysEqual } from '../utils/equality.js'\nimport { xor } from '../utils/js_utils.js'\n\nexport type State = string[]\n\nexport interface DirtyHandlerIdPayload {\n\ttargetIds: string[]\n\tprevTargetIds: string[]\n}\n\nexport function reduce(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t_state: State = NONE,\n\taction: Action,\n): State {\n\tswitch (action.type) {\n\t\tcase HOVER:\n\t\t\tbreak\n\t\tcase ADD_SOURCE:\n\t\tcase ADD_TARGET:\n\t\tcase REMOVE_TARGET:\n\t\tcase REMOVE_SOURCE:\n\t\t\treturn NONE\n\t\tcase BEGIN_DRAG:\n\t\tcase PUBLISH_DRAG_SOURCE:\n\t\tcase END_DRAG:\n\t\tcase DROP:\n\t\tdefault:\n\t\t\treturn ALL\n\t}\n\n\tconst { targetIds = [], prevTargetIds = [] } = action.payload\n\tconst result = xor(targetIds, prevTargetIds)\n\tconst didChange =\n\t\tresult.length > 0 || !areArraysEqual(targetIds, prevTargetIds)\n\n\tif (!didChange) {\n\t\treturn NONE\n\t}\n\n\t// Check the target ids at the innermost position. If they are valid, add them\n\t// to the result\n\tconst prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1]\n\tconst innermostTargetId = targetIds[targetIds.length - 1]\n\tif (prevInnermostTargetId !== innermostTargetId) {\n\t\tif (prevInnermostTargetId) {\n\t\t\tresult.push(prevInnermostTargetId)\n\t\t}\n\t\tif (innermostTargetId) {\n\t\t\tresult.push(innermostTargetId)\n\t\t}\n\t}\n\n\treturn result\n}\n","import {\n\tBEGIN_DRAG,\n\tDROP,\n\tEND_DRAG,\n\tHOVER,\n\tINIT_COORDS,\n} from '../actions/dragDrop/index.js'\nimport type { Action, XYCoord } from '../interfaces.js'\nimport { areCoordsEqual } from '../utils/equality.js'\n\nexport interface State {\n\tinitialSourceClientOffset: XYCoord | null\n\tinitialClientOffset: XYCoord | null\n\tclientOffset: XYCoord | null\n}\n\nconst initialState: State = {\n\tinitialSourceClientOffset: null,\n\tinitialClientOffset: null,\n\tclientOffset: null,\n}\n\nexport function reduce(\n\tstate: State = initialState,\n\taction: Action<{\n\t\tsourceClientOffset: XYCoord\n\t\tclientOffset: XYCoord\n\t}>,\n): State {\n\tconst { payload } = action\n\tswitch (action.type) {\n\t\tcase INIT_COORDS:\n\t\tcase BEGIN_DRAG:\n\t\t\treturn {\n\t\t\t\tinitialSourceClientOffset: payload.sourceClientOffset,\n\t\t\t\tinitialClientOffset: payload.clientOffset,\n\t\t\t\tclientOffset: payload.clientOffset,\n\t\t\t}\n\t\tcase HOVER:\n\t\t\tif (areCoordsEqual(state.clientOffset, payload.clientOffset)) {\n\t\t\t\treturn state\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tclientOffset: payload.clientOffset,\n\t\t\t}\n\t\tcase END_DRAG:\n\t\tcase DROP:\n\t\t\treturn initialState\n\t\tdefault:\n\t\t\treturn state\n\t}\n}\n","import {\n\tBEGIN_DRAG,\n\tDROP,\n\tEND_DRAG,\n\tHOVER,\n\tPUBLISH_DRAG_SOURCE,\n} from '../actions/dragDrop/index.js'\nimport { REMOVE_TARGET } from '../actions/registry.js'\nimport type { Action, Identifier } from '../interfaces.js'\nimport { without } from '../utils/js_utils.js'\n\nexport interface State {\n\titemType: Identifier | Identifier[] | null\n\titem: any\n\tsourceId: string | null\n\ttargetIds: string[]\n\tdropResult: any\n\tdidDrop: boolean\n\tisSourcePublic: boolean | null\n}\n\nconst initialState: State = {\n\titemType: null,\n\titem: null,\n\tsourceId: null,\n\ttargetIds: [],\n\tdropResult: null,\n\tdidDrop: false,\n\tisSourcePublic: null,\n}\n\nexport function reduce(\n\tstate: State = initialState,\n\taction: Action<{\n\t\titemType: Identifier | Identifier[]\n\t\titem: any\n\t\tsourceId: string\n\t\ttargetId: string\n\t\ttargetIds: string[]\n\t\tisSourcePublic: boolean\n\t\tdropResult: any\n\t}>,\n): State {\n\tconst { payload } = action\n\tswitch (action.type) {\n\t\tcase BEGIN_DRAG:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\titemType: payload.itemType,\n\t\t\t\titem: payload.item,\n\t\t\t\tsourceId: payload.sourceId,\n\t\t\t\tisSourcePublic: payload.isSourcePublic,\n\t\t\t\tdropResult: null,\n\t\t\t\tdidDrop: false,\n\t\t\t}\n\t\tcase PUBLISH_DRAG_SOURCE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisSourcePublic: true,\n\t\t\t}\n\t\tcase HOVER:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\ttargetIds: payload.targetIds,\n\t\t\t}\n\t\tcase REMOVE_TARGET:\n\t\t\tif (state.targetIds.indexOf(payload.targetId) === -1) {\n\t\t\t\treturn state\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\ttargetIds: without(state.targetIds, payload.targetId),\n\t\t\t}\n\t\tcase DROP:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tdropResult: payload.dropResult,\n\t\t\t\tdidDrop: true,\n\t\t\t\ttargetIds: [],\n\t\t\t}\n\t\tcase END_DRAG:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\titemType: null,\n\t\t\t\titem: null,\n\t\t\t\tsourceId: null,\n\t\t\t\tdropResult: null,\n\t\t\t\tdidDrop: false,\n\t\t\t\tisSourcePublic: null,\n\t\t\t\ttargetIds: [],\n\t\t\t}\n\t\tdefault:\n\t\t\treturn state\n\t}\n}\n","import {\n\tADD_SOURCE,\n\tADD_TARGET,\n\tREMOVE_SOURCE,\n\tREMOVE_TARGET,\n} from '../actions/registry.js'\nimport type { Action } from '../interfaces.js'\n\nexport type State = number\n\nexport function reduce(state: State = 0, action: Action): State {\n\tswitch (action.type) {\n\t\tcase ADD_SOURCE:\n\t\tcase ADD_TARGET:\n\t\t\treturn state + 1\n\t\tcase REMOVE_SOURCE:\n\t\tcase REMOVE_TARGET:\n\t\t\treturn state - 1\n\t\tdefault:\n\t\t\treturn state\n\t}\n}\n","export type State = number\n\nexport function reduce(state: State = 0): State {\n\treturn state + 1\n}\n","import type { Action } from '../interfaces.js'\nimport { get } from '../utils/js_utils.js'\nimport type { State as DirtyHandlerIdsState } from './dirtyHandlerIds.js'\nimport { reduce as dirtyHandlerIds } from './dirtyHandlerIds.js'\nimport type { State as DragOffsetState } from './dragOffset.js'\nimport { reduce as dragOffset } from './dragOffset.js'\nimport type { State as DragOperationState } from './dragOperation.js'\nimport { reduce as dragOperation } from './dragOperation.js'\nimport type { State as RefCountState } from './refCount.js'\nimport { reduce as refCount } from './refCount.js'\nimport type { State as StateIdState } from './stateId.js'\nimport { reduce as stateId } from './stateId.js'\n\nexport interface State {\n\tdirtyHandlerIds: DirtyHandlerIdsState\n\tdragOffset: DragOffsetState\n\trefCount: RefCountState\n\tdragOperation: DragOperationState\n\tstateId: StateIdState\n}\n\nexport function reduce(state: State = {} as State, action: Action): State {\n\treturn {\n\t\tdirtyHandlerIds: dirtyHandlerIds(state.dirtyHandlerIds, {\n\t\t\ttype: action.type,\n\t\t\tpayload: {\n\t\t\t\t...action.payload,\n\t\t\t\tprevTargetIds: get(state, 'dragOperation.targetIds', []),\n\t\t\t},\n\t\t}),\n\t\tdragOffset: dragOffset(state.dragOffset, action),\n\t\trefCount: refCount(state.refCount, action),\n\t\tdragOperation: dragOperation(state.dragOperation, action),\n\t\tstateId: stateId(state.stateId),\n\t}\n}\n","import type { Store } from 'redux'\nimport { createStore } from 'redux'\n\nimport { DragDropManagerImpl } from './classes/DragDropManagerImpl.js'\nimport { DragDropMonitorImpl } from './classes/DragDropMonitorImpl.js'\nimport { HandlerRegistryImpl } from './classes/HandlerRegistryImpl.js'\nimport type { BackendFactory, DragDropManager } from './interfaces.js'\nimport type { State } from './reducers/index.js'\nimport { reduce } from './reducers/index.js'\n\nexport function createDragDropManager(\n\tbackendFactory: BackendFactory,\n\tglobalContext: unknown = undefined,\n\tbackendOptions: unknown = {},\n\tdebugMode = false,\n): DragDropManager {\n\tconst store = makeStoreInstance(debugMode)\n\tconst monitor = new DragDropMonitorImpl(store, new HandlerRegistryImpl(store))\n\tconst manager = new DragDropManagerImpl(store, monitor)\n\tconst backend = backendFactory(manager, globalContext, backendOptions)\n\tmanager.receiveBackend(backend)\n\treturn manager\n}\n\nfunction makeStoreInstance(debugMode: boolean): Store {\n\t// TODO: if we ever make a react-native version of this,\n\t// we'll need to consider how to pull off dev-tooling\n\tconst reduxDevTools =\n\t\ttypeof window !== 'undefined' &&\n\t\t(window as any).__REDUX_DEVTOOLS_EXTENSION__\n\treturn createStore(\n\t\treduce,\n\t\tdebugMode &&\n\t\t\treduxDevTools &&\n\t\t\treduxDevTools({\n\t\t\t\tname: 'dnd-core',\n\t\t\t\tinstanceId: 'dnd-core',\n\t\t\t}),\n\t)\n}\n","import type { BackendFactory, DragDropManager } from 'dnd-core'\nimport { createDragDropManager } from 'dnd-core'\nimport type { FC, ReactNode } from 'react'\nimport { memo, useEffect } from 'react'\n\nimport { DndContext } from './DndContext.js'\n\nexport type DndProviderProps =\n\t| {\n\t\t\tchildren?: ReactNode\n\t\t\tmanager: DragDropManager\n\t }\n\t| {\n\t\t\tbackend: BackendFactory\n\t\t\tchildren?: ReactNode\n\t\t\tcontext?: BackendContext\n\t\t\toptions?: BackendOptions\n\t\t\tdebugMode?: boolean\n\t }\n\nlet refCount = 0\nconst INSTANCE_SYM = Symbol.for('__REACT_DND_CONTEXT_INSTANCE__')\n\n/**\n * A React component that provides the React-DnD context\n */\nexport const DndProvider: FC> = memo(\n\tfunction DndProvider({ children, ...props }) {\n\t\tconst [manager, isGlobalInstance] = getDndContextValue(props) // memoized from props\n\t\t/**\n\t\t * If the global context was used to store the DND context\n\t\t * then where theres no more references to it we should\n\t\t * clean it up to avoid memory leaks\n\t\t */\n\t\tuseEffect(() => {\n\t\t\tif (isGlobalInstance) {\n\t\t\t\tconst context = getGlobalContext()\n\t\t\t\t++refCount\n\n\t\t\t\treturn () => {\n\t\t\t\t\tif (--refCount === 0) {\n\t\t\t\t\t\tcontext[INSTANCE_SYM] = null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}, [])\n\n\t\treturn {children}\n\t},\n)\n\nfunction getDndContextValue(props: DndProviderProps) {\n\tif ('manager' in props) {\n\t\tconst manager = { dragDropManager: props.manager }\n\t\treturn [manager, false]\n\t}\n\n\tconst manager = createSingletonDndContext(\n\t\tprops.backend,\n\t\tprops.context,\n\t\tprops.options,\n\t\tprops.debugMode,\n\t)\n\tconst isGlobalInstance = !props.context\n\n\treturn [manager, isGlobalInstance]\n}\n\nfunction createSingletonDndContext(\n\tbackend: BackendFactory,\n\tcontext: BackendContext = getGlobalContext(),\n\toptions: BackendOptions,\n\tdebugMode?: boolean,\n) {\n\tconst ctx = context as any\n\tif (!ctx[INSTANCE_SYM]) {\n\t\tctx[INSTANCE_SYM] = {\n\t\t\tdragDropManager: createDragDropManager(\n\t\t\t\tbackend,\n\t\t\t\tcontext,\n\t\t\t\toptions,\n\t\t\t\tdebugMode,\n\t\t\t),\n\t\t}\n\t}\n\treturn ctx[INSTANCE_SYM]\n}\n\ndeclare const global: any\nfunction getGlobalContext() {\n\treturn typeof global !== 'undefined' ? global : (window as any)\n}\n","import c from\"react\";import{useRef as m}from\"react\";import{useDragLayer as f}from\"react-dnd\";var i=(t,e)=>({x:t.x-e.x,y:t.y-e.y}),a=t=>{let e=t.getInitialClientOffset(),r=t.getInitialSourceClientOffset();return e===null||r===null?{x:0,y:0}:i(e,r)},u=(t,e)=>{let r=t.getClientOffset();if(r===null)return null;if(!e.current||!e.current.getBoundingClientRect)return i(r,a(t));let n=e.current.getBoundingClientRect(),o={x:n.width/2,y:n.height/2};return i(r,o)};var p=t=>{let e=`translate(${t.x.toFixed(1)}px, ${t.y.toFixed(1)}px)`;return{pointerEvents:\"none\",position:\"fixed\",top:0,left:0,transform:e,WebkitTransform:e}},l=()=>{let t=m(null),e=f(r=>({currentOffset:u(r,t),isDragging:r.isDragging(),itemType:r.getItemType(),item:r.getItem(),monitor:r}));return!e.isDragging||e.currentOffset===null?{display:!1}:{display:!0,itemType:e.itemType,item:e.item,style:p(e.currentOffset),monitor:e.monitor,ref:t}};import{createContext as P}from\"react\";var s=P(void 0);var x=t=>{let e=l();if(!e.display)return null;let{display:r,...n}=e,o;return\"children\"in t?typeof t.children==\"function\"?o=t.children(n):o=t.children:o=t.generator(n),c.createElement(s.Provider,{value:n},o)};export{s as Context,x as Preview,l as usePreview};\n","export*from\"dnd-multi-backend\";import i,{useState as l,createContext as D}from\"react\";import{DndProvider as m}from\"react-dnd\";import{MultiBackend as P}from\"dnd-multi-backend\";var u=D(null),g=({portal:e,...t})=>{let[r,o]=l(null);return i.createElement(u.Provider,{value:e??r},i.createElement(m,{backend:P,...t}),e?null:i.createElement(\"div\",{ref:o}))};import w,{useContext as k}from\"react\";import{createPortal as M}from\"react-dom\";import{Preview as C,Context as b}from\"react-dnd-preview\";import{useState as v,useEffect as S,useContext as x}from\"react\";import{DndContext as f}from\"react-dnd\";var p=()=>{let[e,t]=v(!1),r=x(f);return S(()=>{let o=r?.dragDropManager?.getBackend(),n={backendChanged:s=>{t(s.previewEnabled())}};return t(o.previewEnabled()),o.previewsList().register(n),()=>{o.previewsList().unregister(n)}},[r,r.dragDropManager]),e};var E=e=>{let t=p(),r=k(u);if(!t)return null;let o=w.createElement(C,{...e});return r!==null?M(o,r):o};E.Context=b;import{useDrag as T}from\"react-dnd\";import{useContext as B}from\"react\";import{DndContext as y}from\"react-dnd\";var R=(e,t,r,o)=>{let n=r.getBackend();r.receiveBackend(o);let s=t(e);return r.receiveBackend(n),s},a=(e,t)=>{let r=B(y),o=r?.dragDropManager?.getBackend();if(o===void 0)throw new Error(\"could not find backend, make sure you are using a \");let n=t(e),s={},d=o.backendsList();for(let c of d)s[c.id]=R(e,t,r.dragDropManager,c.instance);return[n,s]};var pe=e=>a(e,T);import{useDrop as O}from\"react-dnd\";var le=e=>a(e,O);import{usePreview as h}from\"react-dnd-preview\";var Se=()=>{let e=p(),t=h();return e?t:{display:!1}};export{g as DndProvider,E as Preview,b as PreviewContext,pe as useMultiDrag,le as useMultiDrop,Se as usePreview};\n","export interface EventName {\n\tstart?: 'mousedown' | 'touchstart'\n\tmove?: 'mousemove' | 'touchmove'\n\tend?: 'mouseup' | 'touchend'\n\tcontextmenu?: 'contextmenu'\n\tkeydown?: 'keydown'\n}\n\nexport interface TouchBackendOptions {\n\tdelay: number\n\tdelayTouchStart: number\n\tenableTouchEvents: boolean\n\tenableKeyboardEvents: boolean\n\tenableMouseEvents: boolean\n\tignoreContextMenu: boolean\n\tenableHoverOutsideTarget: boolean\n\tdelayMouseStart: number\n\ttouchSlop: number\n\tscrollAngleRanges?: AngleRange[] | undefined\n\trootElement: Node | undefined\n\n\tgetDropTargetElementsAtPoint?:\n\t\t| undefined\n\t\t| ((x: number, y: number, dropTargets: HTMLElement[]) => HTMLElement[])\n}\n\nexport interface AngleRange {\n\tstart: number\n\tend: number\n}\n\nexport enum ListenerType {\n\tmouse = 'mouse',\n\ttouch = 'touch',\n\tkeyboard = 'keyboard',\n}\n\nexport interface TouchBackendContext {\n\twindow?: Window\n\tdocument?: Document\n}\n","import type {\n\tAngleRange,\n\tTouchBackendContext,\n\tTouchBackendOptions,\n} from './interfaces.js'\n\nexport class OptionsReader implements TouchBackendOptions {\n\tpublic constructor(\n\t\tprivate args: Partial,\n\t\tprivate context: TouchBackendContext,\n\t) {}\n\n\tpublic get delay(): number {\n\t\treturn this.args.delay ?? 0\n\t}\n\n\tpublic get scrollAngleRanges(): AngleRange[] | undefined {\n\t\treturn this.args.scrollAngleRanges\n\t}\n\n\tpublic get getDropTargetElementsAtPoint():\n\t\t| ((x: number, y: number, elements: HTMLElement[]) => HTMLElement[])\n\t\t| undefined {\n\t\treturn this.args.getDropTargetElementsAtPoint\n\t}\n\n\tpublic get ignoreContextMenu(): boolean {\n\t\treturn this.args.ignoreContextMenu ?? false\n\t}\n\n\tpublic get enableHoverOutsideTarget(): boolean {\n\t\treturn this.args.enableHoverOutsideTarget ?? false\n\t}\n\n\tpublic get enableKeyboardEvents(): boolean {\n\t\treturn this.args.enableKeyboardEvents ?? false\n\t}\n\n\tpublic get enableMouseEvents(): boolean {\n\t\treturn this.args.enableMouseEvents ?? false\n\t}\n\n\tpublic get enableTouchEvents(): boolean {\n\t\treturn this.args.enableTouchEvents ?? true\n\t}\n\n\tpublic get touchSlop(): number {\n\t\treturn this.args.touchSlop || 0\n\t}\n\n\tpublic get delayTouchStart(): number {\n\t\treturn this.args?.delayTouchStart ?? this.args?.delay ?? 0\n\t}\n\n\tpublic get delayMouseStart(): number {\n\t\treturn this.args?.delayMouseStart ?? this.args?.delay ?? 0\n\t}\n\n\tpublic get window(): Window | undefined {\n\t\tif (this.context && this.context.window) {\n\t\t\treturn this.context.window\n\t\t} else if (typeof window !== 'undefined') {\n\t\t\treturn window\n\t\t}\n\t\treturn undefined\n\t}\n\n\tpublic get document(): Document | undefined {\n\t\tif (this.context?.document) {\n\t\t\treturn this.context.document\n\t\t}\n\n\t\tif (this.window) {\n\t\t\treturn this.window.document\n\t\t}\n\n\t\treturn undefined\n\t}\n\n\tpublic get rootElement(): Node | undefined {\n\t\treturn this.args?.rootElement || (this.document as any as Node)\n\t}\n}\n","// Used for MouseEvent.buttons (note the s on the end).\nconst MouseButtons = {\n\tLeft: 1,\n\tRight: 2,\n\tCenter: 4,\n}\n\n// Used for e.button (note the lack of an s on the end).\nconst MouseButton = {\n\tLeft: 0,\n\tCenter: 1,\n\tRight: 2,\n}\n\n/**\n * Only touch events and mouse events where the left button is pressed should initiate a drag.\n * @param {MouseEvent | TouchEvent} e The event\n */\nexport function eventShouldStartDrag(e: MouseEvent): boolean {\n\t// For touch events, button will be undefined. If e.button is defined,\n\t// then it should be MouseButton.Left.\n\treturn e.button === undefined || e.button === MouseButton.Left\n}\n\n/**\n * Only touch events and mouse events where the left mouse button is no longer held should end a drag.\n * It's possible the user mouse downs with the left mouse button, then mouse down and ups with the right mouse button.\n * We don't want releasing the right mouse button to end the drag.\n * @param {MouseEvent | TouchEvent} e The event\n */\nexport function eventShouldEndDrag(e: MouseEvent): boolean {\n\t// Touch events will have buttons be undefined, while mouse events will have e.buttons's left button\n\t// bit field unset if the left mouse button has been released\n\treturn e.buttons === undefined || (e.buttons & MouseButtons.Left) === 0\n}\n\nexport function isTouchEvent(\n\te: Touch | TouchEvent | MouseEvent,\n): e is TouchEvent {\n\treturn !!(e as TouchEvent).targetTouches\n}\n","import type { XYCoord } from 'dnd-core'\n\nimport { isTouchEvent } from './predicates.js'\n\nconst ELEMENT_NODE = 1\n\nexport function getNodeClientOffset(node: Element): XYCoord | undefined {\n\tconst el = node.nodeType === ELEMENT_NODE ? node : node.parentElement\n\tif (!el) {\n\t\treturn undefined\n\t}\n\tconst { top, left } = el.getBoundingClientRect()\n\treturn { x: left, y: top }\n}\n\nexport function getEventClientTouchOffset(\n\te: TouchEvent,\n\tlastTargetTouchFallback?: Touch,\n): XYCoord | undefined {\n\tif (e.targetTouches.length === 1) {\n\t\treturn getEventClientOffset(e.targetTouches[0] as Touch)\n\t} else if (lastTargetTouchFallback && e.touches.length === 1) {\n\t\tif ((e.touches[0] as Touch).target === lastTargetTouchFallback.target) {\n\t\t\treturn getEventClientOffset(e.touches[0] as Touch)\n\t\t}\n\t}\n\treturn\n}\n\nexport function getEventClientOffset(\n\te: TouchEvent | Touch | MouseEvent,\n\tlastTargetTouchFallback?: Touch,\n): XYCoord | undefined {\n\tif (isTouchEvent(e)) {\n\t\treturn getEventClientTouchOffset(e, lastTargetTouchFallback)\n\t} else {\n\t\treturn {\n\t\t\tx: e.clientX,\n\t\t\ty: e.clientY,\n\t\t}\n\t}\n}\n","export const supportsPassive = ((): boolean => {\n\t// simular to jQuery's test\n\tlet supported = false\n\ttry {\n\t\taddEventListener(\n\t\t\t'test',\n\t\t\t() => {\n\t\t\t\t// do nothing\n\t\t\t},\n\t\t\tObject.defineProperty({}, 'passive', {\n\t\t\t\tget() {\n\t\t\t\t\tsupported = true\n\t\t\t\t\treturn true\n\t\t\t\t},\n\t\t\t}),\n\t\t)\n\t} catch (e) {\n\t\t// do nothing\n\t}\n\treturn supported\n})()\n","import { invariant } from '@react-dnd/invariant'\nimport type {\n\tBackend,\n\tDragDropActions,\n\tDragDropManager,\n\tDragDropMonitor,\n\tIdentifier,\n\tUnsubscribe,\n\tXYCoord,\n} from 'dnd-core'\n\nimport type {\n\tEventName,\n\tTouchBackendContext,\n\tTouchBackendOptions,\n} from './interfaces.js'\nimport { ListenerType } from './interfaces.js'\nimport { OptionsReader } from './OptionsReader.js'\nimport { distance, inAngleRanges } from './utils/math.js'\nimport { getEventClientOffset, getNodeClientOffset } from './utils/offsets.js'\nimport {\n\teventShouldEndDrag,\n\teventShouldStartDrag,\n\tisTouchEvent,\n} from './utils/predicates.js'\nimport { supportsPassive } from './utils/supportsPassive.js'\n\nconst eventNames: Record = {\n\t[ListenerType.mouse]: {\n\t\tstart: 'mousedown',\n\t\tmove: 'mousemove',\n\t\tend: 'mouseup',\n\t\tcontextmenu: 'contextmenu',\n\t},\n\t[ListenerType.touch]: {\n\t\tstart: 'touchstart',\n\t\tmove: 'touchmove',\n\t\tend: 'touchend',\n\t},\n\t[ListenerType.keyboard]: {\n\t\tkeydown: 'keydown',\n\t},\n}\n\nexport class TouchBackendImpl implements Backend {\n\tprivate options: OptionsReader\n\n\t// React-DnD Dependencies\n\tprivate actions: DragDropActions\n\tprivate monitor: DragDropMonitor\n\n\t// Internal State\n\tprivate static isSetUp: boolean\n\tpublic sourceNodes: Map\n\tpublic sourcePreviewNodes: Map\n\tpublic sourcePreviewNodeOptions: Map\n\tpublic targetNodes: Map\n\tprivate _mouseClientOffset: Partial\n\tprivate _isScrolling: boolean\n\tprivate listenerTypes: ListenerType[]\n\tprivate moveStartSourceIds: string[] | undefined\n\tprivate waitingForDelay: boolean | undefined\n\tprivate timeout: ReturnType | undefined\n\tprivate dragOverTargetIds: string[] | undefined\n\tprivate draggedSourceNode: HTMLElement | undefined\n\tprivate draggedSourceNodeRemovalObserver: MutationObserver | undefined\n\n\t// Patch for iOS 13, discussion over #1585\n\tprivate lastTargetTouchFallback: Touch | undefined\n\n\tpublic constructor(\n\t\tmanager: DragDropManager,\n\t\tcontext: TouchBackendContext,\n\t\toptions: Partial,\n\t) {\n\t\tthis.options = new OptionsReader(options, context)\n\t\tthis.actions = manager.getActions()\n\t\tthis.monitor = manager.getMonitor()\n\n\t\tthis.sourceNodes = new Map()\n\t\tthis.sourcePreviewNodes = new Map()\n\t\tthis.sourcePreviewNodeOptions = new Map()\n\t\tthis.targetNodes = new Map()\n\t\tthis.listenerTypes = []\n\t\tthis._mouseClientOffset = {}\n\t\tthis._isScrolling = false\n\n\t\tif (this.options.enableMouseEvents) {\n\t\t\tthis.listenerTypes.push(ListenerType.mouse)\n\t\t}\n\n\t\tif (this.options.enableTouchEvents) {\n\t\t\tthis.listenerTypes.push(ListenerType.touch)\n\t\t}\n\n\t\tif (this.options.enableKeyboardEvents) {\n\t\t\tthis.listenerTypes.push(ListenerType.keyboard)\n\t\t}\n\t}\n\n\t/**\n\t * Generate profiling statistics for the HTML5Backend.\n\t */\n\tpublic profile(): Record {\n\t\treturn {\n\t\t\tsourceNodes: this.sourceNodes.size,\n\t\t\tsourcePreviewNodes: this.sourcePreviewNodes.size,\n\t\t\tsourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,\n\t\t\ttargetNodes: this.targetNodes.size,\n\t\t\tdragOverTargetIds: this.dragOverTargetIds?.length || 0,\n\t\t}\n\t}\n\n\t// public for test\n\tpublic get document(): Document | undefined {\n\t\treturn this.options.document\n\t}\n\n\tpublic setup(): void {\n\t\tconst root = this.options.rootElement\n\t\tif (!root) {\n\t\t\treturn\n\t\t}\n\n\t\tinvariant(\n\t\t\t!TouchBackendImpl.isSetUp,\n\t\t\t'Cannot have two Touch backends at the same time.',\n\t\t)\n\t\tTouchBackendImpl.isSetUp = true\n\n\t\tthis.addEventListener(root, 'start', this.getTopMoveStartHandler() as any)\n\t\tthis.addEventListener(\n\t\t\troot,\n\t\t\t'start',\n\t\t\tthis.handleTopMoveStartCapture as any,\n\t\t\ttrue,\n\t\t)\n\t\tthis.addEventListener(root, 'move', this.handleTopMove as any)\n\t\tthis.addEventListener(root, 'move', this.handleTopMoveCapture, true)\n\t\tthis.addEventListener(\n\t\t\troot,\n\t\t\t'end',\n\t\t\tthis.handleTopMoveEndCapture as any,\n\t\t\ttrue,\n\t\t)\n\n\t\tif (this.options.enableMouseEvents && !this.options.ignoreContextMenu) {\n\t\t\tthis.addEventListener(\n\t\t\t\troot,\n\t\t\t\t'contextmenu',\n\t\t\t\tthis.handleTopMoveEndCapture as any,\n\t\t\t)\n\t\t}\n\n\t\tif (this.options.enableKeyboardEvents) {\n\t\t\tthis.addEventListener(\n\t\t\t\troot,\n\t\t\t\t'keydown',\n\t\t\t\tthis.handleCancelOnEscape as any,\n\t\t\t\ttrue,\n\t\t\t)\n\t\t}\n\t}\n\n\tpublic teardown(): void {\n\t\tconst root = this.options.rootElement\n\t\tif (!root) {\n\t\t\treturn\n\t\t}\n\n\t\tTouchBackendImpl.isSetUp = false\n\t\tthis._mouseClientOffset = {}\n\n\t\tthis.removeEventListener(\n\t\t\troot,\n\t\t\t'start',\n\t\t\tthis.handleTopMoveStartCapture as any,\n\t\t\ttrue,\n\t\t)\n\t\tthis.removeEventListener(root, 'start', this.handleTopMoveStart as any)\n\t\tthis.removeEventListener(root, 'move', this.handleTopMoveCapture, true)\n\t\tthis.removeEventListener(root, 'move', this.handleTopMove as any)\n\t\tthis.removeEventListener(\n\t\t\troot,\n\t\t\t'end',\n\t\t\tthis.handleTopMoveEndCapture as any,\n\t\t\ttrue,\n\t\t)\n\n\t\tif (this.options.enableMouseEvents && !this.options.ignoreContextMenu) {\n\t\t\tthis.removeEventListener(\n\t\t\t\troot,\n\t\t\t\t'contextmenu',\n\t\t\t\tthis.handleTopMoveEndCapture as any,\n\t\t\t)\n\t\t}\n\n\t\tif (this.options.enableKeyboardEvents) {\n\t\t\tthis.removeEventListener(\n\t\t\t\troot,\n\t\t\t\t'keydown',\n\t\t\t\tthis.handleCancelOnEscape as any,\n\t\t\t\ttrue,\n\t\t\t)\n\t\t}\n\n\t\tthis.uninstallSourceNodeRemovalObserver()\n\t}\n\n\tprivate addEventListener(\n\t\tsubject: Node,\n\t\tevent: K,\n\t\thandler: (e: any) => void,\n\t\tcapture = false,\n\t) {\n\t\tconst options = supportsPassive ? { capture, passive: false } : capture\n\n\t\tthis.listenerTypes.forEach(function (listenerType) {\n\t\t\tconst evt = eventNames[listenerType][event]\n\n\t\t\tif (evt) {\n\t\t\t\tsubject.addEventListener(evt as any, handler as any, options)\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate removeEventListener(\n\t\tsubject: Node,\n\t\tevent: K,\n\t\thandler: (e: any) => void,\n\t\tcapture = false,\n\t) {\n\t\tconst options = supportsPassive ? { capture, passive: false } : capture\n\n\t\tthis.listenerTypes.forEach(function (listenerType) {\n\t\t\tconst evt = eventNames[listenerType][event]\n\n\t\t\tif (evt) {\n\t\t\t\tsubject.removeEventListener(evt as any, handler as any, options)\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic connectDragSource(sourceId: string, node: HTMLElement): Unsubscribe {\n\t\tconst handleMoveStart = this.handleMoveStart.bind(this, sourceId)\n\t\tthis.sourceNodes.set(sourceId, node)\n\n\t\tthis.addEventListener(node, 'start', handleMoveStart)\n\n\t\treturn (): void => {\n\t\t\tthis.sourceNodes.delete(sourceId)\n\t\t\tthis.removeEventListener(node, 'start', handleMoveStart)\n\t\t}\n\t}\n\n\tpublic connectDragPreview(\n\t\tsourceId: string,\n\t\tnode: HTMLElement,\n\t\toptions: unknown,\n\t): Unsubscribe {\n\t\tthis.sourcePreviewNodeOptions.set(sourceId, options)\n\t\tthis.sourcePreviewNodes.set(sourceId, node)\n\n\t\treturn (): void => {\n\t\t\tthis.sourcePreviewNodes.delete(sourceId)\n\t\t\tthis.sourcePreviewNodeOptions.delete(sourceId)\n\t\t}\n\t}\n\n\tpublic connectDropTarget(targetId: string, node: HTMLElement): Unsubscribe {\n\t\tconst root = this.options.rootElement\n\t\tif (!this.document || !root) {\n\t\t\treturn (): void => {\n\t\t\t\t/* noop */\n\t\t\t}\n\t\t}\n\n\t\tconst handleMove = (e: MouseEvent | TouchEvent) => {\n\t\t\tif (!this.document || !root || !this.monitor.isDragging()) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlet coords\n\n\t\t\t/**\n\t\t\t * Grab the coordinates for the current mouse/touch position\n\t\t\t */\n\t\t\tswitch (e.type) {\n\t\t\t\tcase eventNames.mouse.move:\n\t\t\t\t\tcoords = {\n\t\t\t\t\t\tx: (e as MouseEvent).clientX,\n\t\t\t\t\t\ty: (e as MouseEvent).clientY,\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase eventNames.touch.move:\n\t\t\t\t\tcoords = {\n\t\t\t\t\t\tx: (e as TouchEvent).touches[0]?.clientX || 0,\n\t\t\t\t\t\ty: (e as TouchEvent).touches[0]?.clientY || 0,\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Use the coordinates to grab the element the drag ended on.\n\t\t\t * If the element is the same as the target node (or any of it's children) then we have hit a drop target and can handle the move.\n\t\t\t */\n\t\t\tconst droppedOn =\n\t\t\t\tcoords != null\n\t\t\t\t\t? this.document.elementFromPoint(coords.x, coords.y)\n\t\t\t\t\t: undefined\n\t\t\tconst childMatch = droppedOn && node.contains(droppedOn)\n\n\t\t\tif (droppedOn === node || childMatch) {\n\t\t\t\treturn this.handleMove(e, targetId)\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Attaching the event listener to the body so that touchmove will work while dragging over multiple target elements.\n\t\t */\n\t\tthis.addEventListener(this.document.body, 'move', handleMove as any)\n\t\tthis.targetNodes.set(targetId, node)\n\n\t\treturn (): void => {\n\t\t\tif (this.document) {\n\t\t\t\tthis.targetNodes.delete(targetId)\n\t\t\t\tthis.removeEventListener(this.document.body, 'move', handleMove as any)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getSourceClientOffset = (sourceId: string): XYCoord | undefined => {\n\t\tconst element = this.sourceNodes.get(sourceId)\n\t\treturn element && getNodeClientOffset(element)\n\t}\n\n\tpublic handleTopMoveStartCapture = (e: Event): void => {\n\t\tif (!eventShouldStartDrag(e as MouseEvent)) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.moveStartSourceIds = []\n\t}\n\n\tpublic handleMoveStart = (sourceId: string): void => {\n\t\t// Just because we received an event doesn't necessarily mean we need to collect drag sources.\n\t\t// We only collect start collecting drag sources on touch and left mouse events.\n\t\tif (Array.isArray(this.moveStartSourceIds)) {\n\t\t\tthis.moveStartSourceIds.unshift(sourceId)\n\t\t}\n\t}\n\n\tprivate getTopMoveStartHandler() {\n\t\tif (!this.options.delayTouchStart && !this.options.delayMouseStart) {\n\t\t\treturn this.handleTopMoveStart\n\t\t}\n\n\t\treturn this.handleTopMoveStartDelay\n\t}\n\n\tpublic handleTopMoveStart = (e: MouseEvent | TouchEvent): void => {\n\t\tif (!eventShouldStartDrag(e as MouseEvent)) {\n\t\t\treturn\n\t\t}\n\n\t\t// Don't prematurely preventDefault() here since it might:\n\t\t// 1. Mess up scrolling\n\t\t// 2. Mess up long tap (which brings up context menu)\n\t\t// 3. If there's an anchor link as a child, tap won't be triggered on link\n\n\t\tconst clientOffset = getEventClientOffset(e)\n\t\tif (clientOffset) {\n\t\t\tif (isTouchEvent(e)) {\n\t\t\t\tthis.lastTargetTouchFallback = e.targetTouches[0]\n\t\t\t}\n\t\t\tthis._mouseClientOffset = clientOffset\n\t\t}\n\t\tthis.waitingForDelay = false\n\t}\n\n\tpublic handleTopMoveStartDelay = (e: Event): void => {\n\t\tif (!eventShouldStartDrag(e as MouseEvent)) {\n\t\t\treturn\n\t\t}\n\n\t\tconst delay =\n\t\t\te.type === eventNames.touch.start\n\t\t\t\t? this.options.delayTouchStart\n\t\t\t\t: this.options.delayMouseStart\n\t\tthis.timeout = setTimeout(\n\t\t\tthis.handleTopMoveStart.bind(this, e as any),\n\t\t\tdelay,\n\t\t) as any as ReturnType\n\t\tthis.waitingForDelay = true\n\t}\n\n\tpublic handleTopMoveCapture = (): void => {\n\t\tthis.dragOverTargetIds = []\n\t}\n\n\tpublic handleMove = (\n\t\t_evt: MouseEvent | TouchEvent,\n\t\ttargetId: string,\n\t): void => {\n\t\tif (this.dragOverTargetIds) {\n\t\t\tthis.dragOverTargetIds.unshift(targetId)\n\t\t}\n\t}\n\n\tpublic handleTopMove = (e: TouchEvent | MouseEvent): void => {\n\t\tif (this.timeout) {\n\t\t\tclearTimeout(this.timeout)\n\t\t}\n\t\tif (!this.document || this.waitingForDelay) {\n\t\t\treturn\n\t\t}\n\t\tconst { moveStartSourceIds, dragOverTargetIds } = this\n\t\tconst enableHoverOutsideTarget = this.options.enableHoverOutsideTarget\n\n\t\tconst clientOffset = getEventClientOffset(e, this.lastTargetTouchFallback)\n\n\t\tif (!clientOffset) {\n\t\t\treturn\n\t\t}\n\n\t\t// If the touch move started as a scroll, or is is between the scroll angles\n\t\tif (\n\t\t\tthis._isScrolling ||\n\t\t\t(!this.monitor.isDragging() &&\n\t\t\t\tinAngleRanges(\n\t\t\t\t\tthis._mouseClientOffset.x || 0,\n\t\t\t\t\tthis._mouseClientOffset.y || 0,\n\t\t\t\t\tclientOffset.x,\n\t\t\t\t\tclientOffset.y,\n\t\t\t\t\tthis.options.scrollAngleRanges,\n\t\t\t\t))\n\t\t) {\n\t\t\tthis._isScrolling = true\n\t\t\treturn\n\t\t}\n\n\t\t// If we're not dragging and we've moved a little, that counts as a drag start\n\t\tif (\n\t\t\t!this.monitor.isDragging() &&\n\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\tthis._mouseClientOffset.hasOwnProperty('x') &&\n\t\t\tmoveStartSourceIds &&\n\t\t\tdistance(\n\t\t\t\tthis._mouseClientOffset.x || 0,\n\t\t\t\tthis._mouseClientOffset.y || 0,\n\t\t\t\tclientOffset.x,\n\t\t\t\tclientOffset.y,\n\t\t\t) > (this.options.touchSlop ? this.options.touchSlop : 0)\n\t\t) {\n\t\t\tthis.moveStartSourceIds = undefined\n\n\t\t\tthis.actions.beginDrag(moveStartSourceIds, {\n\t\t\t\tclientOffset: this._mouseClientOffset,\n\t\t\t\tgetSourceClientOffset: this.getSourceClientOffset,\n\t\t\t\tpublishSource: false,\n\t\t\t})\n\t\t}\n\n\t\tif (!this.monitor.isDragging()) {\n\t\t\treturn\n\t\t}\n\n\t\tconst sourceNode = this.sourceNodes.get(\n\t\t\tthis.monitor.getSourceId() as string,\n\t\t)\n\t\tthis.installSourceNodeRemovalObserver(sourceNode)\n\t\tthis.actions.publishDragSource()\n\n\t\tif (e.cancelable) e.preventDefault()\n\n\t\t// Get the node elements of the hovered DropTargets\n\t\tconst dragOverTargetNodes: HTMLElement[] = (dragOverTargetIds || [])\n\t\t\t.map((key) => this.targetNodes.get(key))\n\t\t\t.filter((e) => !!e) as HTMLElement[]\n\n\t\t// Get the a ordered list of nodes that are touched by\n\t\tconst elementsAtPoint = this.options.getDropTargetElementsAtPoint\n\t\t\t? this.options.getDropTargetElementsAtPoint(\n\t\t\t\t\tclientOffset.x,\n\t\t\t\t\tclientOffset.y,\n\t\t\t\t\tdragOverTargetNodes,\n\t\t\t )\n\t\t\t: this.document.elementsFromPoint(clientOffset.x, clientOffset.y)\n\t\t// Extend list with parents that are not receiving elementsFromPoint events (size 0 elements and svg groups)\n\t\tconst elementsAtPointExtended: Element[] = []\n\t\tfor (const nodeId in elementsAtPoint) {\n\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\tif (!elementsAtPoint.hasOwnProperty(nodeId)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlet currentNode: Element | undefined | null = elementsAtPoint[nodeId]\n\t\t\tif (currentNode != null) {\n\t\t\t\telementsAtPointExtended.push(currentNode)\n\t\t\t}\n\t\t\twhile (currentNode) {\n\t\t\t\tcurrentNode = currentNode.parentElement\n\t\t\t\tif (\n\t\t\t\t\tcurrentNode &&\n\t\t\t\t\telementsAtPointExtended.indexOf(currentNode) === -1\n\t\t\t\t) {\n\t\t\t\t\telementsAtPointExtended.push(currentNode)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst orderedDragOverTargetIds: string[] = elementsAtPointExtended\n\t\t\t// Filter off nodes that arent a hovered DropTargets nodes\n\t\t\t.filter((node) => dragOverTargetNodes.indexOf(node as HTMLElement) > -1)\n\t\t\t// Map back the nodes elements to targetIds\n\t\t\t.map((node) => this._getDropTargetId(node))\n\t\t\t// Filter off possible null rows\n\t\t\t.filter((node) => !!node)\n\t\t\t.filter((id, index, ids) => ids.indexOf(id) === index) as string[]\n\n\t\t// Invoke hover for drop targets when source node is still over and pointer is outside\n\t\tif (enableHoverOutsideTarget) {\n\t\t\tfor (const targetId in this.targetNodes) {\n\t\t\t\tconst targetNode = this.targetNodes.get(targetId)\n\t\t\t\tif (\n\t\t\t\t\tsourceNode &&\n\t\t\t\t\ttargetNode &&\n\t\t\t\t\ttargetNode.contains(sourceNode) &&\n\t\t\t\t\torderedDragOverTargetIds.indexOf(targetId) === -1\n\t\t\t\t) {\n\t\t\t\t\torderedDragOverTargetIds.unshift(targetId)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Reverse order because dnd-core reverse it before calling the DropTarget drop methods\n\t\torderedDragOverTargetIds.reverse()\n\n\t\tthis.actions.hover(orderedDragOverTargetIds, {\n\t\t\tclientOffset: clientOffset,\n\t\t})\n\t}\n\n\t/**\n\t *\n\t * visible for testing\n\t */\n\tpublic _getDropTargetId = (node: Element): Identifier | undefined => {\n\t\tconst keys = this.targetNodes.keys()\n\t\tlet next = keys.next()\n\t\twhile (next.done === false) {\n\t\t\tconst targetId = next.value\n\t\t\tif (node === this.targetNodes.get(targetId)) {\n\t\t\t\treturn targetId\n\t\t\t} else {\n\t\t\t\tnext = keys.next()\n\t\t\t}\n\t\t}\n\t\treturn undefined\n\t}\n\n\tpublic handleTopMoveEndCapture = (e: Event): void => {\n\t\tthis._isScrolling = false\n\t\tthis.lastTargetTouchFallback = undefined\n\n\t\tif (!eventShouldEndDrag(e as MouseEvent)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (!this.monitor.isDragging() || this.monitor.didDrop()) {\n\t\t\tthis.moveStartSourceIds = undefined\n\t\t\treturn\n\t\t}\n\n\t\tif (e.cancelable) e.preventDefault()\n\n\t\tthis._mouseClientOffset = {}\n\n\t\tthis.uninstallSourceNodeRemovalObserver()\n\t\tthis.actions.drop()\n\t\tthis.actions.endDrag()\n\t}\n\n\tpublic handleCancelOnEscape = (e: KeyboardEvent): void => {\n\t\tif (e.key === 'Escape' && this.monitor.isDragging()) {\n\t\t\tthis._mouseClientOffset = {}\n\n\t\t\tthis.uninstallSourceNodeRemovalObserver()\n\t\t\tthis.actions.endDrag()\n\t\t}\n\t}\n\n\tprivate installSourceNodeRemovalObserver(node: HTMLElement | undefined) {\n\t\tthis.uninstallSourceNodeRemovalObserver()\n\n\t\tthis.draggedSourceNode = node\n\t\tthis.draggedSourceNodeRemovalObserver = new MutationObserver(() => {\n\t\t\tif (node && !node.parentElement) {\n\t\t\t\tthis.resurrectSourceNode()\n\t\t\t\tthis.uninstallSourceNodeRemovalObserver()\n\t\t\t}\n\t\t})\n\n\t\tif (!node || !node.parentElement) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.draggedSourceNodeRemovalObserver.observe(node.parentElement, {\n\t\t\tchildList: true,\n\t\t})\n\t}\n\n\tprivate resurrectSourceNode() {\n\t\tif (this.document && this.draggedSourceNode) {\n\t\t\tthis.draggedSourceNode.style.display = 'none'\n\t\t\tthis.draggedSourceNode.removeAttribute('data-reactid')\n\t\t\tthis.document.body.appendChild(this.draggedSourceNode)\n\t\t}\n\t}\n\n\tprivate uninstallSourceNodeRemovalObserver() {\n\t\tif (this.draggedSourceNodeRemovalObserver) {\n\t\t\tthis.draggedSourceNodeRemovalObserver.disconnect()\n\t\t}\n\n\t\tthis.draggedSourceNodeRemovalObserver = undefined\n\t\tthis.draggedSourceNode = undefined\n\t}\n}\n","import type { AngleRange } from '../interfaces.js'\n\nexport function distance(\n\tx1: number,\n\ty1: number,\n\tx2: number,\n\ty2: number,\n): number {\n\treturn Math.sqrt(\n\t\tMath.pow(Math.abs(x2 - x1), 2) + Math.pow(Math.abs(y2 - y1), 2),\n\t)\n}\n\nexport function inAngleRanges(\n\tx1: number,\n\ty1: number,\n\tx2: number,\n\ty2: number,\n\tangleRanges: AngleRange[] | undefined,\n): boolean {\n\tif (!angleRanges) {\n\t\treturn false\n\t}\n\n\tconst angle = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI + 180\n\n\tfor (let i = 0; i < angleRanges.length; ++i) {\n\t\tconst ar = angleRanges[i]\n\t\tif (\n\t\t\tar &&\n\t\t\t(ar.start == null || angle >= ar.start) &&\n\t\t\t(ar.end == null || angle <= ar.end)\n\t\t) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n","import type { BackendFactory, DragDropManager } from 'dnd-core'\n\nimport type { TouchBackendContext, TouchBackendOptions } from './interfaces.js'\nimport { TouchBackendImpl } from './TouchBackendImpl.js'\n\nexport * from './interfaces.js'\nexport * from './TouchBackendImpl.js'\n\nexport const TouchBackend: BackendFactory = function createBackend(\n\tmanager: DragDropManager,\n\tcontext: TouchBackendContext = {},\n\toptions: Partial = {},\n): TouchBackendImpl {\n\treturn new TouchBackendImpl(manager, context, options)\n}\n","import type { DragDropManager } from 'dnd-core'\nimport { createContext } from 'react'\n\n/**\n * The React context type\n */\nexport interface DndContextType {\n\tdragDropManager: DragDropManager | undefined\n}\n\n/**\n * Create the React Context\n */\nexport const DndContext = createContext({\n\tdragDropManager: undefined,\n})\n","import type { Connector } from '../internals/index.js'\nimport type { HandlerManager, MonitorEventEmitter } from '../types/index.js'\nimport { useMonitorOutput } from './useMonitorOutput.js'\n\nexport function useCollectedProps(\n\tcollector: ((monitor: Monitor) => Collected) | undefined,\n\tmonitor: Monitor & MonitorEventEmitter,\n\tconnector: Connector,\n) {\n\treturn useMonitorOutput(monitor, collector || (() => ({} as Collected)), () =>\n\t\tconnector.reconnect(),\n\t)\n}\n","import type { HandlerManager, MonitorEventEmitter } from '../types/index.js'\nimport { useCollector } from './useCollector.js'\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js'\n\nexport function useMonitorOutput(\n\tmonitor: Monitor & MonitorEventEmitter,\n\tcollect: (monitor: Monitor) => Collected,\n\tonCollect?: () => void,\n): Collected {\n\tconst [collected, updateCollected] = useCollector(monitor, collect, onCollect)\n\n\tuseIsomorphicLayoutEffect(\n\t\tfunction subscribeToMonitorStateChange() {\n\t\t\tconst handlerId = monitor.getHandlerId()\n\t\t\tif (handlerId == null) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn monitor.subscribeToStateChange(updateCollected, {\n\t\t\t\thandlerIds: [handlerId],\n\t\t\t})\n\t\t},\n\t\t[monitor, updateCollected],\n\t)\n\n\treturn collected\n}\n","import equal from 'fast-deep-equal'\nimport { useCallback, useState } from 'react'\n\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js'\n\n/**\n *\n * @param monitor The monitor to collect state from\n * @param collect The collecting function\n * @param onUpdate A method to invoke when updates occur\n */\nexport function useCollector(\n\tmonitor: T,\n\tcollect: (monitor: T) => S,\n\tonUpdate?: () => void,\n): [S, () => void] {\n\tconst [collected, setCollected] = useState(() => collect(monitor))\n\n\tconst updateCollected = useCallback(() => {\n\t\tconst nextValue = collect(monitor)\n\t\t// This needs to be a deep-equality check because some monitor-collected values\n\t\t// include XYCoord objects that may be equivalent, but do not have instance equality.\n\t\tif (!equal(collected, nextValue)) {\n\t\t\tsetCollected(nextValue)\n\t\t\tif (onUpdate) {\n\t\t\t\tonUpdate()\n\t\t\t}\n\t\t}\n\t}, [collected, monitor, onUpdate])\n\n\t// update the collected properties after react renders.\n\t// Note that the \"Dustbin Stress Test\" fails if this is not\n\t// done when the component updates\n\tuseIsomorphicLayoutEffect(updateCollected)\n\n\treturn [collected, updateCollected]\n}\n","import { invariant } from '@react-dnd/invariant'\nimport type { DragDropManager } from 'dnd-core'\nimport { useContext } from 'react'\n\nimport { DndContext } from '../core/index.js'\n\n/**\n * A hook to retrieve the DragDropManager from Context\n */\nexport function useDragDropManager(): DragDropManager {\n\tconst { dragDropManager } = useContext(DndContext)\n\tinvariant(dragDropManager != null, 'Expected drag drop context')\n\treturn dragDropManager as DragDropManager\n}\n","import { useEffect } from 'react'\n\nimport type { DragLayerMonitor } from '../types/index.js'\nimport { useCollector } from './useCollector.js'\nimport { useDragDropManager } from './useDragDropManager.js'\n\n/**\n * useDragLayer Hook\n * @param collector The property collector\n */\nexport function useDragLayer(\n\tcollect: (monitor: DragLayerMonitor) => CollectedProps,\n): CollectedProps {\n\tconst dragDropManager = useDragDropManager()\n\tconst monitor = dragDropManager.getMonitor()\n\tconst [collected, updateCollected] = useCollector(monitor, collect)\n\n\tuseEffect(() => monitor.subscribeToOffsetChange(updateCollected))\n\tuseEffect(() => monitor.subscribeToStateChange(updateCollected))\n\treturn collected\n}\n","import { useMemo } from 'react'\n\nimport type { SourceConnector } from '../../internals/index.js'\n\nexport function useConnectDragSource(connector: SourceConnector) {\n\treturn useMemo(() => connector.hooks.dragSource(), [connector])\n}\n\nexport function useConnectDragPreview(connector: SourceConnector) {\n\treturn useMemo(() => connector.hooks.dragPreview(), [connector])\n}\n","import { shallowEqual } from '@react-dnd/shallowequal'\nimport type { Backend, Identifier, Unsubscribe } from 'dnd-core'\nimport type { ReactElement, Ref, RefObject } from 'react'\n\nimport type { DragPreviewOptions, DragSourceOptions } from '../types/index.js'\nimport { isRef } from './isRef.js'\nimport { wrapConnectorHooks } from './wrapConnectorHooks.js'\n\nexport interface Connector {\n\thooks: any\n\tconnectTarget: any\n\treceiveHandlerId(handlerId: Identifier | null): void\n\treconnect(): void\n}\n\nexport class SourceConnector implements Connector {\n\tpublic hooks = wrapConnectorHooks({\n\t\tdragSource: (\n\t\t\tnode: Element | ReactElement | Ref,\n\t\t\toptions?: DragSourceOptions,\n\t\t) => {\n\t\t\tthis.clearDragSource()\n\t\t\tthis.dragSourceOptions = options || null\n\t\t\tif (isRef(node)) {\n\t\t\t\tthis.dragSourceRef = node as RefObject\n\t\t\t} else {\n\t\t\t\tthis.dragSourceNode = node\n\t\t\t}\n\t\t\tthis.reconnectDragSource()\n\t\t},\n\t\tdragPreview: (node: any, options?: DragPreviewOptions) => {\n\t\t\tthis.clearDragPreview()\n\t\t\tthis.dragPreviewOptions = options || null\n\t\t\tif (isRef(node)) {\n\t\t\t\tthis.dragPreviewRef = node\n\t\t\t} else {\n\t\t\t\tthis.dragPreviewNode = node\n\t\t\t}\n\t\t\tthis.reconnectDragPreview()\n\t\t},\n\t})\n\tprivate handlerId: Identifier | null = null\n\n\t// The drop target may either be attached via ref or connect function\n\tprivate dragSourceRef: RefObject | null = null\n\tprivate dragSourceNode: any\n\tprivate dragSourceOptionsInternal: DragSourceOptions | null = null\n\tprivate dragSourceUnsubscribe: Unsubscribe | undefined\n\n\t// The drag preview may either be attached via ref or connect function\n\tprivate dragPreviewRef: RefObject | null = null\n\tprivate dragPreviewNode: any\n\tprivate dragPreviewOptionsInternal: DragPreviewOptions | null = null\n\tprivate dragPreviewUnsubscribe: Unsubscribe | undefined\n\n\tprivate lastConnectedHandlerId: Identifier | null = null\n\tprivate lastConnectedDragSource: any = null\n\tprivate lastConnectedDragSourceOptions: any = null\n\tprivate lastConnectedDragPreview: any = null\n\tprivate lastConnectedDragPreviewOptions: any = null\n\n\tprivate readonly backend: Backend\n\n\tpublic constructor(backend: Backend) {\n\t\tthis.backend = backend\n\t}\n\n\tpublic receiveHandlerId(newHandlerId: Identifier | null): void {\n\t\tif (this.handlerId === newHandlerId) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.handlerId = newHandlerId\n\t\tthis.reconnect()\n\t}\n\n\tpublic get connectTarget(): any {\n\t\treturn this.dragSource\n\t}\n\n\tpublic get dragSourceOptions(): DragSourceOptions | null {\n\t\treturn this.dragSourceOptionsInternal\n\t}\n\tpublic set dragSourceOptions(options: DragSourceOptions | null) {\n\t\tthis.dragSourceOptionsInternal = options\n\t}\n\n\tpublic get dragPreviewOptions(): DragPreviewOptions | null {\n\t\treturn this.dragPreviewOptionsInternal\n\t}\n\n\tpublic set dragPreviewOptions(options: DragPreviewOptions | null) {\n\t\tthis.dragPreviewOptionsInternal = options\n\t}\n\n\tpublic reconnect(): void {\n\t\tconst didChange = this.reconnectDragSource()\n\t\tthis.reconnectDragPreview(didChange)\n\t}\n\n\tprivate reconnectDragSource(): boolean {\n\t\tconst dragSource = this.dragSource\n\t\t// if nothing has changed then don't resubscribe\n\t\tconst didChange =\n\t\t\tthis.didHandlerIdChange() ||\n\t\t\tthis.didConnectedDragSourceChange() ||\n\t\t\tthis.didDragSourceOptionsChange()\n\n\t\tif (didChange) {\n\t\t\tthis.disconnectDragSource()\n\t\t}\n\n\t\tif (!this.handlerId) {\n\t\t\treturn didChange\n\t\t}\n\t\tif (!dragSource) {\n\t\t\tthis.lastConnectedDragSource = dragSource\n\t\t\treturn didChange\n\t\t}\n\n\t\tif (didChange) {\n\t\t\tthis.lastConnectedHandlerId = this.handlerId\n\t\t\tthis.lastConnectedDragSource = dragSource\n\t\t\tthis.lastConnectedDragSourceOptions = this.dragSourceOptions\n\t\t\tthis.dragSourceUnsubscribe = this.backend.connectDragSource(\n\t\t\t\tthis.handlerId,\n\t\t\t\tdragSource,\n\t\t\t\tthis.dragSourceOptions,\n\t\t\t)\n\t\t}\n\t\treturn didChange\n\t}\n\n\tprivate reconnectDragPreview(forceDidChange = false): void {\n\t\tconst dragPreview = this.dragPreview\n\t\t// if nothing has changed then don't resubscribe\n\t\tconst didChange =\n\t\t\tforceDidChange ||\n\t\t\tthis.didHandlerIdChange() ||\n\t\t\tthis.didConnectedDragPreviewChange() ||\n\t\t\tthis.didDragPreviewOptionsChange()\n\n\t\tif (didChange) {\n\t\t\tthis.disconnectDragPreview()\n\t\t}\n\n\t\tif (!this.handlerId) {\n\t\t\treturn\n\t\t}\n\t\tif (!dragPreview) {\n\t\t\tthis.lastConnectedDragPreview = dragPreview\n\t\t\treturn\n\t\t}\n\n\t\tif (didChange) {\n\t\t\tthis.lastConnectedHandlerId = this.handlerId\n\t\t\tthis.lastConnectedDragPreview = dragPreview\n\t\t\tthis.lastConnectedDragPreviewOptions = this.dragPreviewOptions\n\t\t\tthis.dragPreviewUnsubscribe = this.backend.connectDragPreview(\n\t\t\t\tthis.handlerId,\n\t\t\t\tdragPreview,\n\t\t\t\tthis.dragPreviewOptions,\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate didHandlerIdChange(): boolean {\n\t\treturn this.lastConnectedHandlerId !== this.handlerId\n\t}\n\n\tprivate didConnectedDragSourceChange(): boolean {\n\t\treturn this.lastConnectedDragSource !== this.dragSource\n\t}\n\n\tprivate didConnectedDragPreviewChange(): boolean {\n\t\treturn this.lastConnectedDragPreview !== this.dragPreview\n\t}\n\n\tprivate didDragSourceOptionsChange(): boolean {\n\t\treturn !shallowEqual(\n\t\t\tthis.lastConnectedDragSourceOptions,\n\t\t\tthis.dragSourceOptions,\n\t\t)\n\t}\n\n\tprivate didDragPreviewOptionsChange(): boolean {\n\t\treturn !shallowEqual(\n\t\t\tthis.lastConnectedDragPreviewOptions,\n\t\t\tthis.dragPreviewOptions,\n\t\t)\n\t}\n\n\tpublic disconnectDragSource() {\n\t\tif (this.dragSourceUnsubscribe) {\n\t\t\tthis.dragSourceUnsubscribe()\n\t\t\tthis.dragSourceUnsubscribe = undefined\n\t\t}\n\t}\n\n\tpublic disconnectDragPreview() {\n\t\tif (this.dragPreviewUnsubscribe) {\n\t\t\tthis.dragPreviewUnsubscribe()\n\t\t\tthis.dragPreviewUnsubscribe = undefined\n\t\t\tthis.dragPreviewNode = null\n\t\t\tthis.dragPreviewRef = null\n\t\t}\n\t}\n\n\tprivate get dragSource() {\n\t\treturn (\n\t\t\tthis.dragSourceNode || (this.dragSourceRef && this.dragSourceRef.current)\n\t\t)\n\t}\n\n\tprivate get dragPreview() {\n\t\treturn (\n\t\t\tthis.dragPreviewNode ||\n\t\t\t(this.dragPreviewRef && this.dragPreviewRef.current)\n\t\t)\n\t}\n\n\tprivate clearDragSource() {\n\t\tthis.dragSourceNode = null\n\t\tthis.dragSourceRef = null\n\t}\n\n\tprivate clearDragPreview() {\n\t\tthis.dragPreviewNode = null\n\t\tthis.dragPreviewRef = null\n\t}\n}\n","import { invariant } from '@react-dnd/invariant'\nimport type {\n\tDragDropManager,\n\tDragDropMonitor,\n\tIdentifier,\n\tListener,\n\tUnsubscribe,\n\tXYCoord,\n} from 'dnd-core'\n\nimport type { DragSourceMonitor } from '../types/index.js'\n\nlet isCallingCanDrag = false\nlet isCallingIsDragging = false\n\nexport class DragSourceMonitorImpl implements DragSourceMonitor {\n\tprivate internalMonitor: DragDropMonitor\n\tprivate sourceId: Identifier | null = null\n\n\tpublic constructor(manager: DragDropManager) {\n\t\tthis.internalMonitor = manager.getMonitor()\n\t}\n\n\tpublic receiveHandlerId(sourceId: Identifier | null): void {\n\t\tthis.sourceId = sourceId\n\t}\n\n\tpublic getHandlerId(): Identifier | null {\n\t\treturn this.sourceId\n\t}\n\n\tpublic canDrag(): boolean {\n\t\tinvariant(\n\t\t\t!isCallingCanDrag,\n\t\t\t'You may not call monitor.canDrag() inside your canDrag() implementation. ' +\n\t\t\t\t'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor',\n\t\t)\n\n\t\ttry {\n\t\t\tisCallingCanDrag = true\n\t\t\treturn this.internalMonitor.canDragSource(this.sourceId as Identifier)\n\t\t} finally {\n\t\t\tisCallingCanDrag = false\n\t\t}\n\t}\n\n\tpublic isDragging(): boolean {\n\t\tif (!this.sourceId) {\n\t\t\treturn false\n\t\t}\n\t\tinvariant(\n\t\t\t!isCallingIsDragging,\n\t\t\t'You may not call monitor.isDragging() inside your isDragging() implementation. ' +\n\t\t\t\t'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor',\n\t\t)\n\n\t\ttry {\n\t\t\tisCallingIsDragging = true\n\t\t\treturn this.internalMonitor.isDraggingSource(this.sourceId)\n\t\t} finally {\n\t\t\tisCallingIsDragging = false\n\t\t}\n\t}\n\n\tpublic subscribeToStateChange(\n\t\tlistener: Listener,\n\t\toptions?: { handlerIds?: Identifier[] },\n\t): Unsubscribe {\n\t\treturn this.internalMonitor.subscribeToStateChange(listener, options)\n\t}\n\n\tpublic isDraggingSource(sourceId: Identifier): boolean {\n\t\treturn this.internalMonitor.isDraggingSource(sourceId)\n\t}\n\n\tpublic isOverTarget(\n\t\ttargetId: Identifier,\n\t\toptions?: { shallow: boolean },\n\t): boolean {\n\t\treturn this.internalMonitor.isOverTarget(targetId, options)\n\t}\n\n\tpublic getTargetIds(): Identifier[] {\n\t\treturn this.internalMonitor.getTargetIds()\n\t}\n\n\tpublic isSourcePublic(): boolean | null {\n\t\treturn this.internalMonitor.isSourcePublic()\n\t}\n\n\tpublic getSourceId(): Identifier | null {\n\t\treturn this.internalMonitor.getSourceId()\n\t}\n\n\tpublic subscribeToOffsetChange(listener: Listener): Unsubscribe {\n\t\treturn this.internalMonitor.subscribeToOffsetChange(listener)\n\t}\n\n\tpublic canDragSource(sourceId: Identifier): boolean {\n\t\treturn this.internalMonitor.canDragSource(sourceId)\n\t}\n\n\tpublic canDropOnTarget(targetId: Identifier): boolean {\n\t\treturn this.internalMonitor.canDropOnTarget(targetId)\n\t}\n\n\tpublic getItemType(): Identifier | null {\n\t\treturn this.internalMonitor.getItemType()\n\t}\n\n\tpublic getItem(): any {\n\t\treturn this.internalMonitor.getItem()\n\t}\n\n\tpublic getDropResult(): any {\n\t\treturn this.internalMonitor.getDropResult()\n\t}\n\n\tpublic didDrop(): boolean {\n\t\treturn this.internalMonitor.didDrop()\n\t}\n\n\tpublic getInitialClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getInitialClientOffset()\n\t}\n\n\tpublic getInitialSourceClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getInitialSourceClientOffset()\n\t}\n\n\tpublic getSourceClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getSourceClientOffset()\n\t}\n\n\tpublic getClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getClientOffset()\n\t}\n\n\tpublic getDifferenceFromInitialOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getDifferenceFromInitialOffset()\n\t}\n}\n","import type { DragDropMonitor, DragSource, Identifier } from 'dnd-core'\n\nimport type { Connector } from '../../internals/index.js'\nimport type { DragSourceMonitor } from '../../types/index.js'\nimport type { DragObjectFactory, DragSourceHookSpec } from '../types.js'\n\nexport class DragSourceImpl implements DragSource {\n\tpublic constructor(\n\t\tpublic spec: DragSourceHookSpec,\n\t\tprivate monitor: DragSourceMonitor,\n\t\tprivate connector: Connector,\n\t) {}\n\n\tpublic beginDrag() {\n\t\tconst spec = this.spec\n\t\tconst monitor = this.monitor\n\n\t\tlet result: O | null = null\n\t\tif (typeof spec.item === 'object') {\n\t\t\tresult = spec.item as O\n\t\t} else if (typeof spec.item === 'function') {\n\t\t\tresult = (spec.item as DragObjectFactory)(monitor)\n\t\t} else {\n\t\t\tresult = {} as O\n\t\t}\n\t\treturn result ?? null\n\t}\n\n\tpublic canDrag() {\n\t\tconst spec = this.spec\n\t\tconst monitor = this.monitor\n\t\tif (typeof spec.canDrag === 'boolean') {\n\t\t\treturn spec.canDrag\n\t\t} else if (typeof spec.canDrag === 'function') {\n\t\t\treturn spec.canDrag(monitor)\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tpublic isDragging(globalMonitor: DragDropMonitor, target: Identifier) {\n\t\tconst spec = this.spec\n\t\tconst monitor = this.monitor\n\t\tconst { isDragging } = spec\n\t\treturn isDragging\n\t\t\t? isDragging(monitor)\n\t\t\t: target === globalMonitor.getSourceId()\n\t}\n\n\tpublic endDrag() {\n\t\tconst spec = this.spec\n\t\tconst monitor = this.monitor\n\t\tconst connector = this.connector\n\t\tconst { end } = spec\n\t\tif (end) {\n\t\t\tend(monitor.getItem(), monitor)\n\t\t}\n\t\tconnector.reconnect()\n\t}\n}\n","import type { SourceConnector } from '../../internals/index.js'\nimport { registerSource } from '../../internals/index.js'\nimport type { DragSourceMonitor } from '../../types/index.js'\nimport type { DragSourceHookSpec } from '../types.js'\nimport { useDragDropManager } from '../useDragDropManager.js'\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js'\nimport { useDragSource } from './useDragSource.js'\nimport { useDragType } from './useDragType.js'\n\nexport function useRegisteredDragSource(\n\tspec: DragSourceHookSpec,\n\tmonitor: DragSourceMonitor,\n\tconnector: SourceConnector,\n): void {\n\tconst manager = useDragDropManager()\n\tconst handler = useDragSource(spec, monitor, connector)\n\tconst itemType = useDragType(spec)\n\n\tuseIsomorphicLayoutEffect(\n\t\tfunction registerDragSource() {\n\t\t\tif (itemType != null) {\n\t\t\t\tconst [handlerId, unregister] = registerSource(\n\t\t\t\t\titemType,\n\t\t\t\t\thandler,\n\t\t\t\t\tmanager,\n\t\t\t\t)\n\t\t\t\tmonitor.receiveHandlerId(handlerId)\n\t\t\t\tconnector.receiveHandlerId(handlerId)\n\t\t\t\treturn unregister\n\t\t\t}\n\t\t\treturn\n\t\t},\n\t\t[manager, monitor, connector, handler, itemType],\n\t)\n}\n","import { useEffect, useMemo } from 'react'\n\nimport type { Connector } from '../../internals/index.js'\nimport type { DragSourceMonitor } from '../../types/index.js'\nimport type { DragSourceHookSpec } from '../types.js'\nimport { DragSourceImpl } from './DragSourceImpl.js'\n\nexport function useDragSource(\n\tspec: DragSourceHookSpec,\n\tmonitor: DragSourceMonitor,\n\tconnector: Connector,\n) {\n\tconst handler = useMemo(\n\t\t() => new DragSourceImpl(spec, monitor, connector),\n\t\t[monitor, connector],\n\t)\n\tuseEffect(() => {\n\t\thandler.spec = spec\n\t}, [spec])\n\treturn handler\n}\n","import { invariant } from '@react-dnd/invariant'\nimport type { Identifier } from 'dnd-core'\nimport { useMemo } from 'react'\n\nimport type { DragSourceHookSpec } from '../types.js'\n\nexport function useDragType(\n\tspec: DragSourceHookSpec,\n): Identifier {\n\treturn useMemo(() => {\n\t\tconst result: Identifier = spec.type\n\t\tinvariant(result != null, 'spec.type must be defined')\n\t\treturn result\n\t}, [spec])\n}\n","import { invariant } from '@react-dnd/invariant'\n\nimport type {\n\tConnectDragPreview,\n\tConnectDragSource,\n} from '../../types/index.js'\nimport type { DragSourceHookSpec, FactoryOrInstance } from '../types.js'\nimport { useCollectedProps } from '../useCollectedProps.js'\nimport { useOptionalFactory } from '../useOptionalFactory.js'\nimport { useConnectDragPreview, useConnectDragSource } from './connectors.js'\nimport { useDragSourceConnector } from './useDragSourceConnector.js'\nimport { useDragSourceMonitor } from './useDragSourceMonitor.js'\nimport { useRegisteredDragSource } from './useRegisteredDragSource.js'\n\n/**\n * useDragSource hook\n * @param sourceSpec The drag source specification (object or function, function preferred)\n * @param deps The memoization deps array to use when evaluating spec changes\n */\nexport function useDrag<\n\tDragObject = unknown,\n\tDropResult = unknown,\n\tCollectedProps = unknown,\n>(\n\tspecArg: FactoryOrInstance<\n\t\tDragSourceHookSpec\n\t>,\n\tdeps?: unknown[],\n): [CollectedProps, ConnectDragSource, ConnectDragPreview] {\n\tconst spec = useOptionalFactory(specArg, deps)\n\tinvariant(\n\t\t!(spec as any).begin,\n\t\t`useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)`,\n\t)\n\n\tconst monitor = useDragSourceMonitor()\n\tconst connector = useDragSourceConnector(spec.options, spec.previewOptions)\n\tuseRegisteredDragSource(spec, monitor, connector)\n\n\treturn [\n\t\tuseCollectedProps(spec.collect, monitor, connector),\n\t\tuseConnectDragSource(connector),\n\t\tuseConnectDragPreview(connector),\n\t]\n}\n","import { useMemo } from 'react'\n\nimport { DragSourceMonitorImpl } from '../../internals/index.js'\nimport type { DragSourceMonitor } from '../../types/index.js'\nimport { useDragDropManager } from '../useDragDropManager.js'\n\nexport function useDragSourceMonitor(): DragSourceMonitor {\n\tconst manager = useDragDropManager()\n\treturn useMemo>(\n\t\t() => new DragSourceMonitorImpl(manager),\n\t\t[manager],\n\t)\n}\n","import { useMemo } from 'react'\n\nimport { SourceConnector } from '../../internals/index.js'\nimport type {\n\tDragPreviewOptions,\n\tDragSourceOptions,\n} from '../../types/index.js'\nimport { useDragDropManager } from '../useDragDropManager.js'\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js'\n\nexport function useDragSourceConnector(\n\tdragSourceOptions: DragSourceOptions | undefined,\n\tdragPreviewOptions: DragPreviewOptions | undefined,\n): SourceConnector {\n\tconst manager = useDragDropManager()\n\tconst connector = useMemo(\n\t\t() => new SourceConnector(manager.getBackend()),\n\t\t[manager],\n\t)\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconnector.dragSourceOptions = dragSourceOptions || null\n\t\tconnector.reconnect()\n\t\treturn () => connector.disconnectDragSource()\n\t}, [connector, dragSourceOptions])\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconnector.dragPreviewOptions = dragPreviewOptions || null\n\t\tconnector.reconnect()\n\t\treturn () => connector.disconnectDragPreview()\n\t}, [connector, dragPreviewOptions])\n\treturn connector\n}\n","import { useMemo } from 'react'\n\nimport type { TargetConnector } from '../../internals/index.js'\n\nexport function useConnectDropTarget(connector: TargetConnector) {\n\treturn useMemo(() => connector.hooks.dropTarget(), [connector])\n}\n","import { shallowEqual } from '@react-dnd/shallowequal'\nimport type { Backend, Identifier, Unsubscribe } from 'dnd-core'\nimport type { RefObject } from 'react'\n\nimport type { DropTargetOptions } from '../types/index.js'\nimport { isRef } from './isRef.js'\nimport type { Connector } from './SourceConnector.js'\nimport { wrapConnectorHooks } from './wrapConnectorHooks.js'\n\nexport class TargetConnector implements Connector {\n\tpublic hooks = wrapConnectorHooks({\n\t\tdropTarget: (node: any, options: DropTargetOptions) => {\n\t\t\tthis.clearDropTarget()\n\t\t\tthis.dropTargetOptions = options\n\t\t\tif (isRef(node)) {\n\t\t\t\tthis.dropTargetRef = node\n\t\t\t} else {\n\t\t\t\tthis.dropTargetNode = node\n\t\t\t}\n\t\t\tthis.reconnect()\n\t\t},\n\t})\n\n\tprivate handlerId: Identifier | null = null\n\t// The drop target may either be attached via ref or connect function\n\tprivate dropTargetRef: RefObject | null = null\n\tprivate dropTargetNode: any\n\tprivate dropTargetOptionsInternal: DropTargetOptions | null = null\n\tprivate unsubscribeDropTarget: Unsubscribe | undefined\n\n\tprivate lastConnectedHandlerId: Identifier | null = null\n\tprivate lastConnectedDropTarget: any = null\n\tprivate lastConnectedDropTargetOptions: DropTargetOptions | null = null\n\tprivate readonly backend: Backend\n\n\tpublic constructor(backend: Backend) {\n\t\tthis.backend = backend\n\t}\n\n\tpublic get connectTarget(): any {\n\t\treturn this.dropTarget\n\t}\n\n\tpublic reconnect(): void {\n\t\t// if nothing has changed then don't resubscribe\n\t\tconst didChange =\n\t\t\tthis.didHandlerIdChange() ||\n\t\t\tthis.didDropTargetChange() ||\n\t\t\tthis.didOptionsChange()\n\n\t\tif (didChange) {\n\t\t\tthis.disconnectDropTarget()\n\t\t}\n\n\t\tconst dropTarget = this.dropTarget\n\t\tif (!this.handlerId) {\n\t\t\treturn\n\t\t}\n\t\tif (!dropTarget) {\n\t\t\tthis.lastConnectedDropTarget = dropTarget\n\t\t\treturn\n\t\t}\n\n\t\tif (didChange) {\n\t\t\tthis.lastConnectedHandlerId = this.handlerId\n\t\t\tthis.lastConnectedDropTarget = dropTarget\n\t\t\tthis.lastConnectedDropTargetOptions = this.dropTargetOptions\n\n\t\t\tthis.unsubscribeDropTarget = this.backend.connectDropTarget(\n\t\t\t\tthis.handlerId,\n\t\t\t\tdropTarget,\n\t\t\t\tthis.dropTargetOptions,\n\t\t\t)\n\t\t}\n\t}\n\n\tpublic receiveHandlerId(newHandlerId: Identifier | null): void {\n\t\tif (newHandlerId === this.handlerId) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.handlerId = newHandlerId\n\t\tthis.reconnect()\n\t}\n\n\tpublic get dropTargetOptions(): DropTargetOptions {\n\t\treturn this.dropTargetOptionsInternal\n\t}\n\tpublic set dropTargetOptions(options: DropTargetOptions) {\n\t\tthis.dropTargetOptionsInternal = options\n\t}\n\n\tprivate didHandlerIdChange(): boolean {\n\t\treturn this.lastConnectedHandlerId !== this.handlerId\n\t}\n\n\tprivate didDropTargetChange(): boolean {\n\t\treturn this.lastConnectedDropTarget !== this.dropTarget\n\t}\n\n\tprivate didOptionsChange(): boolean {\n\t\treturn !shallowEqual(\n\t\t\tthis.lastConnectedDropTargetOptions,\n\t\t\tthis.dropTargetOptions,\n\t\t)\n\t}\n\n\tpublic disconnectDropTarget() {\n\t\tif (this.unsubscribeDropTarget) {\n\t\t\tthis.unsubscribeDropTarget()\n\t\t\tthis.unsubscribeDropTarget = undefined\n\t\t}\n\t}\n\n\tprivate get dropTarget() {\n\t\treturn (\n\t\t\tthis.dropTargetNode || (this.dropTargetRef && this.dropTargetRef.current)\n\t\t)\n\t}\n\n\tprivate clearDropTarget() {\n\t\tthis.dropTargetRef = null\n\t\tthis.dropTargetNode = null\n\t}\n}\n","import { invariant } from '@react-dnd/invariant'\nimport type {\n\tDragDropManager,\n\tDragDropMonitor,\n\tIdentifier,\n\tListener,\n\tUnsubscribe,\n\tXYCoord,\n} from 'dnd-core'\n\nimport type { DropTargetMonitor } from '../types/index.js'\n\nlet isCallingCanDrop = false\n\nexport class DropTargetMonitorImpl implements DropTargetMonitor {\n\tprivate internalMonitor: DragDropMonitor\n\tprivate targetId: Identifier | null = null\n\n\tpublic constructor(manager: DragDropManager) {\n\t\tthis.internalMonitor = manager.getMonitor()\n\t}\n\n\tpublic receiveHandlerId(targetId: Identifier | null): void {\n\t\tthis.targetId = targetId\n\t}\n\n\tpublic getHandlerId(): Identifier | null {\n\t\treturn this.targetId\n\t}\n\n\tpublic subscribeToStateChange(\n\t\tlistener: Listener,\n\t\toptions?: { handlerIds?: Identifier[] },\n\t): Unsubscribe {\n\t\treturn this.internalMonitor.subscribeToStateChange(listener, options)\n\t}\n\n\tpublic canDrop(): boolean {\n\t\t// Cut out early if the target id has not been set. This should prevent errors\n\t\t// where the user has an older version of dnd-core like in\n\t\t// https://github.com/react-dnd/react-dnd/issues/1310\n\t\tif (!this.targetId) {\n\t\t\treturn false\n\t\t}\n\t\tinvariant(\n\t\t\t!isCallingCanDrop,\n\t\t\t'You may not call monitor.canDrop() inside your canDrop() implementation. ' +\n\t\t\t\t'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor',\n\t\t)\n\n\t\ttry {\n\t\t\tisCallingCanDrop = true\n\t\t\treturn this.internalMonitor.canDropOnTarget(this.targetId)\n\t\t} finally {\n\t\t\tisCallingCanDrop = false\n\t\t}\n\t}\n\n\tpublic isOver(options?: { shallow?: boolean }): boolean {\n\t\tif (!this.targetId) {\n\t\t\treturn false\n\t\t}\n\t\treturn this.internalMonitor.isOverTarget(this.targetId, options)\n\t}\n\n\tpublic getItemType(): Identifier | null {\n\t\treturn this.internalMonitor.getItemType()\n\t}\n\n\tpublic getItem(): any {\n\t\treturn this.internalMonitor.getItem()\n\t}\n\n\tpublic getDropResult(): any {\n\t\treturn this.internalMonitor.getDropResult()\n\t}\n\n\tpublic didDrop(): boolean {\n\t\treturn this.internalMonitor.didDrop()\n\t}\n\n\tpublic getInitialClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getInitialClientOffset()\n\t}\n\n\tpublic getInitialSourceClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getInitialSourceClientOffset()\n\t}\n\n\tpublic getSourceClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getSourceClientOffset()\n\t}\n\n\tpublic getClientOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getClientOffset()\n\t}\n\n\tpublic getDifferenceFromInitialOffset(): XYCoord | null {\n\t\treturn this.internalMonitor.getDifferenceFromInitialOffset()\n\t}\n}\n","import type { DropTarget } from 'dnd-core'\n\nimport type { DropTargetMonitor } from '../../types/index.js'\nimport type { DropTargetHookSpec } from '../types.js'\n\nexport class DropTargetImpl implements DropTarget {\n\tpublic constructor(\n\t\tpublic spec: DropTargetHookSpec,\n\t\tprivate monitor: DropTargetMonitor,\n\t) {}\n\n\tpublic canDrop() {\n\t\tconst spec = this.spec\n\t\tconst monitor = this.monitor\n\t\treturn spec.canDrop ? spec.canDrop(monitor.getItem(), monitor) : true\n\t}\n\n\tpublic hover() {\n\t\tconst spec = this.spec\n\t\tconst monitor = this.monitor\n\t\tif (spec.hover) {\n\t\t\tspec.hover(monitor.getItem(), monitor)\n\t\t}\n\t}\n\n\tpublic drop() {\n\t\tconst spec = this.spec\n\t\tconst monitor = this.monitor\n\t\tif (spec.drop) {\n\t\t\treturn spec.drop(monitor.getItem(), monitor)\n\t\t}\n\t\treturn\n\t}\n}\n","import type { TargetConnector } from '../../internals/index.js'\nimport { registerTarget } from '../../internals/index.js'\nimport type { DropTargetMonitor } from '../../types/index.js'\nimport type { DropTargetHookSpec } from '../types.js'\nimport { useDragDropManager } from '../useDragDropManager.js'\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js'\nimport { useAccept } from './useAccept.js'\nimport { useDropTarget } from './useDropTarget.js'\n\nexport function useRegisteredDropTarget(\n\tspec: DropTargetHookSpec,\n\tmonitor: DropTargetMonitor,\n\tconnector: TargetConnector,\n): void {\n\tconst manager = useDragDropManager()\n\tconst dropTarget = useDropTarget(spec, monitor)\n\tconst accept = useAccept(spec)\n\n\tuseIsomorphicLayoutEffect(\n\t\tfunction registerDropTarget() {\n\t\t\tconst [handlerId, unregister] = registerTarget(\n\t\t\t\taccept,\n\t\t\t\tdropTarget,\n\t\t\t\tmanager,\n\t\t\t)\n\t\t\tmonitor.receiveHandlerId(handlerId)\n\t\t\tconnector.receiveHandlerId(handlerId)\n\t\t\treturn unregister\n\t\t},\n\t\t[\n\t\t\tmanager,\n\t\t\tmonitor,\n\t\t\tdropTarget,\n\t\t\tconnector,\n\t\t\taccept.map((a) => a.toString()).join('|'),\n\t\t],\n\t)\n}\n","import { useEffect, useMemo } from 'react'\n\nimport type { DropTargetMonitor } from '../../types/index.js'\nimport type { DropTargetHookSpec } from '../types.js'\nimport { DropTargetImpl } from './DropTargetImpl.js'\n\nexport function useDropTarget(\n\tspec: DropTargetHookSpec,\n\tmonitor: DropTargetMonitor,\n) {\n\tconst dropTarget = useMemo(() => new DropTargetImpl(spec, monitor), [monitor])\n\tuseEffect(() => {\n\t\tdropTarget.spec = spec\n\t}, [spec])\n\treturn dropTarget\n}\n","import { invariant } from '@react-dnd/invariant'\nimport type { Identifier } from 'dnd-core'\nimport { useMemo } from 'react'\n\nimport type { DropTargetHookSpec } from '../types.js'\n\n/**\n * Internal utility hook to get an array-version of spec.accept.\n * The main utility here is that we aren't creating a new array on every render if a non-array spec.accept is passed in.\n * @param spec\n */\nexport function useAccept(\n\tspec: DropTargetHookSpec,\n): Identifier[] {\n\tconst { accept } = spec\n\treturn useMemo(() => {\n\t\tinvariant(spec.accept != null, 'accept must be defined')\n\t\treturn Array.isArray(accept) ? accept : [accept]\n\t}, [accept])\n}\n","import type { ConnectDropTarget } from '../../types/index.js'\nimport type { DropTargetHookSpec, FactoryOrInstance } from '../types.js'\nimport { useCollectedProps } from '../useCollectedProps.js'\nimport { useOptionalFactory } from '../useOptionalFactory.js'\nimport { useConnectDropTarget } from './connectors.js'\nimport { useDropTargetConnector } from './useDropTargetConnector.js'\nimport { useDropTargetMonitor } from './useDropTargetMonitor.js'\nimport { useRegisteredDropTarget } from './useRegisteredDropTarget.js'\n\n/**\n * useDropTarget Hook\n * @param spec The drop target specification (object or function, function preferred)\n * @param deps The memoization deps array to use when evaluating spec changes\n */\nexport function useDrop<\n\tDragObject = unknown,\n\tDropResult = unknown,\n\tCollectedProps = unknown,\n>(\n\tspecArg: FactoryOrInstance<\n\t\tDropTargetHookSpec\n\t>,\n\tdeps?: unknown[],\n): [CollectedProps, ConnectDropTarget] {\n\tconst spec = useOptionalFactory(specArg, deps)\n\tconst monitor = useDropTargetMonitor()\n\tconst connector = useDropTargetConnector(spec.options)\n\tuseRegisteredDropTarget(spec, monitor, connector)\n\n\treturn [\n\t\tuseCollectedProps(spec.collect, monitor, connector),\n\t\tuseConnectDropTarget(connector),\n\t]\n}\n","import { useMemo } from 'react'\n\nimport { DropTargetMonitorImpl } from '../../internals/index.js'\nimport type { DropTargetMonitor } from '../../types/index.js'\nimport { useDragDropManager } from '../useDragDropManager.js'\n\nexport function useDropTargetMonitor(): DropTargetMonitor {\n\tconst manager = useDragDropManager()\n\treturn useMemo(() => new DropTargetMonitorImpl(manager), [manager])\n}\n","import { useMemo } from 'react'\n\nimport { TargetConnector } from '../../internals/index.js'\nimport type { DropTargetOptions } from '../../types/index.js'\nimport { useDragDropManager } from '../useDragDropManager.js'\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js'\n\nexport function useDropTargetConnector(\n\toptions: DropTargetOptions,\n): TargetConnector {\n\tconst manager = useDragDropManager()\n\tconst connector = useMemo(\n\t\t() => new TargetConnector(manager.getBackend()),\n\t\t[manager],\n\t)\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconnector.dropTargetOptions = options || null\n\t\tconnector.reconnect()\n\t\treturn () => connector.disconnectDropTarget()\n\t}, [options])\n\treturn connector\n}\n","import { useEffect, useLayoutEffect } from 'react'\n\n// suppress the useLayoutEffect warning on server side.\nexport const useIsomorphicLayoutEffect =\n\ttypeof window !== 'undefined' ? useLayoutEffect : useEffect\n","import { useMemo } from 'react'\n\nimport type { FactoryOrInstance } from './types.js'\n\nexport function useOptionalFactory(\n\targ: FactoryOrInstance,\n\tdeps?: unknown[],\n): T {\n\tconst memoDeps = [...(deps || [])]\n\tif (deps == null && typeof arg !== 'function') {\n\t\tmemoDeps.push(arg)\n\t}\n\treturn useMemo(() => {\n\t\treturn typeof arg === 'function' ? (arg as () => T)() : (arg as T)\n\t}, memoDeps)\n}\n","export interface Ref {\n\tcurrent: T\n}\n\nexport function isRef(obj: unknown): boolean {\n\treturn (\n\t\t// eslint-disable-next-line no-prototype-builtins\n\t\tobj !== null &&\n\t\ttypeof obj === 'object' &&\n\t\tObject.prototype.hasOwnProperty.call(obj, 'current')\n\t)\n}\n","import type {\n\tDragDropManager,\n\tDragSource,\n\tDropTarget,\n\tIdentifier,\n\tSourceType,\n\tTargetType,\n\tUnsubscribe,\n} from 'dnd-core'\n\nexport function registerTarget(\n\ttype: TargetType,\n\ttarget: DropTarget,\n\tmanager: DragDropManager,\n): [Identifier, Unsubscribe] {\n\tconst registry = manager.getRegistry()\n\tconst targetId = registry.addTarget(type, target)\n\n\treturn [targetId, () => registry.removeTarget(targetId)]\n}\n\nexport function registerSource(\n\ttype: SourceType,\n\tsource: DragSource,\n\tmanager: DragDropManager,\n): [Identifier, Unsubscribe] {\n\tconst registry = manager.getRegistry()\n\tconst sourceId = registry.addSource(type, source)\n\n\treturn [sourceId, () => registry.removeSource(sourceId)]\n}\n","import { invariant } from '@react-dnd/invariant'\nimport type { ReactElement } from 'react'\nimport { cloneElement, isValidElement } from 'react'\n\nfunction throwIfCompositeComponentElement(element: ReactElement) {\n\t// Custom components can no longer be wrapped directly in React DnD 2.0\n\t// so that we don't need to depend on findDOMNode() from react-dom.\n\tif (typeof element.type === 'string') {\n\t\treturn\n\t}\n\n\tconst displayName =\n\t\t(element.type as any).displayName || element.type.name || 'the component'\n\n\tthrow new Error(\n\t\t'Only native element nodes can now be passed to React DnD connectors.' +\n\t\t\t`You can either wrap ${displayName} into a
, or turn it into a ` +\n\t\t\t'drag source or a drop target itself.',\n\t)\n}\n\nfunction wrapHookToRecognizeElement(hook: (node: any, options: any) => void) {\n\treturn (elementOrNode = null, options = null) => {\n\t\t// When passed a node, call the hook straight away.\n\t\tif (!isValidElement(elementOrNode)) {\n\t\t\tconst node = elementOrNode\n\t\t\thook(node, options)\n\t\t\t// return the node so it can be chained (e.g. when within callback refs\n\t\t\t//
connectDragSource(connectDropTarget(node))}/>\n\t\t\treturn node\n\t\t}\n\n\t\t// If passed a ReactElement, clone it and attach this function as a ref.\n\t\t// This helps us achieve a neat API where user doesn't even know that refs\n\t\t// are being used under the hood.\n\t\tconst element: ReactElement | null = elementOrNode\n\t\tthrowIfCompositeComponentElement(element as any)\n\n\t\t// When no options are passed, use the hook directly\n\t\tconst ref = options ? (node: Element) => hook(node, options) : hook\n\t\treturn cloneWithRef(element, ref)\n\t}\n}\n\nexport function wrapConnectorHooks(hooks: any) {\n\tconst wrappedHooks: any = {}\n\n\tObject.keys(hooks).forEach((key) => {\n\t\tconst hook = hooks[key]\n\n\t\t// ref objects should be passed straight through without wrapping\n\t\tif (key.endsWith('Ref')) {\n\t\t\twrappedHooks[key] = hooks[key]\n\t\t} else {\n\t\t\tconst wrappedHook = wrapHookToRecognizeElement(hook)\n\t\t\twrappedHooks[key] = () => wrappedHook\n\t\t}\n\t})\n\n\treturn wrappedHooks\n}\n\nfunction setRef(ref: any, node: any) {\n\tif (typeof ref === 'function') {\n\t\tref(node)\n\t} else {\n\t\tref.current = node\n\t}\n}\n\nfunction cloneWithRef(element: any, newRef: any): ReactElement {\n\tconst previousRef = element.ref\n\tinvariant(\n\t\ttypeof previousRef !== 'string',\n\t\t'Cannot connect React DnD to an element with an existing string ref. ' +\n\t\t\t'Please convert it to use a callback ref instead, or wrap it into a or
. ' +\n\t\t\t'Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs',\n\t)\n\n\tif (!previousRef) {\n\t\t// When there is no ref on the element, use the new ref directly\n\t\treturn cloneElement(element, {\n\t\t\tref: newRef,\n\t\t})\n\t} else {\n\t\treturn cloneElement(element, {\n\t\t\tref: (node: any) => {\n\t\t\t\tsetRef(previousRef, node)\n\t\t\t\tsetRef(newRef, node)\n\t\t\t},\n\t\t})\n\t}\n}\n"],"names":["module","exports","equal","a","b","constructor","length","i","keys","Array","isArray","RegExp","source","flags","valueOf","Object","prototype","toString","hasOwnProperty","call","key","f","require","k","Symbol","for","l","m","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","ref","__self","__source","q","c","g","d","e","h","defaultProps","$$typeof","type","props","_owner","current","jsx","r","t","u","v","w","x","y","z","iterator","B","isMounted","enqueueForceUpdate","enqueueReplaceState","enqueueSetState","C","assign","D","E","this","context","refs","updater","F","G","isReactComponent","setState","Error","forceUpdate","H","isPureReactComponent","I","J","K","L","M","arguments","children","O","P","Q","replace","escape","R","N","push","A","next","done","value","String","join","S","T","_status","_result","then","default","U","V","transition","W","ReactCurrentDispatcher","ReactCurrentBatchConfig","X","Children","map","forEach","apply","count","toArray","only","Component","Fragment","Profiler","PureComponent","StrictMode","Suspense","act","cloneElement","createContext","_currentValue","_currentValue2","_threadCount","Provider","Consumer","_defaultValue","_globalName","_context","createElement","createFactory","bind","createRef","forwardRef","render","isValidElement","lazy","_payload","_init","memo","compare","startTransition","unstable_act","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useSyncExternalStore","useTransition","version","_createForOfIteratorHelper","o","allowArrayLike","it","s","_e","TypeError","err","normalCompletion","didErr","step","_e2","invariant","condition","format","args","isProduction","undefined","error","argIndex","name","framesToPop","process","shallowEqual","objA","objB","compareContext","compareResult","keysA","keysB","bHasOwnProperty","idx","valueA","valueB","has","get","WeakSet","add","set","register","unregister","indexOf","splice","backendChanged","WeakMap","backend","JSON","stringify","options","id","console","warn","instance","preview","skipDispatchOnTransition","setup","window","isSetUp","teardown","connectDragSource","connectDragPreview","connectDropTarget","profile","previewEnabled","previewsList","backendsList","addEventListener","event","removeEventListener","some","check","unsubscribe","func","target","dispatchEvent","backends","touches","pointerType","memoize","fn","result","EnterLeaveCounter","isNodeInDocument","entered","enteringNode","previousLength","itemsA","itemsB","Set","insertItem","item","union","filter","node","contains","leavingNode","items","NativeDragSource","config","initializeExposedProperties","exposeProperties","property","defineProperty","configurable","enumerable","dataTransfer","newProperties","propertyFn","matchesTypes","defineProperties","monitor","handle","getSourceId","FILE","URL","TEXT","HTML","getDataFromDataTransfer","typesToTry","defaultValue","reduce","resultSoFar","typeToTry","getData","nativeTypesConfig","NativeTypes","files","slice","html","urls","split","text","matchNativeItemType","dataTransferTypes","types","nativeItemType","typeConfig","isFirefox","test","navigator","userAgent","isSafari","Boolean","safari","MonotonicInterpolant","xs","ys","indexes","sort","dx","dy","dys","dxs","ms","c1s","m2","mNext","dxNext","common","c2s","c3s","c1","invDx","mid","low","high","xHere","Math","floor","diff","max","diffSq","getNodeClientOffset","el","nodeType","parentElement","getBoundingClientRect","top","left","getEventClientOffset","clientX","clientY","getDragPreviewOffset","sourceNode","dragPreview","clientOffset","anchorPoint","offsetPoint","isImage","document","nodeName","documentElement","isImageNode","dragPreviewNodeOffsetFromClient","offsetFromDragPreview","sourceWidth","offsetWidth","sourceHeight","offsetHeight","anchorX","anchorY","dragPreviewWidth","width","dragPreviewHeight","height","devicePixelRatio","getDragPreviewSize","offsetX","offsetY","isManualOffsetY","interpolate","calculateYOffset","OptionsReader","globalContext","ownerDocument","optionsArgs","rootElement","HTML5BackendImpl","manager","sourcePreviewNodes","Map","sourcePreviewNodeOptions","sourceNodes","sourceNodeOptions","dragStartSourceIds","dropTargetIds","dragEnterTargetIds","currentNativeSource","currentNativeHandle","currentDragSourceNode","altKeyPressed","mouseMoveTimeoutTimer","asyncEndDragFrameId","dragOverTargetIds","lastClientOffset","hoverRafId","getSourceClientOffset","sourceId","endDragNativeItem","isDraggingNativeItem","actions","endDrag","registry","removeSource","body","endDragIfSourceWasRemovedFromDOM","clearCurrentDragSourceNode","isDragging","cancelHover","scheduleHover","requestAnimationFrame","hover","cancelAnimationFrame","handleTopDragStartCapture","handleTopDragStart","defaultPrevented","beginDrag","publishSource","nativeType","setDragImage","getCurrentSourcePreviewNodeOptions","dragPreviewOffset","setData","setCurrentDragSourceNode","captureDraggingState","publishDragSource","setTimeout","beginDragNativeItem","hasAttribute","preventDefault","handleTopDragEndCapture","handleTopDragEnterCapture","loadDataTransfer","enterLeaveCounter","enter","handleTopDragEnter","altKey","targetId","canDropOnTarget","dropEffect","getCurrentDropEffect","handleTopDragOverCapture","handleTopDragOver","handleTopDragLeaveCapture","leave","handleTopDropCapture","reset","handleTopDrop","drop","handleSelectStart","dragDrop","tagName","isContentEditable","getActions","getMonitor","getRegistry","ref1","size","root","__isReactDndBackendSetUp","addEventListeners","removeEventListeners","delete","handleDragStart","setAttribute","handleDragEnter","handleDragOver","handleDrop","_objectSpread","getCurrentSourceNodeOptions","itemType","getItemType","createNativeDragSource","addSource","clearTimeout","unshift","HTML5Backend","formatProdErrorMessage","code","$$observable","observable","randomString","random","substring","ActionTypes","INIT","REPLACE","PROBE_UNKNOWN_ACTION","isPlainObject","obj","proto","getPrototypeOf","createStore","reducer","preloadedState","enhancer","_ref2","currentReducer","currentState","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","getState","subscribe","listener","isSubscribed","index","dispatch","action","listeners","replaceReducer","nextReducer","_ref","outerSubscribe","observer","observeState","path","without","isObject","input","xor","INIT_COORDS","BEGIN_DRAG","PUBLISH_DRAG_SOURCE","HOVER","DROP","END_DRAG","setClientOffset","sourceClientOffset","payload","ResetCoordinatesAction","createBeginDrag","sourceIds","verifyInvariants","getDraggableSource","verifyGetSourceClientOffsetIsFunction","getSource","verifyItemIsObject","pinSource","getSourceType","isSourcePublic","canDragSource","createDrop","targetIds","getDroppableTargets","dropResult","determineDropResult","didDrop","getTarget","verifyDropResultType","getDropResult","getTargetIds","reverse","createEndDrag","verifyIsDragging","unpinSource","matchesType","targetType","draggedItemType","createHover","targetIdsArg","verifyTargetIdsIsArray","removeNonMatchingTargetIds","checkInvariants","hoverAllTargets","lastIndexOf","getTargetType","createPublishDragSource","DragDropManagerImpl","store","handleRefCountChange","shouldSetUp","refCount","createDragDropActions","boundActions","actionCreator","subtract","NONE","ALL","areDirty","dirtyIds","handlerIds","__IS_NONE__","__IS_ALL__","DragDropMonitorImpl","prevStateId","stateId","handleChange","state","currentStateId","dirtyHandlerIds","previousState","dragOffset","nextState","canDrag","canDrop","shallow","dragOperation","initialClientOffset","initialSourceClientOffset","getDifferenceFromInitialOffset","scope","global","self","BrowserMutationObserver","MutationObserver","WebKitMutationObserver","makeRequestCallFromTimer","callback","timeoutHandle","handleTimer","intervalHandle","setInterval","clearInterval","makeRequestCall","toggle","createTextNode","observe","characterData","data","AsapQueue","queue","pendingErrors","flushing","capacity","flush","currentIndex","scan","newLength","registerPendingError","requestErrorThrow","requestFlush","shift","task","RawTask","onError","release","TaskFactory","freeTasks","tasks","pop","asapQueue","taskFactory","HandlerRole","ADD_SOURCE","ADD_TARGET","REMOVE_SOURCE","REMOVE_TARGET","validateType","allowArray","SOURCE","TARGET","nextUniqueId","getNextHandlerId","role","parseRoleFromHandlerId","handlerId","mapContainsValue","searchValue","entries","isDone","HandlerRegistryImpl","dragSources","dropTargets","pinnedSourceId","pinnedSource","validateSourceContract","addHandler","validateTargetContract","addTarget","handler","includePinned","isSourceId","isPinned","isTargetId","enqueueTask","create","removeTarget","strictEquality","areCoordsEqual","offsetA","offsetB","areArraysEqual","isEqual","prevTargetIds","didChange","prevInnermostTargetId","innermostTargetId","initialState","createDragDropManager","backendFactory","backendOptions","debugMode","makeStoreInstance","receiveBackend","reduxDevTools","__REDUX_DEVTOOLS_EXTENSION__","instanceId","INSTANCE_SYM","DndProvider","_param","dragDropManager","getGlobalContext","ctx","createSingletonDndContext","isGlobalInstance","getDndContextValue","_jsx","DndContext","getClientOffset","getInitialClientOffset","getInitialSourceClientOffset","toFixed","pointerEvents","position","transform","WebkitTransform","currentOffset","getItem","display","style","portal","getBackend","Se","ListenerType","mouse","touch","keyboard","_delay","delay","scrollAngleRanges","getDropTargetElementsAtPoint","_ignoreContextMenu","ignoreContextMenu","_enableHoverOutsideTarget","enableHoverOutsideTarget","_enableKeyboardEvents","enableKeyboardEvents","_enableMouseEvents","enableMouseEvents","_enableTouchEvents","enableTouchEvents","touchSlop","ref2","ref3","delayTouchStart","ref4","ref5","ref6","delayMouseStart","MouseButtons","MouseButton","eventShouldStartDrag","button","isTouchEvent","targetTouches","lastTargetTouchFallback","getEventClientTouchOffset","supportsPassive","supported","eventNames","start","move","end","contextmenu","keydown","TouchBackendImpl","element","handleTopMoveStartCapture","moveStartSourceIds","handleMoveStart","handleTopMoveStart","_mouseClientOffset","waitingForDelay","handleTopMoveStartDelay","timeout","handleTopMoveCapture","handleMove","_evt","handleTopMove","x1","y1","x2","y2","_isScrolling","angleRanges","angle","atan2","PI","ar","inAngleRanges","sqrt","pow","abs","installSourceNodeRemovalObserver","cancelable","dragOverTargetNodes","targetNodes","elementsAtPoint","elementsFromPoint","elementsAtPointExtended","nodeId","currentNode","orderedDragOverTargetIds","_getDropTargetId","ids","targetNode","handleTopMoveEndCapture","buttons","eventShouldEndDrag","uninstallSourceNodeRemovalObserver","handleCancelOnEscape","listenerTypes","getTopMoveStartHandler","subject","capture","passive","listenerType","evt","coords","droppedOn","elementFromPoint","childMatch","draggedSourceNode","draggedSourceNodeRemovalObserver","resurrectSourceNode","childList","removeAttribute","appendChild","disconnect","TouchBackend","useCollectedProps","collector","connector","collect","onCollect","useCollector","collected","updateCollected","useIsomorphicLayoutEffect","getHandlerId","subscribeToStateChange","useMonitorOutput","reconnect","onUpdate","setCollected","nextValue","useDragDropManager","useDragLayer","subscribeToOffsetChange","useConnectDragSource","hooks","dragSource","useConnectDragPreview","SourceConnector","wrapConnectorHooks","clearDragSource","dragSourceOptions","isRef","dragSourceRef","dragSourceNode","reconnectDragSource","clearDragPreview","dragPreviewOptions","dragPreviewRef","dragPreviewNode","reconnectDragPreview","dragSourceOptionsInternal","dragPreviewOptionsInternal","lastConnectedHandlerId","lastConnectedDragSource","lastConnectedDragSourceOptions","lastConnectedDragPreview","lastConnectedDragPreviewOptions","newHandlerId","didHandlerIdChange","didConnectedDragSourceChange","didDragSourceOptionsChange","disconnectDragSource","dragSourceUnsubscribe","forceDidChange","didConnectedDragPreviewChange","didDragPreviewOptionsChange","disconnectDragPreview","dragPreviewUnsubscribe","isCallingCanDrag","isCallingIsDragging","DragSourceMonitorImpl","internalMonitor","isDraggingSource","isOverTarget","DragSourceImpl","spec","globalMonitor","useRegisteredDragSource","useDragSource","useDragType","registerSource","receiveHandlerId","useDrag","specArg","deps","useOptionalFactory","begin","useDragSourceMonitor","useDragSourceConnector","previewOptions","useConnectDropTarget","dropTarget","TargetConnector","clearDropTarget","dropTargetOptions","dropTargetRef","dropTargetNode","dropTargetOptionsInternal","lastConnectedDropTarget","lastConnectedDropTargetOptions","didDropTargetChange","didOptionsChange","disconnectDropTarget","unsubscribeDropTarget","isCallingCanDrop","DropTargetMonitorImpl","DropTargetImpl","useRegisteredDropTarget","useDropTarget","accept","useAccept","registerTarget","useDrop","useDropTargetMonitor","useDropTargetConnector","arg","memoDeps","throwIfCompositeComponentElement","displayName","wrappedHooks","hook","endsWith","wrappedHook","elementOrNode","cloneWithRef","wrapHookToRecognizeElement","setRef","newRef","previousRef"],"sourceRoot":""}