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D,EAAQE,KACXC,EAAGH,EAAQI,KAGb,OADuBoJ,EAAOvJ,GAAKuJ,EAAOrJ,EAAIsJ,GAAkB,QAASA,EAAiBD,EAE5F,CACF,CACF,CAaF,IAAiBtG,EAAGC,CAXF,EAGlB,SAASmG,EAAgBpG,EAAGC,GAC1B,SAAKyE,EAAgB1E,KAAO0E,EAAgBzE,KAIrCD,EAAEgC,KAAK5B,QAAQuC,SAAStE,cAAgB4B,EAAE+B,KAAK5B,QAAQuC,SAAStE,WACzE","sources":["webpack://mono-repo/./node_modules/@dnd-kit/sortable/dist/sortable.esm.js"],"sourcesContent":["import React, { useMemo, useRef, useEffect, useState, useContext } from 'react';\nimport { useDndContext, getClientRect, useDroppable, useDraggable, closestCorners, getFirstCollision, getScrollableAncestors, KeyboardCode } from '@dnd-kit/core';\nimport { useUniqueId, useIsomorphicLayoutEffect, CSS, useCombinedRefs, isKeyboardEvent, subtract } from '@dnd-kit/utilities';\n\n/**\r\n * Move an array item to a different position. Returns a new array with the item moved to the new position.\r\n */\nfunction arrayMove(array, from, to) {\n const newArray = array.slice();\n newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);\n return newArray;\n}\n\n/**\r\n * Swap an array item to a different position. Returns a new array with the item swapped to the new position.\r\n */\nfunction arraySwap(array, from, to) {\n const newArray = array.slice();\n newArray[from] = array[to];\n newArray[to] = array[from];\n return newArray;\n}\n\nfunction getSortedRects(items, rects) {\n return items.reduce((accumulator, id, index) => {\n const rect = rects.get(id);\n\n if (rect) {\n accumulator[index] = rect;\n }\n\n return accumulator;\n }, Array(items.length));\n}\n\nfunction isValidIndex(index) {\n return index !== null && index >= 0;\n}\n\nfunction itemsEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction normalizeDisabled(disabled) {\n if (typeof disabled === 'boolean') {\n return {\n draggable: disabled,\n droppable: disabled\n };\n }\n\n return disabled;\n}\n\n// To-do: We should be calculating scale transformation\nconst defaultScale = {\n scaleX: 1,\n scaleY: 1\n};\nconst horizontalListSortingStrategy = _ref => {\n var _rects$activeIndex;\n\n let {\n rects,\n activeNodeRect: fallbackActiveRect,\n activeIndex,\n overIndex,\n index\n } = _ref;\n const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;\n\n if (!activeNodeRect) {\n return null;\n }\n\n const itemGap = getItemGap(rects, index, activeIndex);\n\n if (index === activeIndex) {\n const newIndexRect = rects[overIndex];\n\n if (!newIndexRect) {\n return null;\n }\n\n return {\n x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,\n y: 0,\n ...defaultScale\n };\n }\n\n if (index > activeIndex && index <= overIndex) {\n return {\n x: -activeNodeRect.width - itemGap,\n y: 0,\n ...defaultScale\n };\n }\n\n if (index < activeIndex && index >= overIndex) {\n return {\n x: activeNodeRect.width + itemGap,\n y: 0,\n ...defaultScale\n };\n }\n\n return {\n x: 0,\n y: 0,\n ...defaultScale\n };\n};\n\nfunction getItemGap(rects, index, activeIndex) {\n const currentRect = rects[index];\n const previousRect = rects[index - 1];\n const nextRect = rects[index + 1];\n\n if (!currentRect || !previousRect && !nextRect) {\n return 0;\n }\n\n if (activeIndex < index) {\n return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);\n }\n\n return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);\n}\n\nconst rectSortingStrategy = _ref => {\n let {\n rects,\n activeIndex,\n overIndex,\n index\n } = _ref;\n const newRects = arrayMove(rects, overIndex, activeIndex);\n const oldRect = rects[index];\n const newRect = newRects[index];\n\n if (!newRect || !oldRect) {\n return null;\n }\n\n return {\n x: newRect.left - oldRect.left,\n y: newRect.top - oldRect.top,\n scaleX: newRect.width / oldRect.width,\n scaleY: newRect.height / oldRect.height\n };\n};\n\nconst rectSwappingStrategy = _ref => {\n let {\n activeIndex,\n index,\n rects,\n overIndex\n } = _ref;\n let oldRect;\n let newRect;\n\n if (index === activeIndex) {\n oldRect = rects[index];\n newRect = rects[overIndex];\n }\n\n if (index === overIndex) {\n oldRect = rects[index];\n newRect = rects[activeIndex];\n }\n\n if (!newRect || !oldRect) {\n return null;\n }\n\n return {\n x: newRect.left - oldRect.left,\n y: newRect.top - oldRect.top,\n scaleX: newRect.width / oldRect.width,\n scaleY: newRect.height / oldRect.height\n };\n};\n\n// To-do: We should be calculating scale transformation\nconst defaultScale$1 = {\n scaleX: 1,\n scaleY: 1\n};\nconst verticalListSortingStrategy = _ref => {\n var _rects$activeIndex;\n\n let {\n activeIndex,\n activeNodeRect: fallbackActiveRect,\n index,\n rects,\n overIndex\n } = _ref;\n const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;\n\n if (!activeNodeRect) {\n return null;\n }\n\n if (index === activeIndex) {\n const overIndexRect = rects[overIndex];\n\n if (!overIndexRect) {\n return null;\n }\n\n return {\n x: 0,\n y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,\n ...defaultScale$1\n };\n }\n\n const itemGap = getItemGap$1(rects, index, activeIndex);\n\n if (index > activeIndex && index <= overIndex) {\n return {\n x: 0,\n y: -activeNodeRect.height - itemGap,\n ...defaultScale$1\n };\n }\n\n if (index < activeIndex && index >= overIndex) {\n return {\n x: 0,\n y: activeNodeRect.height + itemGap,\n ...defaultScale$1\n };\n }\n\n return {\n x: 0,\n y: 0,\n ...defaultScale$1\n };\n};\n\nfunction getItemGap$1(clientRects, index, activeIndex) {\n const currentRect = clientRects[index];\n const previousRect = clientRects[index - 1];\n const nextRect = clientRects[index + 1];\n\n if (!currentRect) {\n return 0;\n }\n\n if (activeIndex < index) {\n return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;\n }\n\n return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;\n}\n\nconst ID_PREFIX = 'Sortable';\nconst Context = /*#__PURE__*/React.createContext({\n activeIndex: -1,\n containerId: ID_PREFIX,\n disableTransforms: false,\n items: [],\n overIndex: -1,\n useDragOverlay: false,\n sortedRects: [],\n strategy: rectSortingStrategy,\n disabled: {\n draggable: false,\n droppable: false\n }\n});\nfunction SortableContext(_ref) {\n let {\n children,\n id,\n items: userDefinedItems,\n strategy = rectSortingStrategy,\n disabled: disabledProp = false\n } = _ref;\n const {\n active,\n dragOverlay,\n droppableRects,\n over,\n measureDroppableContainers,\n measuringScheduled\n } = useDndContext();\n const containerId = useUniqueId(ID_PREFIX, id);\n const useDragOverlay = Boolean(dragOverlay.rect !== null);\n const items = useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);\n const isDragging = active != null;\n const activeIndex = active ? items.indexOf(active.id) : -1;\n const overIndex = over ? items.indexOf(over.id) : -1;\n const previousItemsRef = useRef(items);\n const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);\n const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;\n const disabled = normalizeDisabled(disabledProp);\n useIsomorphicLayoutEffect(() => {\n if (itemsHaveChanged && isDragging && !measuringScheduled) {\n measureDroppableContainers(items);\n }\n }, [itemsHaveChanged, items, isDragging, measureDroppableContainers, measuringScheduled]);\n useEffect(() => {\n previousItemsRef.current = items;\n }, [items]);\n const contextValue = useMemo(() => ({\n activeIndex,\n containerId,\n disabled,\n disableTransforms,\n items,\n overIndex,\n useDragOverlay,\n sortedRects: getSortedRects(items, droppableRects),\n strategy\n }), // eslint-disable-next-line react-hooks/exhaustive-deps\n [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);\n return React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nconst defaultNewIndexGetter = _ref => {\n let {\n id,\n items,\n activeIndex,\n overIndex\n } = _ref;\n return arrayMove(items, activeIndex, overIndex).indexOf(id);\n};\nconst defaultAnimateLayoutChanges = _ref2 => {\n let {\n containerId,\n isSorting,\n wasDragging,\n index,\n items,\n newIndex,\n previousItems,\n previousContainerId,\n transition\n } = _ref2;\n\n if (!transition || !wasDragging) {\n return false;\n }\n\n if (previousItems !== items && index === newIndex) {\n return false;\n }\n\n if (isSorting) {\n return true;\n }\n\n return newIndex !== index && containerId === previousContainerId;\n};\nconst defaultTransition = {\n duration: 200,\n easing: 'ease'\n};\nconst transitionProperty = 'transform';\nconst disabledTransition = /*#__PURE__*/CSS.Transition.toString({\n property: transitionProperty,\n duration: 0,\n easing: 'linear'\n});\nconst defaultAttributes = {\n roleDescription: 'sortable'\n};\n\n/*\r\n * When the index of an item changes while sorting,\r\n * we need to temporarily disable the transforms\r\n */\n\nfunction useDerivedTransform(_ref) {\n let {\n disabled,\n index,\n node,\n rect\n } = _ref;\n const [derivedTransform, setDerivedtransform] = useState(null);\n const previousIndex = useRef(index);\n useIsomorphicLayoutEffect(() => {\n if (!disabled && index !== previousIndex.current && node.current) {\n const initial = rect.current;\n\n if (initial) {\n const current = getClientRect(node.current, {\n ignoreTransform: true\n });\n const delta = {\n x: initial.left - current.left,\n y: initial.top - current.top,\n scaleX: initial.width / current.width,\n scaleY: initial.height / current.height\n };\n\n if (delta.x || delta.y) {\n setDerivedtransform(delta);\n }\n }\n }\n\n if (index !== previousIndex.current) {\n previousIndex.current = index;\n }\n }, [disabled, index, node, rect]);\n useEffect(() => {\n if (derivedTransform) {\n requestAnimationFrame(() => {\n setDerivedtransform(null);\n });\n }\n }, [derivedTransform]);\n return derivedTransform;\n}\n\nfunction useSortable(_ref) {\n let {\n animateLayoutChanges = defaultAnimateLayoutChanges,\n attributes: userDefinedAttributes,\n disabled: localDisabled,\n data: customData,\n getNewIndex = defaultNewIndexGetter,\n id,\n strategy: localStrategy,\n resizeObserverConfig,\n transition = defaultTransition\n } = _ref;\n const {\n items,\n containerId,\n activeIndex,\n disabled: globalDisabled,\n disableTransforms,\n sortedRects,\n overIndex,\n useDragOverlay,\n strategy: globalStrategy\n } = useContext(Context);\n const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);\n const index = items.indexOf(id);\n const data = useMemo(() => ({\n sortable: {\n containerId,\n index,\n items\n },\n ...customData\n }), [containerId, customData, index, items]);\n const itemsAfterCurrentSortable = useMemo(() => items.slice(items.indexOf(id)), [items, id]);\n const {\n rect,\n node,\n isOver,\n setNodeRef: setDroppableNodeRef\n } = useDroppable({\n id,\n data,\n disabled: disabled.droppable,\n resizeObserverConfig: {\n updateMeasurementsFor: itemsAfterCurrentSortable,\n ...resizeObserverConfig\n }\n });\n const {\n active,\n activatorEvent,\n activeNodeRect,\n attributes,\n setNodeRef: setDraggableNodeRef,\n listeners,\n isDragging,\n over,\n setActivatorNodeRef,\n transform\n } = useDraggable({\n id,\n data,\n attributes: { ...defaultAttributes,\n ...userDefinedAttributes\n },\n disabled: disabled.draggable\n });\n const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);\n const isSorting = Boolean(active);\n const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);\n const shouldDisplaceDragSource = !useDragOverlay && isDragging;\n const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;\n const strategy = localStrategy != null ? localStrategy : globalStrategy;\n const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({\n rects: sortedRects,\n activeNodeRect,\n activeIndex,\n overIndex,\n index\n }) : null;\n const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({\n id,\n items,\n activeIndex,\n overIndex\n }) : index;\n const activeId = active == null ? void 0 : active.id;\n const previous = useRef({\n activeId,\n items,\n newIndex,\n containerId\n });\n const itemsHaveChanged = items !== previous.current.items;\n const shouldAnimateLayoutChanges = animateLayoutChanges({\n active,\n containerId,\n isDragging,\n isSorting,\n id,\n index,\n items,\n newIndex: previous.current.newIndex,\n previousItems: previous.current.items,\n previousContainerId: previous.current.containerId,\n transition,\n wasDragging: previous.current.activeId != null\n });\n const derivedTransform = useDerivedTransform({\n disabled: !shouldAnimateLayoutChanges,\n index,\n node,\n rect\n });\n useEffect(() => {\n if (isSorting && previous.current.newIndex !== newIndex) {\n previous.current.newIndex = newIndex;\n }\n\n if (containerId !== previous.current.containerId) {\n previous.current.containerId = containerId;\n }\n\n if (items !== previous.current.items) {\n previous.current.items = items;\n }\n }, [isSorting, newIndex, containerId, items]);\n useEffect(() => {\n if (activeId === previous.current.activeId) {\n return;\n }\n\n if (activeId && !previous.current.activeId) {\n previous.current.activeId = activeId;\n return;\n }\n\n const timeoutId = setTimeout(() => {\n previous.current.activeId = activeId;\n }, 50);\n return () => clearTimeout(timeoutId);\n }, [activeId]);\n return {\n active,\n activeIndex,\n attributes,\n data,\n rect,\n index,\n newIndex,\n items,\n isOver,\n isSorting,\n isDragging,\n listeners,\n node,\n overIndex,\n over,\n setNodeRef,\n setActivatorNodeRef,\n setDroppableNodeRef,\n setDraggableNodeRef,\n transform: derivedTransform != null ? derivedTransform : finalTransform,\n transition: getTransition()\n };\n\n function getTransition() {\n if ( // Temporarily disable transitions for a single frame to set up derived transforms\n derivedTransform || // Or to prevent items jumping to back to their \"new\" position when items change\n itemsHaveChanged && previous.current.newIndex === index) {\n return disabledTransition;\n }\n\n if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {\n return undefined;\n }\n\n if (isSorting || shouldAnimateLayoutChanges) {\n return CSS.Transition.toString({ ...transition,\n property: transitionProperty\n });\n }\n\n return undefined;\n }\n}\n\nfunction normalizeLocalDisabled(localDisabled, globalDisabled) {\n var _localDisabled$dragga, _localDisabled$droppa;\n\n if (typeof localDisabled === 'boolean') {\n return {\n draggable: localDisabled,\n // Backwards compatibility\n droppable: false\n };\n }\n\n return {\n draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,\n droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable\n };\n}\n\nfunction hasSortableData(entry) {\n if (!entry) {\n return false;\n }\n\n const data = entry.data.current;\n\n if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) {\n return true;\n }\n\n return false;\n}\n\nconst directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];\nconst sortableKeyboardCoordinates = (event, _ref) => {\n let {\n context: {\n active,\n collisionRect,\n droppableRects,\n droppableContainers,\n over,\n scrollableAncestors\n }\n } = _ref;\n\n if (directions.includes(event.code)) {\n event.preventDefault();\n\n if (!active || !collisionRect) {\n return;\n }\n\n const filteredContainers = [];\n droppableContainers.getEnabled().forEach(entry => {\n if (!entry || entry != null && entry.disabled) {\n return;\n }\n\n const rect = droppableRects.get(entry.id);\n\n if (!rect) {\n return;\n }\n\n switch (event.code) {\n case KeyboardCode.Down:\n if (collisionRect.top < rect.top) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Up:\n if (collisionRect.top > rect.top) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Left:\n if (collisionRect.left > rect.left) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Right:\n if (collisionRect.left < rect.left) {\n filteredContainers.push(entry);\n }\n\n break;\n }\n });\n const collisions = closestCorners({\n active,\n collisionRect: collisionRect,\n droppableRects,\n droppableContainers: filteredContainers,\n pointerCoordinates: null\n });\n let closestId = getFirstCollision(collisions, 'id');\n\n if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {\n closestId = collisions[1].id;\n }\n\n if (closestId != null) {\n const activeDroppable = droppableContainers.get(active.id);\n const newDroppable = droppableContainers.get(closestId);\n const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;\n const newNode = newDroppable == null ? void 0 : newDroppable.node.current;\n\n if (newNode && newRect && activeDroppable && newDroppable) {\n const newScrollAncestors = getScrollableAncestors(newNode);\n const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);\n const hasSameContainer = isSameContainer(activeDroppable, newDroppable);\n const isAfterActive = isAfter(activeDroppable, newDroppable);\n const offset = hasDifferentScrollAncestors || !hasSameContainer ? {\n x: 0,\n y: 0\n } : {\n x: isAfterActive ? collisionRect.width - newRect.width : 0,\n y: isAfterActive ? collisionRect.height - newRect.height : 0\n };\n const rectCoordinates = {\n x: newRect.left,\n y: newRect.top\n };\n const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);\n return newCoordinates;\n }\n }\n }\n\n return undefined;\n};\n\nfunction isSameContainer(a, b) {\n if (!hasSortableData(a) || !hasSortableData(b)) {\n return false;\n }\n\n return a.data.current.sortable.containerId === b.data.current.sortable.containerId;\n}\n\nfunction isAfter(a, b) {\n if (!hasSortableData(a) || !hasSortableData(b)) {\n return false;\n }\n\n if (!isSameContainer(a, b)) {\n return false;\n }\n\n return a.data.current.sortable.index < b.data.current.sortable.index;\n}\n\nexport { SortableContext, arrayMove, arraySwap, defaultAnimateLayoutChanges, defaultNewIndexGetter, hasSortableData, horizontalListSortingStrategy, rectSortingStrategy, rectSwappingStrategy, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy };\n//# sourceMappingURL=sortable.esm.js.map\n"],"names":["arrayMove","array","from","to","newArray","slice","splice","length","getSortedRects","items","rects","reduce","accumulator","id","index","rect","get","Array","isValidIndex","rectSortingStrategy","_ref","activeIndex","overIndex","newRects","oldRect","newRect","x","left","y","top","scaleX","width","scaleY","height","defaultScale$1","verticalListSortingStrategy","_rects$activeIndex","activeNodeRect","fallbackActiveRect","overIndexRect","itemGap","clientRects","currentRect","previousRect","nextRect","getItemGap$1","ID_PREFIX","Context","containerId","disableTransforms","useDragOverlay","sortedRects","strategy","disabled","draggable","droppable","SortableContext","children","userDefinedItems","disabledProp","active","dragOverlay","droppableRects","over","measureDroppableContainers","measuringScheduled","Boolean","useMemo","map","item","isDragging","indexOf","previousItemsRef","useRef","itemsHaveChanged","a","b","i","itemsEqual","current","normalizeDisabled","useEffect","contextValue","Provider","value","defaultNewIndexGetter","defaultAnimateLayoutChanges","_ref2","isSorting","wasDragging","newIndex","previousItems","previousContainerId","transition","defaultTransition","duration","easing","transitionProperty","disabledTransition","property","defaultAttributes","roleDescription","useSortable","animateLayoutChanges","attributes","userDefinedAttributes","localDisabled","data","customData","getNewIndex","localStrategy","resizeObserverConfig","globalDisabled","globalStrategy","useContext","_localDisabled$dragga","_localDisabled$droppa","normalizeLocalDisabled","sortable","itemsAfterCurrentSortable","node","isOver","setNodeRef","setDroppableNodeRef","updateMeasurementsFor","activatorEvent","setDraggableNodeRef","listeners","setActivatorNodeRef","transform","displaceItem","shouldDisplaceDragSource","dragSourceDisplacement","finalTransform","activeId","previous","shouldAnimateLayoutChanges","derivedTransform","setDerivedtransform","useState","previousIndex","initial","ignoreTransform","delta","requestAnimationFrame","useDerivedTransform","timeoutId","setTimeout","clearTimeout","hasSortableData","entry","directions","sortableKeyboardCoordinates","event","context","collisionRect","droppableContainers","scrollableAncestors","includes","code","preventDefault","filteredContainers","getEnabled","forEach","push","collisions","pointerCoordinates","closestId","activeDroppable","newDroppable","newNode","hasDifferentScrollAncestors","some","element","hasSameContainer","isSameContainer","isAfterActive","offset","rectCoordinates"],"sourceRoot":""}