. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?(0,t.cloneElement)(e,{ref:function(e){xd(r,e),xd(n,e)}}):(0,t.cloneElement)(e,{ref:n})}var jd=function(){function e(t){var n=this;(0,zl.Z)(this,e),this.hooks=_d({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,md(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}return(0,ql.Z)(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!hd(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e}(),kd=(0,t.createContext)({dragDropManager:void 0});function Nd(){var e=(0,t.useContext)(kd).dragDropManager;return gd(null!=e,"Expected drag drop context"),e}var Sd=!1,Cd=function(){function e(t){(0,zl.Z)(this,e),this.targetId=null,this.internalMonitor=t.getMonitor()}return(0,ql.Z)(e,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;gd(!Sd,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Sd=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Sd=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();var Dd=function(){function e(t,n){(0,zl.Z)(this,e),this.spec=t,this.monitor=n}return(0,ql.Z)(e,[{key:"canDrop",value:function(){var e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}},{key:"hover",value:function(){var e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}},{key:"drop",value:function(){var e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}}]),e}();function Ed(e,n,r){var a=Nd(),o=function(e,n){var r=(0,t.useMemo)((function(){return new Dd(e,n)}),[n]);return(0,t.useEffect)((function(){r.spec=e}),[e]),r}(e,n),l=function(e){var n=e.accept;return(0,t.useMemo)((function(){return gd(null!=e.accept,"accept must be defined"),Array.isArray(n)?n:[n]}),[n])}(e);ud((function(){var e=function(e,t,n){var r=n.getRegistry(),a=r.addTarget(e,t);return[a,function(){return r.removeTarget(a)}]}(l,o,a),t=i(e,2),s=t[0],c=t[1];return n.receiveHandlerId(s),r.receiveHandlerId(s),c}),[a,n,o,r,l.map((function(e){return e.toString()})).join("|")])}function Od(e,n){var r=vd(e,n),a=function(){var e=Nd();return(0,t.useMemo)((function(){return new Cd(e)}),[e])}(),i=function(e){var n=Nd(),r=(0,t.useMemo)((function(){return new jd(n.getBackend())}),[n]);return ud((function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}}),[e]),r}(r.options);return Ed(r,a,i),[fd(r.collect,a,i),pd(i)]}function Pd(e){return(0,t.useMemo)((function(){return e.hooks.dragSource()}),[e])}function Td(e){return(0,t.useMemo)((function(){return e.hooks.dragPreview()}),[e])}var Md=function(){function e(t){var n=this;(0,zl.Z)(this,e),this.hooks=_d({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,md(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,md(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}return(0,ql.Z)(e,[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){var e=this.reconnectDragSource();this.reconnectDragPreview(e)}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}},{key:"reconnectDragPreview",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(t?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!hd(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!hd(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e}();var Id=!1,Rd=!1,Ad=function(){function e(t){(0,zl.Z)(this,e),this.sourceId=null,this.internalMonitor=t.getMonitor()}return(0,ql.Z)(e,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){gd(!Id,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Id=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Id=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;gd(!Rd,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Rd=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Rd=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();var Ld=function(){function e(t,n,r){(0,zl.Z)(this,e),this.spec=t,this.monitor=n,this.connector=r}return(0,ql.Z)(e,[{key:"beginDrag",value:function(){var e=this.spec,t=this.monitor,n=null;return null!==(n="object"===typeof e.item?e.item:"function"===typeof e.item?e.item(t):{})&&void 0!==n?n:null}},{key:"canDrag",value:function(){var e=this.spec,t=this.monitor;return"boolean"===typeof e.canDrag?e.canDrag:"function"!==typeof e.canDrag||e.canDrag(t)}},{key:"isDragging",value:function(e,t){var n=this.spec,r=this.monitor,a=n.isDragging;return a?a(r):t===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,t=this.monitor,n=this.connector,r=e.end;r&&r(t.getItem(),t),n.reconnect()}}]),e}();function Fd(e,n,r){var a=Nd(),o=function(e,n,r){var a=(0,t.useMemo)((function(){return new Ld(e,n,r)}),[n,r]);return(0,t.useEffect)((function(){a.spec=e}),[e]),a}(e,n,r),l=function(e){return(0,t.useMemo)((function(){var t=e.type;return gd(null!=t,"spec.type must be defined"),t}),[e])}(e);ud((function(){if(null!=l){var e=function(e,t,n){var r=n.getRegistry(),a=r.addSource(e,t);return[a,function(){return r.removeSource(a)}]}(l,o,a),t=i(e,2),s=t[0],c=t[1];return n.receiveHandlerId(s),r.receiveHandlerId(s),c}}),[a,n,r,o,l])}function Yd(e,n){var r=vd(e,n);gd(!r.begin,"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)");var a=function(){var e=Nd();return(0,t.useMemo)((function(){return new Ad(e)}),[e])}(),i=function(e,n){var r=Nd(),a=(0,t.useMemo)((function(){return new Md(r.getBackend())}),[r]);return ud((function(){return a.dragSourceOptions=e||null,a.reconnect(),function(){return a.disconnectDragSource()}}),[a,e]),ud((function(){return a.dragPreviewOptions=n||null,a.reconnect(),function(){return a.disconnectDragPreview()}}),[a,n]),a}(r.options,r.previewOptions);return Fd(r,a,i),[fd(r.collect,a,i),Pd(i),Td(i)]}function Ud(e,t,n){return t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e)}function Vd(e,t){return e.filter((function(e){return e!==t}))}function Hd(e){return"object"===typeof e}function Zd(e,t){var n=new Map,r=function(e){n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var a=[];return n.forEach((function(e,t){1===e&&a.push(t)})),a}var Bd="dnd-core/INIT_COORDS",Wd="dnd-core/BEGIN_DRAG",zd="dnd-core/PUBLISH_DRAG_SOURCE",qd="dnd-core/HOVER",Kd="dnd-core/DROP",Gd="dnd-core/END_DRAG";function $d(e,t){return{type:Bd,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Jd={type:Bd,payload:{clientOffset:null,sourceClientOffset:null}};function Qd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,a=void 0===r||r,i=n.clientOffset,o=n.getSourceClientOffset,l=e.getMonitor(),s=e.getRegistry();e.dispatch($d(i)),Xd(t,l,s);var c=nf(t,l);if(null!=c){var u=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");ef(o),u=o(c)}e.dispatch($d(i,u));var d=s.getSource(c),f=d.beginDrag(l,c);if(null!=f){tf(f),s.pinSource(c);var v=s.getSourceType(c);return{type:Wd,payload:{itemType:v,item:f,sourceId:c,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!a}}}}else e.dispatch(Jd)}}function Xd(e,t,n){gd(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){gd(n.getSource(e),"Expected sourceIds to be registered.")}))}function ef(e){gd("function"===typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}function tf(e){gd(Hd(e),"Item must be an object.")}function nf(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function rf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function af(e){for(var t=1;t
0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();lf(n);var a=cf(n);a.forEach((function(a,i){var o=sf(a,i,r,n),l={type:Kd,payload:{dropResult:af({},t,o)}};e.dispatch(l)}))}}function lf(e){gd(e.isDragging(),"Cannot call drop while not dragging."),gd(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function sf(e,t,n,r){var a=n.getTarget(e),i=a?a.drop(r,e):void 0;return function(e){gd("undefined"===typeof e||Hd(e),"Drop result must either be an object or undefined.")}(i),"undefined"===typeof i&&(i=0===t?{}:r.getDropResult()),i}function cf(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function uf(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){gd(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource());return{type:Gd}}}function df(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function ff(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.clientOffset;vf(t);var a=t.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return hf(a,o,l),pf(a,i,o),mf(a,i,o),{type:qd,payload:{targetIds:a,clientOffset:r||null}}}}function vf(e){gd(Array.isArray(e),"Expected targetIds to be an array.")}function pf(e,t,n){gd(t.isDragging(),"Cannot call hover while not dragging."),gd(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var a=e[r];df(t.getTargetType(a),n)||e.splice(r,1)}}function mf(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}function gf(e){return function(){if(e.getMonitor().isDragging())return{type:zd}}}var yf=function(){function e(t,n){var r=this;(0,zl.Z)(this,e),this.isSetUp=!1,this.handleRefCountChange=function(){var e=r.store.getState().refCount>0;r.backend&&(e&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!e&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return(0,ql.Z)(e,[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch;var n=function(e){return{beginDrag:Qd(e),publishDragSource:gf(e),hover:ff(e),drop:of(e),endDrag:uf(e)}}(this);return Object.keys(n).reduce((function(r,a){var i,o=n[a];return r[a]=(i=o,function(){for(var n=arguments.length,r=new Array(n),a=0;a-1}))).length>0);var n}_f.__IS_NONE__=!0,xf.__IS_ALL__=!0;var jf=function(){function e(t,n){(0,zl.Z)(this,e),this.store=t,this.registry=n}return(0,ql.Z)(e,[{key:"subscribeToStateChange",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.handlerIds;gd("function"===typeof e,"listener must be a function."),gd("undefined"===typeof r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,i=function(){var n=t.store.getState(),i=n.stateId;try{i===a||i===a+1&&!wf(n.dirtyHandlerIds,r)||e()}finally{a=i}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;gd("function"===typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return gd(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return gd(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&(df(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return gd(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1};if(!e)return!1;var n=t.shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),a=this.getItemType();if(a&&!df(r,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var o=i.indexOf(e);return n?o===i.length-1:o>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return function(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?bf(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,r),n):null}(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return function(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?bf(t,n):null}(this.store.getState().dragOffset)}}]),e}(),kf="undefined"!==typeof global?global:self,Nf=kf.MutationObserver||kf.WebKitMutationObserver;function Sf(e){return function(){var t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}var Cf="function"===typeof Nf?function(e){var t=1,n=new Nf(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:Sf,Df=function(){function e(){var t=this;(0,zl.Z)(this,e),this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=function(){for(var e=t.queue;t.indext.capacity){for(var r=0,a=e.length-t.index;r1&&void 0!==arguments[1]&&arguments[1];gd(this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.dragSources.get(e);return r}},{key:"getTarget",value:function(e){return gd(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return gd(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return gd(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Vf(e)===Mf.SOURCE}},{key:"isTargetId",value:function(e){return Vf(e)===Mf.TARGET}},{key:"removeSource",value:function(e){var t=this;gd(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:Af,payload:{sourceId:e}}}(e)),function(e){Pf.enqueueTask(Tf.create(e))}((function(){t.dragSources.delete(e),t.types.delete(e)}))}},{key:"removeTarget",value:function(e){gd(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Lf,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);gd(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){gd(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=Uf(e);return this.types.set(r,t),e===Mf.SOURCE?this.dragSources.set(r,n):e===Mf.TARGET&&this.dropTargets.set(r,n),r}}]),e}(),Bf=function(e,t){return e===t};function Wf(e,t){return!e&&!t||!(!e||!t)&&(e.x===t.x&&e.y===t.y)}function zf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bf;if(e.length!==t.length)return!1;for(var r=0;r1?arguments[1]:void 0;switch(e.type){case qd:break;case If:case Rf:case Lf:case Af:return _f;default:return xf}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,a=t.prevTargetIds,i=void 0===a?[]:a,o=Zd(r,i),l=o.length>0||!zf(r,i);if(!l)return _f;var s=i[i.length-1],c=r[r.length-1];return s!==c&&(s&&o.push(s),c&&o.push(c)),o}function Kf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gf(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:$f,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Bd:case Wd:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case qd:return Wf(e.clientOffset,n.clientOffset)?e:Gf({},e,{clientOffset:n.clientOffset});case Gd:case Kd:return $f;default:return e}}function Qf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xf(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:ev,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Wd:return Xf({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case zd:return Xf({},e,{isSourcePublic:!0});case qd:return Xf({},e,{targetIds:n.targetIds});case Lf:return-1===e.targetIds.indexOf(n.targetId)?e:Xf({},e,{targetIds:Vd(e.targetIds,n.targetId)});case Kd:return Xf({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Gd:return Xf({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function nv(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case If:case Rf:return e+1;case Af:case Lf:return e-1;default:return e}}function rv(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+1}function av(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iv(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:qf(e.dirtyHandlerIds,{type:t.type,payload:iv({},t.payload,{prevTargetIds:Ud(e,"dragOperation.targetIds",[])})}),dragOffset:Jf(e.dragOffset,t),refCount:nv(e.refCount,t),dragOperation:tv(e.dragOperation,t),stateId:rv(e.stateId)}}function lv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=sv(r),i=new jf(a,new Zf(a)),o=new yf(a,i),l=e(o,t,n);return o.receiveBackend(l),o}function sv(e){var t="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return Nt(ov,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function cv(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var uv=0,dv=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),fv=(0,t.memo)((function(e){var n=e.children,r=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vv(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=t;a[dv]||(a[dv]={dragDropManager:lv(e,t,n,r)});return a[dv]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(cv(e,["children"])),a=i(r,2),o=a[0],l=a[1];return(0,t.useEffect)((function(){if(l){var e=vv();return++uv,function(){0===--uv&&(e[dv]=null)}}}),[]),(0,On.jsx)(kd.Provider,{value:o,children:n})}));function vv(){return"undefined"!==typeof global?global:window}function pv(e){var t=null;return function(){return null==t&&(t=e()),t}}var hv,mv=function(){function e(t){(0,zl.Z)(this,e),this.entered=[],this.isNodeInDocument=t}return(0,ql.Z)(e,[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var a=[];return n.forEach((function(e){return a.push(e)})),a}(this.entered.filter((function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))})),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter((function(e){return e!==n}))),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}(),gv=function(){function e(t){(0,zl.Z)(this,e),this.config=t,this.item={},this.initializeExposedProperties()}return(0,ql.Z)(e,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach((function(r){var a=t.config.exposeProperties[r];null!=a&&(n[r]={value:a(e,t.config.matchesTypes),configurable:!0,enumerable:!0})})),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}(),yv="__NATIVE_FILE__",bv="__NATIVE_URL__",_v="__NATIVE_TEXT__",xv="__NATIVE_HTML__";function wv(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),"");return null!=r?r:n}var jv=(hv={},(0,gt.Z)(hv,yv,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),(0,gt.Z)(hv,xv,{exposeProperties:{html:function(e,t){return wv(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),(0,gt.Z)(hv,bv,{exposeProperties:{urls:function(e,t){return wv(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),(0,gt.Z)(hv,_v,{exposeProperties:{text:function(e,t){return wv(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),hv);function kv(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(jv).filter((function(e){var n=jv[e];return!!(null===n||void 0===n?void 0:n.matchesTypes)&&n.matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}var Nv=pv((function(){return/firefox/i.test(navigator.userAgent)})),Sv=pv((function(){return Boolean(window.safari)})),Cv=function(){function e(t,n){(0,zl.Z)(this,e);for(var r=t.length,a=[],i=0;ie))return n[l];c=l-1}}var d=e-t[o=Math.max(0,c)],f=d*d;return n[o]+r[o]*d+a[o]*f+i[o]*d*f}}]),e}();function Dv(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function Ev(e){return{x:e.clientX,y:e.clientY}}function Ov(e,t,n,r,a){var i=function(e){var t;return"IMG"===e.nodeName&&(Nv()||!(null===(t=document.documentElement)||void 0===t?void 0:t.contains(e)))}(t),o=Dv(i?e:t),l={x:n.x-o.x,y:n.y-o.y},s=e.offsetWidth,c=e.offsetHeight,u=r.anchorX,d=r.anchorY,f=function(e,t,n,r){var a=e?t.width:n,i=e?t.height:r;return Sv()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}(i,t,s,c),v=f.dragPreviewWidth,p=f.dragPreviewHeight,h=a.offsetX,m=a.offsetY,g=0===m||m;return{x:0===h||h?h:new Cv([0,.5,1],[l.x,l.x/s*v,l.x+v-s]).interpolate(u),y:g?m:function(){var e=new Cv([0,.5,1],[l.y,l.y/c*p,l.y+p-c]).interpolate(d);return Sv()&&i&&(e+=(window.devicePixelRatio-1)*p),e}()}}var Pv=function(){function e(t,n){(0,zl.Z)(this,e),this.ownerDocument=null,this.globalContext=t,this.optionsArgs=n}return(0,ql.Z)(e,[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!==typeof window?window:void 0}},{key:"document",get:function(){var e;return(null===(e=this.globalContext)||void 0===e?void 0:e.document)?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}]),e}();function Tv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mv(e){for(var t=1;t