{"version":3,"file":"index-uebpOrCy.js","sources":["../../node_modules/react/cjs/react.production.min.js","../../node_modules/react/index.js","../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/scheduler/cjs/scheduler.production.min.js","../../node_modules/scheduler/index.js","../../node_modules/react-dom/cjs/react-dom.production.min.js","../../node_modules/react-dom/index.js","../../node_modules/react-dom/client.js","../../node_modules/react-use-websocket/dist/lib/constants.js","../../node_modules/react-use-websocket/dist/lib/globals.js","../../node_modules/react-use-websocket/dist/lib/socket-io.js","../../node_modules/react-use-websocket/dist/lib/heartbeat.js","../../node_modules/react-use-websocket/dist/lib/manage-subscribers.js","../../node_modules/react-use-websocket/dist/lib/util.js","../../node_modules/react-use-websocket/dist/lib/attach-listener.js","../../node_modules/react-use-websocket/dist/lib/attach-shared-listeners.js","../../node_modules/react-use-websocket/dist/lib/create-or-join.js","../../node_modules/react-use-websocket/dist/lib/get-url.js","../../node_modules/react-use-websocket/dist/lib/proxy.js","../../node_modules/react-use-websocket/dist/lib/use-websocket.js","../../node_modules/react-use-websocket/dist/lib/use-socket-io.js","../../node_modules/react-use-websocket/dist/lib/use-event-source.js","../../node_modules/react-use-websocket/dist/index.js","../../node_modules/store2/dist/store2.js","../../node_modules/react-dnd/dist/core/DndContext.js","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/redux/es/redux.js","../../node_modules/@react-dnd/invariant/dist/index.js","../../node_modules/dnd-core/dist/utils/js_utils.js","../../node_modules/dnd-core/dist/actions/dragDrop/types.js","../../node_modules/dnd-core/dist/actions/dragDrop/local/setClientOffset.js","../../node_modules/dnd-core/dist/actions/dragDrop/beginDrag.js","../../node_modules/dnd-core/dist/actions/dragDrop/drop.js","../../node_modules/dnd-core/dist/actions/dragDrop/endDrag.js","../../node_modules/dnd-core/dist/utils/matchesType.js","../../node_modules/dnd-core/dist/actions/dragDrop/hover.js","../../node_modules/dnd-core/dist/actions/dragDrop/publishDragSource.js","../../node_modules/dnd-core/dist/actions/dragDrop/index.js","../../node_modules/dnd-core/dist/classes/DragDropManagerImpl.js","../../node_modules/dnd-core/dist/utils/coords.js","../../node_modules/dnd-core/dist/utils/dirtiness.js","../../node_modules/dnd-core/dist/classes/DragDropMonitorImpl.js","../../node_modules/@react-dnd/asap/dist/makeRequestCall.js","../../node_modules/@react-dnd/asap/dist/AsapQueue.js","../../node_modules/@react-dnd/asap/dist/RawTask.js","../../node_modules/@react-dnd/asap/dist/TaskFactory.js","../../node_modules/@react-dnd/asap/dist/asap.js","../../node_modules/dnd-core/dist/actions/registry.js","../../node_modules/dnd-core/dist/contracts.js","../../node_modules/dnd-core/dist/interfaces.js","../../node_modules/dnd-core/dist/utils/getNextUniqueId.js","../../node_modules/dnd-core/dist/classes/HandlerRegistryImpl.js","../../node_modules/dnd-core/dist/utils/equality.js","../../node_modules/dnd-core/dist/reducers/dirtyHandlerIds.js","../../node_modules/dnd-core/dist/reducers/dragOffset.js","../../node_modules/dnd-core/dist/reducers/dragOperation.js","../../node_modules/dnd-core/dist/reducers/refCount.js","../../node_modules/dnd-core/dist/reducers/stateId.js","../../node_modules/dnd-core/dist/reducers/index.js","../../node_modules/dnd-core/dist/createDragDropManager.js","../../node_modules/react-dnd/dist/core/DndProvider.js","../../node_modules/fast-deep-equal/index.js","../../node_modules/react-dnd/dist/hooks/useIsomorphicLayoutEffect.js","../../node_modules/react-dnd/dist/hooks/useCollector.js","../../node_modules/react-dnd/dist/hooks/useMonitorOutput.js","../../node_modules/react-dnd/dist/hooks/useCollectedProps.js","../../node_modules/react-dnd/dist/hooks/useOptionalFactory.js","../../node_modules/react-dnd/dist/hooks/useDrag/connectors.js","../../node_modules/react-dnd/dist/internals/DragSourceMonitorImpl.js","../../node_modules/react-dnd/dist/internals/DropTargetMonitorImpl.js","../../node_modules/react-dnd/dist/internals/registration.js","../../node_modules/@react-dnd/shallowequal/dist/index.js","../../node_modules/react-dnd/dist/internals/isRef.js","../../node_modules/react-dnd/dist/internals/wrapConnectorHooks.js","../../node_modules/react-dnd/dist/internals/SourceConnector.js","../../node_modules/react-dnd/dist/internals/TargetConnector.js","../../node_modules/react-dnd/dist/hooks/useDragDropManager.js","../../node_modules/react-dnd/dist/hooks/useDrag/useDragSourceConnector.js","../../node_modules/react-dnd/dist/hooks/useDrag/useDragSourceMonitor.js","../../node_modules/react-dnd/dist/hooks/useDrag/DragSourceImpl.js","../../node_modules/react-dnd/dist/hooks/useDrag/useDragSource.js","../../node_modules/react-dnd/dist/hooks/useDrag/useDragType.js","../../node_modules/react-dnd/dist/hooks/useDrag/useRegisteredDragSource.js","../../node_modules/react-dnd/dist/hooks/useDrag/useDrag.js","../../node_modules/react-dnd/dist/hooks/useDrop/connectors.js","../../node_modules/react-dnd/dist/hooks/useDrop/useDropTargetConnector.js","../../node_modules/react-dnd/dist/hooks/useDrop/useDropTargetMonitor.js","../../node_modules/react-dnd/dist/hooks/useDrop/useAccept.js","../../node_modules/react-dnd/dist/hooks/useDrop/DropTargetImpl.js","../../node_modules/react-dnd/dist/hooks/useDrop/useDropTarget.js","../../node_modules/react-dnd/dist/hooks/useDrop/useRegisteredDropTarget.js","../../node_modules/react-dnd/dist/hooks/useDrop/useDrop.js","../../node_modules/react-dnd-html5-backend/dist/utils/js_utils.js","../../node_modules/react-dnd-html5-backend/dist/EnterLeaveCounter.js","../../node_modules/react-dnd-html5-backend/dist/NativeDragSources/NativeDragSource.js","../../node_modules/react-dnd-html5-backend/dist/NativeTypes.js","../../node_modules/react-dnd-html5-backend/dist/NativeDragSources/getDataFromDataTransfer.js","../../node_modules/react-dnd-html5-backend/dist/NativeDragSources/nativeTypesConfig.js","../../node_modules/react-dnd-html5-backend/dist/NativeDragSources/index.js","../../node_modules/react-dnd-html5-backend/dist/BrowserDetector.js","../../node_modules/react-dnd-html5-backend/dist/MonotonicInterpolant.js","../../node_modules/react-dnd-html5-backend/dist/OffsetUtils.js","../../node_modules/react-dnd-html5-backend/dist/OptionsReader.js","../../node_modules/react-dnd-html5-backend/dist/HTML5BackendImpl.js","../../node_modules/react-dnd-html5-backend/dist/index.js","../../node_modules/axios/lib/helpers/bind.js","../../node_modules/axios/lib/utils.js","../../node_modules/axios/lib/core/AxiosError.js","../../node_modules/axios/lib/helpers/null.js","../../node_modules/axios/lib/helpers/toFormData.js","../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../node_modules/axios/lib/helpers/buildURL.js","../../node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/axios/lib/defaults/transitional.js","../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../node_modules/axios/lib/platform/browser/classes/FormData.js","../../node_modules/axios/lib/platform/browser/classes/Blob.js","../../node_modules/axios/lib/platform/browser/index.js","../../node_modules/axios/lib/platform/common/utils.js","../../node_modules/axios/lib/platform/index.js","../../node_modules/axios/lib/helpers/toURLEncodedForm.js","../../node_modules/axios/lib/helpers/formDataToJSON.js","../../node_modules/axios/lib/defaults/index.js","../../node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/axios/lib/core/AxiosHeaders.js","../../node_modules/axios/lib/core/transformData.js","../../node_modules/axios/lib/cancel/isCancel.js","../../node_modules/axios/lib/cancel/CanceledError.js","../../node_modules/axios/lib/core/settle.js","../../node_modules/axios/lib/helpers/parseProtocol.js","../../node_modules/axios/lib/helpers/speedometer.js","../../node_modules/axios/lib/helpers/throttle.js","../../node_modules/axios/lib/helpers/progressEventReducer.js","../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/axios/lib/helpers/cookies.js","../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/axios/lib/core/buildFullPath.js","../../node_modules/axios/lib/core/mergeConfig.js","../../node_modules/axios/lib/helpers/resolveConfig.js","../../node_modules/axios/lib/adapters/xhr.js","../../node_modules/axios/lib/helpers/composeSignals.js","../../node_modules/axios/lib/helpers/trackStream.js","../../node_modules/axios/lib/adapters/fetch.js","../../node_modules/axios/lib/adapters/adapters.js","../../node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/axios/lib/env/data.js","../../node_modules/axios/lib/helpers/validator.js","../../node_modules/axios/lib/core/Axios.js","../../node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/axios/lib/helpers/spread.js","../../node_modules/axios/lib/helpers/isAxiosError.js","../../node_modules/axios/lib/helpers/HttpStatusCode.js","../../node_modules/axios/lib/axios.js","../../src/contexts/Data.tsx","../../src/contexts/Milestone.tsx","../../src/contexts/InstructionContext.tsx","../../src/tools.tsx","../../src/assets/unknown.jpg","../../src/contexts/Task.tsx","../../src/contexts/User.tsx","../../src/contexts/ContextTypes.tsx","../../src/contexts/Portrait.tsx","../../node_modules/eventemitter3/index.js","../../src/contexts/Project.tsx","../../src/contexts/Chart.tsx","../../src/contexts/index.tsx","../../node_modules/tailwindcss/lib/util/createPlugin.js","../../node_modules/tailwindcss/lib/public/create-plugin.js","../../node_modules/tailwindcss/plugin.js","../../node_modules/tailwindcss-animate/index.js","../../tailwind.config.ts","../../node_modules/@radix-ui/primitive/dist/index.mjs","../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../node_modules/@radix-ui/react-context/dist/index.mjs","../../node_modules/@radix-ui/react-slot/dist/index.mjs","../../node_modules/@radix-ui/react-primitive/dist/index.mjs","../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs","../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs","../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../../node_modules/@radix-ui/react-id/dist/index.mjs","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../../node_modules/@radix-ui/react-arrow/dist/index.mjs","../../node_modules/@radix-ui/react-use-size/dist/index.mjs","../../node_modules/@radix-ui/react-popper/dist/index.mjs","../../node_modules/@radix-ui/react-portal/dist/index.mjs","../../node_modules/@radix-ui/react-presence/dist/index.mjs","../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../../node_modules/@radix-ui/react-visually-hidden/dist/index.mjs","../../node_modules/@radix-ui/react-tooltip/dist/index.mjs","../../node_modules/clsx/dist/clsx.mjs","../../node_modules/tailwind-merge/dist/bundle-mjs.mjs","../../src/lib/utils.ts","../../src/components/ui/tooltip.tsx","../../src/contexts/AppContext.tsx","../../node_modules/@remix-run/router/dist/router.js","../../node_modules/react-router/dist/index.js","../../node_modules/react-router-dom/dist/index.js","../../node_modules/sonner/dist/index.mjs","../../node_modules/lucide-react/dist/esm/shared/src/utils.js","../../node_modules/lucide-react/dist/esm/defaultAttributes.js","../../node_modules/lucide-react/dist/esm/Icon.js","../../node_modules/lucide-react/dist/esm/createLucideIcon.js","../../node_modules/lucide-react/dist/esm/icons/calendar.js","../../node_modules/lucide-react/dist/esm/icons/check.js","../../node_modules/lucide-react/dist/esm/icons/chevron-down.js","../../node_modules/lucide-react/dist/esm/icons/chevron-left.js","../../node_modules/lucide-react/dist/esm/icons/chevron-right.js","../../node_modules/lucide-react/dist/esm/icons/chevron-up.js","../../node_modules/lucide-react/dist/esm/icons/circle.js","../../node_modules/lucide-react/dist/esm/icons/computer.js","../../node_modules/lucide-react/dist/esm/icons/credit-card.js","../../node_modules/lucide-react/dist/esm/icons/download.js","../../node_modules/lucide-react/dist/esm/icons/lightbulb.js","../../node_modules/lucide-react/dist/esm/icons/milestone.js","../../node_modules/lucide-react/dist/esm/icons/moon.js","../../node_modules/lucide-react/dist/esm/icons/sun.js","../../node_modules/lucide-react/dist/esm/icons/terminal.js","../../node_modules/lucide-react/dist/esm/icons/user.js","../../node_modules/lucide-react/dist/esm/icons/x.js","../../node_modules/react-icons/lib/esm/iconContext.js","../../node_modules/react-icons/lib/esm/iconBase.js","../../node_modules/react-icons/md/index.esm.js","../../node_modules/react-icons/fa/index.esm.js","../../src/components/Notification.tsx","../../node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs","../../node_modules/class-variance-authority/dist/index.mjs","../../src/components/ui/button.tsx","../../src/components/NotificationBell.tsx","../../src/components/Floater.tsx","../../src/components/RecordButton.tsx","../../src/components/SearchBar.tsx","../../node_modules/@radix-ui/react-collection/dist/index.mjs","../../node_modules/@radix-ui/react-direction/dist/index.mjs","../../node_modules/@radix-ui/react-focus-guards/dist/index.mjs","../../node_modules/@radix-ui/react-focus-scope/dist/index.mjs","../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs","../../node_modules/aria-hidden/dist/es2015/index.js","../../node_modules/react-remove-scroll/node_modules/tslib/tslib.es6.mjs","../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js","../../node_modules/use-callback-ref/dist/es2015/assignRef.js","../../node_modules/use-callback-ref/dist/es2015/useRef.js","../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js","../../node_modules/tslib/tslib.es6.js","../../node_modules/use-sidecar/dist/es2015/medium.js","../../node_modules/use-sidecar/dist/es2015/exports.js","../../node_modules/react-remove-scroll/dist/es2015/medium.js","../../node_modules/react-remove-scroll/dist/es2015/UI.js","../../node_modules/get-nonce/dist/es2015/index.js","../../node_modules/react-style-singleton/dist/es2015/singleton.js","../../node_modules/react-style-singleton/dist/es2015/hook.js","../../node_modules/react-style-singleton/dist/es2015/component.js","../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js","../../node_modules/react-remove-scroll-bar/dist/es2015/component.js","../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js","../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js","../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js","../../node_modules/react-remove-scroll/dist/es2015/sidecar.js","../../node_modules/react-remove-scroll/dist/es2015/Combination.js","../../node_modules/@radix-ui/react-menu/dist/index.mjs","../../node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs","../../src/components/ui/dropdownmenu.tsx","../../node_modules/@radix-ui/react-label/dist/index.mjs","../../src/components/ui/label.tsx","../../node_modules/@radix-ui/react-avatar/dist/index.mjs","../../src/components/ui/avatar.tsx","../../src/components/Personelle.tsx","../../src/components/OmniBar.tsx","../../node_modules/react-icons/fa6/index.esm.js","../../node_modules/react-icons/tb/index.esm.js","../../src/assets/SUBSEQ-logo-long.png","../../src/assets/SUBSEQ-logo-tight.png","../../node_modules/@radix-ui/react-separator/dist/index.mjs","../../src/components/ui/separator.tsx","../../node_modules/@radix-ui/number/dist/index.mjs","../../node_modules/@radix-ui/react-use-previous/dist/index.mjs","../../node_modules/@radix-ui/react-select/dist/index.mjs","../../src/components/ui/select.tsx","../../src/components/ProjectSelect.tsx","../../src/components/SideBar.tsx","../../src/components/Spinner.tsx","../../src/assets/architect.webp","../../src/assets/error.webp","../../src/assets/protag.webp","../../src/components/Instructions.tsx","../../node_modules/@gilbarbara/deep-equal/dist/index.mjs","../../node_modules/is-lite/dist/index.mjs","../../node_modules/tree-changes/dist/index.mjs","../../node_modules/scroll/index.js","../../node_modules/scrollparent/scrollparent.js","../../node_modules/deepmerge/dist/cjs.js","../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/prop-types/index.js","../../node_modules/popper.js/dist/esm/popper.js","../../node_modules/react-joyride/node_modules/react-floater/node_modules/is-lite/esm/index.js","../../node_modules/react-joyride/node_modules/react-floater/node_modules/@gilbarbara/deep-equal/esm/helpers.js","../../node_modules/react-joyride/node_modules/react-floater/node_modules/@gilbarbara/deep-equal/esm/index.js","../../node_modules/react-joyride/node_modules/react-floater/node_modules/tree-changes/esm/helpers.js","../../node_modules/react-joyride/node_modules/react-floater/node_modules/tree-changes/esm/index.js","../../node_modules/react-joyride/node_modules/react-floater/es/index.js","../../node_modules/react-innertext/index.js","../../node_modules/react-joyride/dist/index.mjs","../../src/components/Tour.tsx","../../src/components/ui/toaster.tsx","../../src/components/AppPage.tsx","../../node_modules/react-time-ago/modules/Time.js","../../node_modules/relative-time-format/modules/LocaleDataStore.js","../../node_modules/relative-time-format/modules/resolveLocale.js","../../node_modules/relative-time-format/modules/PluralRuleFunctions.js","../../node_modules/relative-time-format/modules/getPluralRulesLocale.js","../../node_modules/relative-time-format/modules/PluralRules.js","../../node_modules/relative-time-format/modules/RelativeTimeFormat.js","../../node_modules/javascript-time-ago/modules/cache.js","../../node_modules/javascript-time-ago/modules/locale.js","../../node_modules/javascript-time-ago/modules/isStyleObject.js","../../node_modules/javascript-time-ago/modules/steps/units.js","../../node_modules/javascript-time-ago/modules/steps/getStepDenominator.js","../../node_modules/javascript-time-ago/modules/round.js","../../node_modules/javascript-time-ago/modules/steps/getStepMinTime.js","../../node_modules/javascript-time-ago/modules/steps/getStep.js","../../node_modules/javascript-time-ago/modules/steps/getTimeToNextUpdateForUnit.js","../../node_modules/javascript-time-ago/modules/steps/getTimeToNextUpdate.js","../../node_modules/javascript-time-ago/modules/LocaleDataStore.js","../../node_modules/javascript-time-ago/modules/steps/round.js","../../node_modules/javascript-time-ago/modules/style/round.js","../../node_modules/javascript-time-ago/modules/style/roundMinute.js","../../node_modules/javascript-time-ago/modules/steps/approximate.js","../../node_modules/javascript-time-ago/modules/style/approximate.js","../../node_modules/javascript-time-ago/modules/style/approximateTime.js","../../node_modules/javascript-time-ago/modules/steps/helpers.js","../../node_modules/javascript-time-ago/modules/style/twitter.js","../../node_modules/javascript-time-ago/modules/style/twitterNow.js","../../node_modules/javascript-time-ago/modules/style/twitterMinute.js","../../node_modules/javascript-time-ago/modules/style/twitterMinuteNow.js","../../node_modules/javascript-time-ago/modules/style/twitterFirstMinute.js","../../node_modules/javascript-time-ago/modules/style/mini.js","../../node_modules/javascript-time-ago/modules/style/miniNow.js","../../node_modules/javascript-time-ago/modules/style/miniMinute.js","../../node_modules/javascript-time-ago/modules/style/miniMinuteNow.js","../../node_modules/javascript-time-ago/modules/style/getStyleByName.js","../../node_modules/javascript-time-ago/modules/TimeAgo.js","../../node_modules/memoize-one/dist/memoize-one.esm.js","../../node_modules/react-time-ago/modules/helpers/locale.js","../../node_modules/react-time-ago/modules/helpers/cache.js","../../node_modules/react-time-ago/modules/helpers/getVerboseDateFormatter.js","../../node_modules/react-time-ago/modules/helpers/date.js","../../node_modules/react-time-ago/modules/helpers/getTimeAgo.js","../../node_modules/performance-now/lib/performance-now.js","../../node_modules/raf/index.js","../../node_modules/react-time-ago/modules/helpers/binarySearch.js","../../node_modules/react-time-ago/modules/Updater.js","../../node_modules/react-time-ago/modules/useTimeAgo.js","../../node_modules/react-time-ago/modules/PropTypes.js","../../node_modules/react-time-ago/modules/ReactTimeAgo.js","../../node_modules/react-icons/bs/index.esm.js","../../src/components/cards/task/Priority.tsx","../../src/components/NotificationPage.tsx","../../src/components/UpgradePage.tsx","../../src/components/PurchasePage.tsx","../../node_modules/@stripe/stripe-js/dist/index.mjs","../../node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs","../../src/components/CheckoutPage.tsx","../../node_modules/react-window-infinite-loader/dist/index.esm.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../node_modules/react-window/node_modules/memoize-one/dist/memoize-one.esm.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/react-window/dist/index.esm.js","../../node_modules/@radix-ui/react-dialog/dist/index.mjs","../../src/components/cards/chart/MiniChart.tsx","../../src/components/cards/UtilityCard.tsx","../../@subseq/planner-wasm/pkg/planner_wasm.js","../../node_modules/free-style/dist.es2015/index.js","../../node_modules/typestyle/lib.es2015/internal/formatting.js","../../node_modules/typestyle/lib.es2015/internal/utilities.js","../../node_modules/typestyle/lib.es2015/internal/typestyle.js","../../node_modules/typestyle/lib.es2015/index.js","../../src/components/cards/chart/GanttChart.tsx","../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/react-select/dist/useStateManager-7e1e8489.esm.js","../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/@babel/runtime/helpers/esm/inherits.js","../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/esm/createSuper.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Parser.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/stylis/src/Middleware.js","../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../../node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/react-is/index.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../../node_modules/@emotion/react/dist/emotion-element-43c6fea0.browser.esm.js","../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js","../../node_modules/react-select/dist/index-a301f526.esm.js","../../node_modules/react-select/dist/Select-49a62830.esm.js","../../node_modules/react-select/dist/react-select.esm.js","../../src/components/SelectTheme.tsx","../../node_modules/comma-separated-tokens/index.js","../../node_modules/estree-util-is-identifier-name/lib/index.js","../../node_modules/hast-util-whitespace/lib/index.js","../../node_modules/property-information/lib/util/schema.js","../../node_modules/property-information/lib/util/merge.js","../../node_modules/property-information/lib/normalize.js","../../node_modules/property-information/lib/util/info.js","../../node_modules/property-information/lib/util/types.js","../../node_modules/property-information/lib/util/defined-info.js","../../node_modules/property-information/lib/util/create.js","../../node_modules/property-information/lib/xlink.js","../../node_modules/property-information/lib/xml.js","../../node_modules/property-information/lib/util/case-sensitive-transform.js","../../node_modules/property-information/lib/util/case-insensitive-transform.js","../../node_modules/property-information/lib/xmlns.js","../../node_modules/property-information/lib/aria.js","../../node_modules/property-information/lib/html.js","../../node_modules/property-information/lib/svg.js","../../node_modules/property-information/lib/find.js","../../node_modules/property-information/lib/hast-to-react.js","../../node_modules/property-information/index.js","../../node_modules/space-separated-tokens/index.js","../../node_modules/inline-style-parser/index.js","../../node_modules/style-to-object/cjs/index.js","../../node_modules/style-to-object/esm/index.mjs","../../node_modules/unist-util-position/lib/index.js","../../node_modules/unist-util-stringify-position/lib/index.js","../../node_modules/vfile-message/lib/index.js","../../node_modules/hast-util-to-jsx-runtime/lib/index.js","../../node_modules/html-url-attributes/lib/index.js","../../node_modules/mdast-util-to-string/lib/index.js","../../node_modules/decode-named-character-reference/index.dom.js","../../node_modules/micromark-util-chunked/index.js","../../node_modules/micromark-util-combine-extensions/index.js","../../node_modules/micromark-util-decode-numeric-character-reference/index.js","../../node_modules/micromark-util-normalize-identifier/index.js","../../node_modules/micromark-util-character/index.js","../../node_modules/micromark-util-sanitize-uri/index.js","../../node_modules/micromark-factory-space/index.js","../../node_modules/micromark/lib/initialize/content.js","../../node_modules/micromark/lib/initialize/document.js","../../node_modules/micromark-util-classify-character/index.js","../../node_modules/micromark-util-resolve-all/index.js","../../node_modules/micromark-core-commonmark/lib/attention.js","../../node_modules/micromark-core-commonmark/lib/autolink.js","../../node_modules/micromark-core-commonmark/lib/blank-line.js","../../node_modules/micromark-core-commonmark/lib/block-quote.js","../../node_modules/micromark-core-commonmark/lib/character-escape.js","../../node_modules/micromark-core-commonmark/lib/character-reference.js","../../node_modules/micromark-core-commonmark/lib/code-fenced.js","../../node_modules/micromark-core-commonmark/lib/code-indented.js","../../node_modules/micromark-core-commonmark/lib/code-text.js","../../node_modules/micromark-util-subtokenize/index.js","../../node_modules/micromark-core-commonmark/lib/content.js","../../node_modules/micromark-factory-destination/index.js","../../node_modules/micromark-factory-label/index.js","../../node_modules/micromark-factory-title/index.js","../../node_modules/micromark-factory-whitespace/index.js","../../node_modules/micromark-core-commonmark/lib/definition.js","../../node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../node_modules/micromark-core-commonmark/lib/heading-atx.js","../../node_modules/micromark-util-html-tag-name/index.js","../../node_modules/micromark-core-commonmark/lib/html-flow.js","../../node_modules/micromark-core-commonmark/lib/html-text.js","../../node_modules/micromark-core-commonmark/lib/label-end.js","../../node_modules/micromark-core-commonmark/lib/label-start-image.js","../../node_modules/micromark-core-commonmark/lib/label-start-link.js","../../node_modules/micromark-core-commonmark/lib/line-ending.js","../../node_modules/micromark-core-commonmark/lib/thematic-break.js","../../node_modules/micromark-core-commonmark/lib/list.js","../../node_modules/micromark-core-commonmark/lib/setext-underline.js","../../node_modules/micromark/lib/initialize/flow.js","../../node_modules/micromark/lib/initialize/text.js","../../node_modules/micromark/lib/create-tokenizer.js","../../node_modules/micromark/lib/constructs.js","../../node_modules/micromark/lib/parse.js","../../node_modules/micromark/lib/postprocess.js","../../node_modules/micromark/lib/preprocess.js","../../node_modules/micromark-util-decode-string/index.js","../../node_modules/mdast-util-from-markdown/lib/index.js","../../node_modules/remark-parse/lib/index.js","../../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../../node_modules/mdast-util-to-hast/lib/handlers/break.js","../../node_modules/mdast-util-to-hast/lib/handlers/code.js","../../node_modules/mdast-util-to-hast/lib/handlers/delete.js","../../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../../node_modules/mdast-util-to-hast/lib/handlers/heading.js","../../node_modules/mdast-util-to-hast/lib/handlers/html.js","../../node_modules/mdast-util-to-hast/lib/revert.js","../../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../../node_modules/mdast-util-to-hast/lib/handlers/image.js","../../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../../node_modules/mdast-util-to-hast/lib/handlers/link.js","../../node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../../node_modules/mdast-util-to-hast/lib/handlers/list.js","../../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../../node_modules/mdast-util-to-hast/lib/handlers/root.js","../../node_modules/mdast-util-to-hast/lib/handlers/strong.js","../../node_modules/mdast-util-to-hast/lib/handlers/table.js","../../node_modules/mdast-util-to-hast/lib/handlers/table-row.js","../../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js","../../node_modules/trim-lines/index.js","../../node_modules/mdast-util-to-hast/lib/handlers/text.js","../../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../../node_modules/mdast-util-to-hast/lib/handlers/index.js","../../node_modules/@ungap/structured-clone/esm/types.js","../../node_modules/@ungap/structured-clone/esm/deserialize.js","../../node_modules/@ungap/structured-clone/esm/serialize.js","../../node_modules/@ungap/structured-clone/esm/index.js","../../node_modules/mdast-util-to-hast/lib/footer.js","../../node_modules/unist-util-is/lib/index.js","../../node_modules/unist-util-visit-parents/lib/index.js","../../node_modules/unist-util-visit/lib/index.js","../../node_modules/mdast-util-to-hast/lib/state.js","../../node_modules/mdast-util-to-hast/lib/index.js","../../node_modules/remark-rehype/lib/index.js","../../node_modules/bail/index.js","../../node_modules/extend/index.js","../../node_modules/is-plain-obj/index.js","../../node_modules/trough/index.js","../../node_modules/vfile/lib/minpath.browser.js","../../node_modules/vfile/lib/minproc.browser.js","../../node_modules/vfile/lib/minurl.shared.js","../../node_modules/vfile/lib/minurl.browser.js","../../node_modules/vfile/lib/index.js","../../node_modules/unified/lib/callable-instance.js","../../node_modules/unified/lib/index.js","../../node_modules/react-markdown/lib/index.js","../../node_modules/react-select/dist/useAsync-ba7c6b77.esm.js","../../node_modules/react-select/async/dist/react-select-async.esm.js","../../node_modules/react-select/dist/useCreatable-d97ef2c9.esm.js","../../node_modules/react-select/async-creatable/dist/react-select-async-creatable.esm.js","../../node_modules/react-day-picker/dist/esm/UI.js","../../node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js","../../node_modules/react-day-picker/dist/esm/components/Button.js","../../node_modules/react-day-picker/dist/esm/components/Chevron.js","../../node_modules/react-day-picker/dist/esm/components/CaptionLabel.js","../../node_modules/react-day-picker/dist/esm/components/Day.js","../../node_modules/react-day-picker/dist/esm/components/DayButton.js","../../node_modules/react-day-picker/dist/esm/components/Dropdown.js","../../node_modules/react-day-picker/dist/esm/components/DropdownNav.js","../../node_modules/react-day-picker/dist/esm/components/Footer.js","../../node_modules/react-day-picker/dist/esm/components/Month.js","../../node_modules/react-day-picker/dist/esm/components/MonthCaption.js","../../node_modules/react-day-picker/dist/esm/components/MonthGrid.js","../../node_modules/react-day-picker/dist/esm/components/Months.js","../../node_modules/react-day-picker/dist/esm/components/Nav.js","../../node_modules/react-day-picker/dist/esm/components/Option.js","../../node_modules/react-day-picker/dist/esm/components/Root.js","../../node_modules/react-day-picker/dist/esm/components/Select.js","../../node_modules/react-day-picker/dist/esm/components/Weeks.js","../../node_modules/react-day-picker/dist/esm/components/Week.js","../../node_modules/react-day-picker/dist/esm/components/Weekday.js","../../node_modules/react-day-picker/dist/esm/components/Weekdays.js","../../node_modules/react-day-picker/dist/esm/components/WeekNumber.js","../../node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js","../../node_modules/react-day-picker/dist/esm/helpers/getComponents.js","../../node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js","../../node_modules/date-fns/toDate.mjs","../../node_modules/date-fns/constructFrom.mjs","../../node_modules/date-fns/addDays.mjs","../../node_modules/date-fns/addMonths.mjs","../../node_modules/date-fns/addWeeks.mjs","../../node_modules/date-fns/addYears.mjs","../../node_modules/date-fns/constants.mjs","../../node_modules/date-fns/startOfDay.mjs","../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../node_modules/date-fns/differenceInCalendarDays.mjs","../../node_modules/date-fns/differenceInCalendarMonths.mjs","../../node_modules/date-fns/_lib/defaultOptions.mjs","../../node_modules/date-fns/endOfWeek.mjs","../../node_modules/date-fns/endOfISOWeek.mjs","../../node_modules/date-fns/endOfMonth.mjs","../../node_modules/date-fns/endOfYear.mjs","../../node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../node_modules/date-fns/locale/en-US/_lib/match.mjs","../../node_modules/date-fns/locale/en-US.mjs","../../node_modules/date-fns/startOfYear.mjs","../../node_modules/date-fns/getDayOfYear.mjs","../../node_modules/date-fns/startOfWeek.mjs","../../node_modules/date-fns/startOfISOWeek.mjs","../../node_modules/date-fns/getISOWeekYear.mjs","../../node_modules/date-fns/startOfISOWeekYear.mjs","../../node_modules/date-fns/getISOWeek.mjs","../../node_modules/date-fns/getWeekYear.mjs","../../node_modules/date-fns/startOfWeekYear.mjs","../../node_modules/date-fns/getWeek.mjs","../../node_modules/date-fns/_lib/addLeadingZeros.mjs","../../node_modules/date-fns/_lib/format/lightFormatters.mjs","../../node_modules/date-fns/_lib/format/formatters.mjs","../../node_modules/date-fns/_lib/format/longFormatters.mjs","../../node_modules/date-fns/_lib/protectedTokens.mjs","../../node_modules/date-fns/isDate.mjs","../../node_modules/date-fns/isValid.mjs","../../node_modules/date-fns/format.mjs","../../node_modules/date-fns/isAfter.mjs","../../node_modules/date-fns/isBefore.mjs","../../node_modules/date-fns/isSameDay.mjs","../../node_modules/date-fns/isSameMonth.mjs","../../node_modules/date-fns/isSameYear.mjs","../../node_modules/date-fns/max.mjs","../../node_modules/date-fns/min.mjs","../../node_modules/date-fns/getDaysInMonth.mjs","../../node_modules/date-fns/setMonth.mjs","../../node_modules/date-fns/setYear.mjs","../../node_modules/date-fns/startOfMonth.mjs","../../node_modules/react-day-picker/dist/esm/lib/dateLib.js","../../node_modules/react-day-picker/dist/esm/helpers/getDateLib.js","../../node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js","../../node_modules/react-day-picker/dist/esm/formatters/formatCaption.js","../../node_modules/react-day-picker/dist/esm/formatters/formatDay.js","../../node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js","../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js","../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js","../../node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js","../../node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js","../../node_modules/react-day-picker/dist/esm/helpers/getFormatters.js","../../node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js","../../node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js","../../node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js","../../node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js","../../node_modules/react-day-picker/dist/esm/labels/labelGrid.js","../../node_modules/react-day-picker/dist/esm/labels/labelGridcell.js","../../node_modules/react-day-picker/dist/esm/labels/labelDayButton.js","../../node_modules/react-day-picker/dist/esm/labels/labelNav.js","../../node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js","../../node_modules/react-day-picker/dist/esm/labels/labelNext.js","../../node_modules/react-day-picker/dist/esm/labels/labelPrevious.js","../../node_modules/react-day-picker/dist/esm/labels/labelWeekday.js","../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js","../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js","../../node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js","../../node_modules/react-day-picker/dist/esm/helpers/getDates.js","../../node_modules/react-day-picker/dist/esm/helpers/getDays.js","../../node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js","../../node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js","../../node_modules/react-day-picker/dist/esm/classes/CalendarDay.js","../../node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js","../../node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js","../../node_modules/react-day-picker/dist/esm/helpers/getMonths.js","../../node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/getWeeks.js","../../node_modules/react-day-picker/dist/esm/useCalendar.js","../../node_modules/react-day-picker/dist/esm/useDayPicker.js","../../node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js","../../node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js","../../node_modules/react-day-picker/dist/esm/utils/typeguards.js","../../node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js","../../node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js","../../node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js","../../node_modules/react-day-picker/dist/esm/useFocus.js","../../node_modules/react-day-picker/dist/esm/useGetModifiers.js","../../node_modules/react-day-picker/dist/esm/selection/useMulti.js","../../node_modules/react-day-picker/dist/esm/utils/addToRange.js","../../node_modules/react-day-picker/dist/esm/selection/useRange.js","../../node_modules/react-day-picker/dist/esm/selection/useSingle.js","../../node_modules/react-day-picker/dist/esm/useSelection.js","../../node_modules/react-day-picker/dist/esm/DayPicker.js","../../src/components/ui/calendar.tsx","../../node_modules/@radix-ui/react-popover/dist/index.mjs","../../src/components/ui/popover.tsx","../../src/components/cards/EditableDropdown.tsx","../../node_modules/@radix-ui/react-scroll-area/dist/index.mjs","../../src/components/ui/scrollarea.tsx","../../src/components/ui/textarea.tsx","../../src/components/cards/DetailGrid.tsx","../../node_modules/@radix-ui/react-checkbox/dist/index.mjs","../../src/components/ui/checkbox.tsx","../../src/components/cards/chart/ChartCreate.tsx","../../src/components/ui/dialog.tsx","../../src/components/cards/chart/ChartWindow.tsx","../../src/components/cards/data/MiniData.tsx","../../src/components/ui/input.tsx","../../src/components/cards/DetailCard.tsx","../../src/components/cards/data/DataDetail.tsx","../../src/components/cards/data/DataCreate.tsx","../../src/components/cards/data/DataDetailsView.tsx","../../src/components/cards/data/DataWindow.tsx","../../src/components/cards/milestone/MilestoneDetail.tsx","../../src/components/ui/datepickerwithrange.tsx","../../src/components/cards/milestone/MilestoneCreate.tsx","../../src/components/cards/milestone/MilestoneDetailsView.tsx","../../src/components/cards/milestone/MiniMilestone.tsx","../../src/components/cards/milestone/MilestoneWindow.tsx","../../src/components/cards/project/ProjectCreate.tsx","../../src/components/cards/project/ProjectDetail.tsx","../../src/components/cards/project/ProjectDetailsView.tsx","../../src/components/cards/project/MiniProject.tsx","../../src/components/cards/CardDataInterfaces.tsx","../../src/components/cards/CardGrid.tsx","../../src/components/cards/project/ProjectGrid.tsx","../../src/components/cards/project/ProjectWindow.tsx","../../src/components/cards/task/TaskIcon.tsx","../../src/components/cards/task/MiniTask.tsx","../../src/components/cards/task/TaskGrid.tsx","../../src/components/cards/task/Swimlanes.tsx","../../node_modules/react-icons/cg/index.esm.js","../../src/components/cards/task/Milestone.tsx","../../src/components/cards/task/PlannedTask.tsx","../../src/components/cards/task/Comment.tsx","../../src/components/cards/task/TaskComments.tsx","../../node_modules/react-select/creatable/dist/react-select-creatable.esm.js","../../src/components/cards/task/TaskState.tsx","../../src/components/cards/task/TaskDetail.tsx","../../src/components/cards/task/TaskCreate.tsx","../../src/components/cards/task/TaskWindow.tsx","../../src/components/cards/user/MiniUser.tsx","../../src/components/cards/user/UserGrid.tsx","../../src/components/cards/user/UserDetail.tsx","../../src/components/cards/user/UserInvite.tsx","../../src/components/cards/user/UserDetailsView.tsx","../../src/components/cards/user/UserWindow.tsx","../../node_modules/react-hook-form/dist/index.esm.mjs","../../node_modules/@hookform/resolvers/dist/resolvers.mjs","../../node_modules/@hookform/resolvers/zod/dist/zod.mjs","../../node_modules/zod/lib/index.mjs","../../node_modules/normalize-wheel/src/UserAgent_DEPRECATED.js","../../node_modules/normalize-wheel/src/ExecutionEnvironment.js","../../node_modules/normalize-wheel/src/isEventSupported.js","../../node_modules/normalize-wheel/src/normalizeWheel.js","../../node_modules/normalize-wheel/index.js","../../node_modules/react-easy-crop/index.module.js","../../src/components/cards/user/ImageUpload.tsx","../../src/components/ui/form.tsx","../../node_modules/@radix-ui/react-switch/dist/index.mjs","../../src/components/ui/switch.tsx","../../src/components/cards/user/UserSettings.tsx","../../src/components/WorklogPage.tsx","../../src/components/WorkflowPage.tsx","../../src/components/InvitePage.tsx","../../src/components/BetaInvitePage.tsx","../../src/components/VerifyPage.tsx","../../src/components/ServerDown.tsx","../../node_modules/react-icons/ri/index.esm.js","../../src/components/Steps.tsx","../../src/components/OnboardingPage.tsx","../../src/components/LED.tsx","../../node_modules/@radix-ui/react-collapsible/dist/index.mjs","../../node_modules/@radix-ui/react-accordion/dist/index.mjs","../../src/components/ui/accordion.tsx","../../src/components/ui/table.tsx","../../src/components/GithubImportPage.tsx","../../src/components/Admin.tsx","../../src/components/App.tsx","../../node_modules/javascript-time-ago/locale/en.json.js","../../src/main.tsx"],"sourcesContent":["/**\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>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.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/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3 0;\n};\nexports.hasSubscribers = hasSubscribers;\nvar addSubscriber = function (url, subscriber) {\n subscribers[url] = subscribers[url] || new Set();\n subscribers[url].add(subscriber);\n};\nexports.addSubscriber = addSubscriber;\nvar removeSubscriber = function (url, subscriber) {\n subscribers[url].delete(subscriber);\n};\nexports.removeSubscriber = removeSubscriber;\nvar resetSubscribers = function (url) {\n if (url && subscribers.hasOwnProperty(url)) {\n delete subscribers[url];\n }\n else {\n for (var url_1 in subscribers) {\n if (subscribers.hasOwnProperty(url_1)) {\n delete subscribers[url_1];\n }\n }\n }\n};\nexports.resetSubscribers = resetSubscribers;\n//# sourceMappingURL=manage-subscribers.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resetGlobalState = exports.assertIsWebSocket = void 0;\nvar globals_1 = require(\"./globals\");\nvar manage_subscribers_1 = require(\"./manage-subscribers\");\nfunction assertIsWebSocket(webSocketInstance, skip) {\n if (!skip && webSocketInstance instanceof WebSocket === false)\n throw new Error('');\n}\nexports.assertIsWebSocket = assertIsWebSocket;\n;\nfunction resetGlobalState(url) {\n (0, manage_subscribers_1.resetSubscribers)(url);\n (0, globals_1.resetWebSockets)(url);\n}\nexports.resetGlobalState = resetGlobalState;\n;\n//# sourceMappingURL=util.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.attachListeners = void 0;\nvar socket_io_1 = require(\"./socket-io\");\nvar heartbeat_1 = require(\"./heartbeat\");\nvar constants_1 = require(\"./constants\");\nvar util_1 = require(\"./util\");\nvar bindMessageHandler = function (webSocketInstance, optionsRef, setLastMessage) {\n var heartbeatCb;\n if (optionsRef.current.heartbeat && webSocketInstance instanceof WebSocket) {\n var heartbeatOptions = typeof optionsRef.current.heartbeat === \"boolean\"\n ? undefined\n : optionsRef.current.heartbeat;\n heartbeatCb = (0, heartbeat_1.heartbeat)(webSocketInstance, heartbeatOptions);\n }\n webSocketInstance.onmessage = function (message) {\n var _a;\n heartbeatCb === null || heartbeatCb === void 0 ? void 0 : heartbeatCb();\n optionsRef.current.onMessage && optionsRef.current.onMessage(message);\n if (typeof optionsRef.current.filter === 'function' && optionsRef.current.filter(message) !== true) {\n return;\n }\n if (optionsRef.current.heartbeat &&\n typeof optionsRef.current.heartbeat !== \"boolean\" &&\n ((_a = optionsRef.current.heartbeat) === null || _a === void 0 ? void 0 : _a.returnMessage) === message.data)\n return;\n setLastMessage(message);\n };\n};\nvar bindOpenHandler = function (webSocketInstance, optionsRef, setReadyState, reconnectCount) {\n webSocketInstance.onopen = function (event) {\n optionsRef.current.onOpen && optionsRef.current.onOpen(event);\n reconnectCount.current = 0;\n setReadyState(constants_1.ReadyState.OPEN);\n };\n};\nvar bindCloseHandler = function (webSocketInstance, optionsRef, setReadyState, reconnect, reconnectCount) {\n if (constants_1.isEventSourceSupported && webSocketInstance instanceof EventSource) {\n return function () { };\n }\n (0, util_1.assertIsWebSocket)(webSocketInstance, optionsRef.current.skipAssert);\n var reconnectTimeout;\n webSocketInstance.onclose = function (event) {\n var _a;\n optionsRef.current.onClose && optionsRef.current.onClose(event);\n setReadyState(constants_1.ReadyState.CLOSED);\n if (optionsRef.current.shouldReconnect && optionsRef.current.shouldReconnect(event)) {\n var reconnectAttempts = (_a = optionsRef.current.reconnectAttempts) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_RECONNECT_LIMIT;\n if (reconnectCount.current < reconnectAttempts) {\n var nextReconnectInterval = typeof optionsRef.current.reconnectInterval === 'function' ?\n optionsRef.current.reconnectInterval(reconnectCount.current) :\n optionsRef.current.reconnectInterval;\n reconnectTimeout = window.setTimeout(function () {\n reconnectCount.current++;\n reconnect();\n }, nextReconnectInterval !== null && nextReconnectInterval !== void 0 ? nextReconnectInterval : constants_1.DEFAULT_RECONNECT_INTERVAL_MS);\n }\n else {\n optionsRef.current.onReconnectStop && optionsRef.current.onReconnectStop(reconnectAttempts);\n console.warn(\"Max reconnect attempts of \".concat(reconnectAttempts, \" exceeded\"));\n }\n }\n };\n return function () { return reconnectTimeout && window.clearTimeout(reconnectTimeout); };\n};\nvar bindErrorHandler = function (webSocketInstance, optionsRef, setReadyState, reconnect, reconnectCount) {\n var reconnectTimeout;\n webSocketInstance.onerror = function (error) {\n var _a;\n optionsRef.current.onError && optionsRef.current.onError(error);\n if (constants_1.isEventSourceSupported && webSocketInstance instanceof EventSource) {\n optionsRef.current.onClose && optionsRef.current.onClose(__assign(__assign({}, error), { code: 1006, reason: \"An error occurred with the EventSource: \".concat(error), wasClean: false }));\n setReadyState(constants_1.ReadyState.CLOSED);\n webSocketInstance.close();\n }\n if (optionsRef.current.retryOnError) {\n if (reconnectCount.current < ((_a = optionsRef.current.reconnectAttempts) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_RECONNECT_LIMIT)) {\n var nextReconnectInterval = typeof optionsRef.current.reconnectInterval === 'function' ?\n optionsRef.current.reconnectInterval(reconnectCount.current) :\n optionsRef.current.reconnectInterval;\n reconnectTimeout = window.setTimeout(function () {\n reconnectCount.current++;\n reconnect();\n }, nextReconnectInterval !== null && nextReconnectInterval !== void 0 ? nextReconnectInterval : constants_1.DEFAULT_RECONNECT_INTERVAL_MS);\n }\n else {\n optionsRef.current.onReconnectStop && optionsRef.current.onReconnectStop(optionsRef.current.reconnectAttempts);\n console.warn(\"Max reconnect attempts of \".concat(optionsRef.current.reconnectAttempts, \" exceeded\"));\n }\n }\n };\n return function () { return reconnectTimeout && window.clearTimeout(reconnectTimeout); };\n};\nvar attachListeners = function (webSocketInstance, setters, optionsRef, reconnect, reconnectCount, sendMessage) {\n var setLastMessage = setters.setLastMessage, setReadyState = setters.setReadyState;\n var interval;\n var cancelReconnectOnClose;\n var cancelReconnectOnError;\n if (optionsRef.current.fromSocketIO) {\n interval = (0, socket_io_1.setUpSocketIOPing)(sendMessage);\n }\n bindMessageHandler(webSocketInstance, optionsRef, setLastMessage);\n bindOpenHandler(webSocketInstance, optionsRef, setReadyState, reconnectCount);\n cancelReconnectOnClose = bindCloseHandler(webSocketInstance, optionsRef, setReadyState, reconnect, reconnectCount);\n cancelReconnectOnError = bindErrorHandler(webSocketInstance, optionsRef, setReadyState, reconnect, reconnectCount);\n return function () {\n setReadyState(constants_1.ReadyState.CLOSING);\n cancelReconnectOnClose();\n cancelReconnectOnError();\n webSocketInstance.close();\n if (interval)\n clearInterval(interval);\n };\n};\nexports.attachListeners = attachListeners;\n//# sourceMappingURL=attach-listener.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.attachSharedListeners = void 0;\nvar globals_1 = require(\"./globals\");\nvar constants_1 = require(\"./constants\");\nvar manage_subscribers_1 = require(\"./manage-subscribers\");\nvar socket_io_1 = require(\"./socket-io\");\nvar heartbeat_1 = require(\"./heartbeat\");\nvar bindMessageHandler = function (webSocketInstance, url, heartbeatOptions) {\n var onMessageCb;\n if (heartbeatOptions && webSocketInstance instanceof WebSocket) {\n onMessageCb = (0, heartbeat_1.heartbeat)(webSocketInstance, typeof heartbeatOptions === 'boolean' ? undefined : heartbeatOptions);\n }\n webSocketInstance.onmessage = function (message) {\n onMessageCb === null || onMessageCb === void 0 ? void 0 : onMessageCb();\n (0, manage_subscribers_1.getSubscribers)(url).forEach(function (subscriber) {\n if (subscriber.optionsRef.current.onMessage) {\n subscriber.optionsRef.current.onMessage(message);\n }\n if (typeof subscriber.optionsRef.current.filter === 'function' &&\n subscriber.optionsRef.current.filter(message) !== true) {\n return;\n }\n if (heartbeatOptions &&\n typeof heartbeatOptions !== \"boolean\" &&\n (heartbeatOptions === null || heartbeatOptions === void 0 ? void 0 : heartbeatOptions.returnMessage) === message.data)\n return;\n subscriber.setLastMessage(message);\n });\n };\n};\nvar bindOpenHandler = function (webSocketInstance, url) {\n webSocketInstance.onopen = function (event) {\n (0, manage_subscribers_1.getSubscribers)(url).forEach(function (subscriber) {\n subscriber.reconnectCount.current = 0;\n if (subscriber.optionsRef.current.onOpen) {\n subscriber.optionsRef.current.onOpen(event);\n }\n subscriber.setReadyState(constants_1.ReadyState.OPEN);\n });\n };\n};\nvar bindCloseHandler = function (webSocketInstance, url) {\n if (webSocketInstance instanceof WebSocket) {\n webSocketInstance.onclose = function (event) {\n (0, manage_subscribers_1.getSubscribers)(url).forEach(function (subscriber) {\n if (subscriber.optionsRef.current.onClose) {\n subscriber.optionsRef.current.onClose(event);\n }\n subscriber.setReadyState(constants_1.ReadyState.CLOSED);\n });\n delete globals_1.sharedWebSockets[url];\n (0, manage_subscribers_1.getSubscribers)(url).forEach(function (subscriber) {\n var _a;\n if (subscriber.optionsRef.current.shouldReconnect &&\n subscriber.optionsRef.current.shouldReconnect(event)) {\n var reconnectAttempts = (_a = subscriber.optionsRef.current.reconnectAttempts) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_RECONNECT_LIMIT;\n if (subscriber.reconnectCount.current < reconnectAttempts) {\n var nextReconnectInterval = typeof subscriber.optionsRef.current.reconnectInterval === 'function' ?\n subscriber.optionsRef.current.reconnectInterval(subscriber.reconnectCount.current) :\n subscriber.optionsRef.current.reconnectInterval;\n setTimeout(function () {\n subscriber.reconnectCount.current++;\n subscriber.reconnect.current();\n }, nextReconnectInterval !== null && nextReconnectInterval !== void 0 ? nextReconnectInterval : constants_1.DEFAULT_RECONNECT_INTERVAL_MS);\n }\n else {\n subscriber.optionsRef.current.onReconnectStop && subscriber.optionsRef.current.onReconnectStop(subscriber.optionsRef.current.reconnectAttempts);\n console.warn(\"Max reconnect attempts of \".concat(reconnectAttempts, \" exceeded\"));\n }\n }\n });\n };\n }\n};\nvar bindErrorHandler = function (webSocketInstance, url) {\n webSocketInstance.onerror = function (error) {\n (0, manage_subscribers_1.getSubscribers)(url).forEach(function (subscriber) {\n if (subscriber.optionsRef.current.onError) {\n subscriber.optionsRef.current.onError(error);\n }\n if (constants_1.isEventSourceSupported && webSocketInstance instanceof EventSource) {\n subscriber.optionsRef.current.onClose && subscriber.optionsRef.current.onClose(__assign(__assign({}, error), { code: 1006, reason: \"An error occurred with the EventSource: \".concat(error), wasClean: false }));\n subscriber.setReadyState(constants_1.ReadyState.CLOSED);\n }\n });\n if (constants_1.isEventSourceSupported && webSocketInstance instanceof EventSource) {\n webSocketInstance.close();\n }\n };\n};\nvar attachSharedListeners = function (webSocketInstance, url, optionsRef, sendMessage) {\n var interval;\n if (optionsRef.current.fromSocketIO) {\n interval = (0, socket_io_1.setUpSocketIOPing)(sendMessage);\n }\n bindMessageHandler(webSocketInstance, url, optionsRef.current.heartbeat);\n bindCloseHandler(webSocketInstance, url);\n bindOpenHandler(webSocketInstance, url);\n bindErrorHandler(webSocketInstance, url);\n return function () {\n if (interval)\n clearInterval(interval);\n };\n};\nexports.attachSharedListeners = attachSharedListeners;\n//# sourceMappingURL=attach-shared-listeners.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createOrJoinSocket = void 0;\nvar globals_1 = require(\"./globals\");\nvar constants_1 = require(\"./constants\");\nvar attach_listener_1 = require(\"./attach-listener\");\nvar attach_shared_listeners_1 = require(\"./attach-shared-listeners\");\nvar manage_subscribers_1 = require(\"./manage-subscribers\");\n//TODO ensure that all onClose callbacks are called\nvar cleanSubscribers = function (url, subscriber, optionsRef, setReadyState, clearSocketIoPingInterval) {\n return function () {\n (0, manage_subscribers_1.removeSubscriber)(url, subscriber);\n if (!(0, manage_subscribers_1.hasSubscribers)(url)) {\n try {\n var socketLike = globals_1.sharedWebSockets[url];\n if (socketLike instanceof WebSocket) {\n socketLike.onclose = function (event) {\n if (optionsRef.current.onClose) {\n optionsRef.current.onClose(event);\n }\n setReadyState(constants_1.ReadyState.CLOSED);\n };\n }\n socketLike.close();\n }\n catch (e) {\n }\n if (clearSocketIoPingInterval)\n clearSocketIoPingInterval();\n delete globals_1.sharedWebSockets[url];\n }\n };\n};\nvar createOrJoinSocket = function (webSocketRef, url, setReadyState, optionsRef, setLastMessage, startRef, reconnectCount, sendMessage) {\n if (!constants_1.isEventSourceSupported && optionsRef.current.eventSourceOptions) {\n if (constants_1.isReactNative) {\n throw new Error('EventSource is not supported in ReactNative');\n }\n else {\n throw new Error('EventSource is not supported');\n }\n }\n if (optionsRef.current.share) {\n var clearSocketIoPingInterval = null;\n if (globals_1.sharedWebSockets[url] === undefined) {\n globals_1.sharedWebSockets[url] = optionsRef.current.eventSourceOptions ?\n new EventSource(url, optionsRef.current.eventSourceOptions) :\n new WebSocket(url, optionsRef.current.protocols);\n webSocketRef.current = globals_1.sharedWebSockets[url];\n setReadyState(constants_1.ReadyState.CONNECTING);\n clearSocketIoPingInterval = (0, attach_shared_listeners_1.attachSharedListeners)(globals_1.sharedWebSockets[url], url, optionsRef, sendMessage);\n }\n else {\n webSocketRef.current = globals_1.sharedWebSockets[url];\n setReadyState(globals_1.sharedWebSockets[url].readyState);\n }\n var subscriber = {\n setLastMessage: setLastMessage,\n setReadyState: setReadyState,\n optionsRef: optionsRef,\n reconnectCount: reconnectCount,\n reconnect: startRef,\n };\n (0, manage_subscribers_1.addSubscriber)(url, subscriber);\n return cleanSubscribers(url, subscriber, optionsRef, setReadyState, clearSocketIoPingInterval);\n }\n else {\n webSocketRef.current = optionsRef.current.eventSourceOptions ?\n new EventSource(url, optionsRef.current.eventSourceOptions) :\n new WebSocket(url, optionsRef.current.protocols);\n setReadyState(constants_1.ReadyState.CONNECTING);\n if (!webSocketRef.current) {\n throw new Error('WebSocket failed to be created');\n }\n return (0, attach_listener_1.attachListeners)(webSocketRef.current, {\n setLastMessage: setLastMessage,\n setReadyState: setReadyState\n }, optionsRef, startRef.current, reconnectCount, sendMessage);\n }\n};\nexports.createOrJoinSocket = createOrJoinSocket;\n//# sourceMappingURL=create-or-join.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getUrl = void 0;\nvar socket_io_1 = require(\"./socket-io\");\nvar getUrl = function (url, optionsRef) { return __awaiter(void 0, void 0, void 0, function () {\n var convertedUrl, parsedUrl, parsedWithQueryParams;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(typeof url === 'function')) return [3 /*break*/, 2];\n return [4 /*yield*/, url()];\n case 1:\n convertedUrl = _a.sent();\n return [3 /*break*/, 3];\n case 2:\n convertedUrl = url;\n _a.label = 3;\n case 3:\n parsedUrl = optionsRef.current.fromSocketIO ?\n (0, socket_io_1.parseSocketIOUrl)(convertedUrl) :\n convertedUrl;\n parsedWithQueryParams = optionsRef.current.queryParams ?\n (0, socket_io_1.appendQueryParams)(parsedUrl, optionsRef.current.queryParams) :\n parsedUrl;\n return [2 /*return*/, parsedWithQueryParams];\n }\n });\n}); };\nexports.getUrl = getUrl;\n//# sourceMappingURL=get-url.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.websocketWrapper = void 0;\nvar websocketWrapper = function (webSocket, start) {\n return new Proxy(webSocket, {\n get: function (obj, key) {\n var val = obj[key];\n if (key === 'reconnect')\n return start;\n if (typeof val === 'function') {\n console.error('Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket.');\n //Prevent error thrown by invoking a non-function\n return function () { };\n }\n else {\n return val;\n }\n },\n set: function (obj, key, val) {\n if (/^on/.test(key)) {\n console.warn('The websocket\\'s event handlers should be defined through the options object passed into useWebSocket.');\n return false;\n }\n else {\n obj[key] = val;\n return true;\n }\n },\n });\n};\nexports.websocketWrapper = websocketWrapper;\nexports.default = exports.websocketWrapper;\n//# sourceMappingURL=proxy.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useWebSocket = void 0;\nvar react_1 = require(\"react\");\nvar react_dom_1 = require(\"react-dom\");\nvar constants_1 = require(\"./constants\");\nvar create_or_join_1 = require(\"./create-or-join\");\nvar get_url_1 = require(\"./get-url\");\nvar proxy_1 = __importDefault(require(\"./proxy\"));\nvar util_1 = require(\"./util\");\nvar useWebSocket = function (url, options, connect) {\n if (options === void 0) { options = constants_1.DEFAULT_OPTIONS; }\n if (connect === void 0) { connect = true; }\n var _a = (0, react_1.useState)(null), lastMessage = _a[0], setLastMessage = _a[1];\n var _b = (0, react_1.useState)({}), readyState = _b[0], setReadyState = _b[1];\n var lastJsonMessage = (0, react_1.useMemo)(function () {\n if (lastMessage) {\n try {\n return JSON.parse(lastMessage.data);\n }\n catch (e) {\n return constants_1.UNPARSABLE_JSON_OBJECT;\n }\n }\n return null;\n }, [lastMessage]);\n var convertedUrl = (0, react_1.useRef)(null);\n var webSocketRef = (0, react_1.useRef)(null);\n var startRef = (0, react_1.useRef)(function () { return void 0; });\n var reconnectCount = (0, react_1.useRef)(0);\n var messageQueue = (0, react_1.useRef)([]);\n var webSocketProxy = (0, react_1.useRef)(null);\n var optionsCache = (0, react_1.useRef)(options);\n optionsCache.current = options;\n var readyStateFromUrl = convertedUrl.current && readyState[convertedUrl.current] !== undefined ?\n readyState[convertedUrl.current] :\n url !== null && connect === true ?\n constants_1.ReadyState.CONNECTING :\n constants_1.ReadyState.UNINSTANTIATED;\n var stringifiedQueryParams = options.queryParams ? JSON.stringify(options.queryParams) : null;\n var sendMessage = (0, react_1.useCallback)(function (message, keep) {\n var _a;\n if (keep === void 0) { keep = true; }\n if (constants_1.isEventSourceSupported && webSocketRef.current instanceof EventSource) {\n console.warn('Unable to send a message from an eventSource');\n return;\n }\n if (((_a = webSocketRef.current) === null || _a === void 0 ? void 0 : _a.readyState) === constants_1.ReadyState.OPEN) {\n (0, util_1.assertIsWebSocket)(webSocketRef.current, optionsCache.current.skipAssert);\n webSocketRef.current.send(message);\n }\n else if (keep) {\n messageQueue.current.push(message);\n }\n }, []);\n var sendJsonMessage = (0, react_1.useCallback)(function (message, keep) {\n if (keep === void 0) { keep = true; }\n sendMessage(JSON.stringify(message), keep);\n }, [sendMessage]);\n var getWebSocket = (0, react_1.useCallback)(function () {\n if (optionsCache.current.share !== true || (constants_1.isEventSourceSupported && webSocketRef.current instanceof EventSource)) {\n return webSocketRef.current;\n }\n if (webSocketProxy.current === null && webSocketRef.current) {\n (0, util_1.assertIsWebSocket)(webSocketRef.current, optionsCache.current.skipAssert);\n webSocketProxy.current = (0, proxy_1.default)(webSocketRef.current, startRef);\n }\n return webSocketProxy.current;\n }, []);\n (0, react_1.useEffect)(function () {\n if (url !== null && connect === true) {\n var removeListeners_1;\n var expectClose_1 = false;\n var createOrJoin_1 = true;\n var start_1 = function () { return __awaiter(void 0, void 0, void 0, function () {\n var _a, protectedSetLastMessage, protectedSetReadyState;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = convertedUrl;\n return [4 /*yield*/, (0, get_url_1.getUrl)(url, optionsCache)];\n case 1:\n _a.current = _b.sent();\n protectedSetLastMessage = function (message) {\n if (!expectClose_1) {\n (0, react_dom_1.flushSync)(function () { return setLastMessage(message); });\n }\n };\n protectedSetReadyState = function (state) {\n if (!expectClose_1) {\n (0, react_dom_1.flushSync)(function () { return setReadyState(function (prev) {\n var _a;\n return (__assign(__assign({}, prev), (convertedUrl.current && (_a = {}, _a[convertedUrl.current] = state, _a))));\n }); });\n }\n };\n if (createOrJoin_1) {\n removeListeners_1 = (0, create_or_join_1.createOrJoinSocket)(webSocketRef, convertedUrl.current, protectedSetReadyState, optionsCache, protectedSetLastMessage, startRef, reconnectCount, sendMessage);\n }\n return [2 /*return*/];\n }\n });\n }); };\n startRef.current = function () {\n if (!expectClose_1) {\n if (webSocketProxy.current)\n webSocketProxy.current = null;\n removeListeners_1 === null || removeListeners_1 === void 0 ? void 0 : removeListeners_1();\n start_1();\n }\n };\n start_1();\n return function () {\n expectClose_1 = true;\n createOrJoin_1 = false;\n if (webSocketProxy.current)\n webSocketProxy.current = null;\n removeListeners_1 === null || removeListeners_1 === void 0 ? void 0 : removeListeners_1();\n setLastMessage(null);\n };\n }\n else if (url === null || connect === false) {\n reconnectCount.current = 0; // reset reconnection attempts\n setReadyState(function (prev) {\n var _a;\n return (__assign(__assign({}, prev), (convertedUrl.current && (_a = {}, _a[convertedUrl.current] = constants_1.ReadyState.CLOSED, _a))));\n });\n }\n }, [url, connect, stringifiedQueryParams, sendMessage]);\n (0, react_1.useEffect)(function () {\n if (readyStateFromUrl === constants_1.ReadyState.OPEN) {\n messageQueue.current.splice(0).forEach(function (message) {\n sendMessage(message);\n });\n }\n }, [readyStateFromUrl]);\n return {\n sendMessage: sendMessage,\n sendJsonMessage: sendJsonMessage,\n lastMessage: lastMessage,\n lastJsonMessage: lastJsonMessage,\n readyState: readyStateFromUrl,\n getWebSocket: getWebSocket,\n };\n};\nexports.useWebSocket = useWebSocket;\n//# sourceMappingURL=use-websocket.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useSocketIO = void 0;\nvar react_1 = require(\"react\");\nvar use_websocket_1 = require(\"./use-websocket\");\nvar constants_1 = require(\"./constants\");\nvar emptyEvent = {\n type: 'empty',\n payload: null,\n};\nvar getSocketData = function (event) {\n if (!event || !event.data) {\n return emptyEvent;\n }\n var match = event.data.match(/\\[.*]/);\n if (!match) {\n return emptyEvent;\n }\n var data = JSON.parse(match);\n if (!Array.isArray(data) || !data[1]) {\n return emptyEvent;\n }\n return {\n type: data[0],\n payload: data[1],\n };\n};\nvar useSocketIO = function (url, options, connect) {\n if (options === void 0) { options = constants_1.DEFAULT_OPTIONS; }\n if (connect === void 0) { connect = true; }\n var optionsWithSocketIO = (0, react_1.useMemo)(function () { return (__assign(__assign({}, options), { fromSocketIO: true })); }, []);\n var _a = (0, use_websocket_1.useWebSocket)(url, optionsWithSocketIO, connect), sendMessage = _a.sendMessage, sendJsonMessage = _a.sendJsonMessage, lastMessage = _a.lastMessage, readyState = _a.readyState, getWebSocket = _a.getWebSocket;\n var socketIOLastMessage = (0, react_1.useMemo)(function () {\n return getSocketData(lastMessage);\n }, [lastMessage]);\n return {\n sendMessage: sendMessage,\n sendJsonMessage: sendJsonMessage,\n lastMessage: socketIOLastMessage,\n lastJsonMessage: socketIOLastMessage,\n readyState: readyState,\n getWebSocket: getWebSocket,\n };\n};\nexports.useSocketIO = useSocketIO;\n//# sourceMappingURL=use-socket-io.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useEventSource = void 0;\nvar react_1 = require(\"react\");\nvar use_websocket_1 = require(\"./use-websocket\");\nvar constants_1 = require(\"./constants\");\nvar useEventSource = function (url, _a, connect) {\n if (_a === void 0) { _a = constants_1.DEFAULT_EVENT_SOURCE_OPTIONS; }\n var withCredentials = _a.withCredentials, events = _a.events, options = __rest(_a, [\"withCredentials\", \"events\"]);\n if (connect === void 0) { connect = true; }\n var optionsWithEventSource = __assign(__assign({}, options), { eventSourceOptions: {\n withCredentials: withCredentials,\n } });\n var eventsRef = (0, react_1.useRef)(constants_1.EMPTY_EVENT_HANDLERS);\n if (events) {\n eventsRef.current = events;\n }\n var _b = (0, use_websocket_1.useWebSocket)(url, optionsWithEventSource, connect), lastMessage = _b.lastMessage, readyState = _b.readyState, getWebSocket = _b.getWebSocket;\n (0, react_1.useEffect)(function () {\n if (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.type) {\n Object.entries(eventsRef.current).forEach(function (_a) {\n var type = _a[0], handler = _a[1];\n if (type === lastMessage.type) {\n handler(lastMessage);\n }\n });\n }\n }, [lastMessage]);\n return {\n lastEvent: lastMessage,\n readyState: readyState,\n getEventSource: getWebSocket,\n };\n};\nexports.useEventSource = useEventSource;\n//# sourceMappingURL=use-event-source.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resetGlobalState = exports.useEventSource = exports.ReadyState = exports.useSocketIO = exports.default = void 0;\nvar use_websocket_1 = require(\"./lib/use-websocket\");\nObject.defineProperty(exports, \"default\", { enumerable: true, get: function () { return use_websocket_1.useWebSocket; } });\nvar use_socket_io_1 = require(\"./lib/use-socket-io\");\nObject.defineProperty(exports, \"useSocketIO\", { enumerable: true, get: function () { return use_socket_io_1.useSocketIO; } });\nvar constants_1 = require(\"./lib/constants\");\nObject.defineProperty(exports, \"ReadyState\", { enumerable: true, get: function () { return constants_1.ReadyState; } });\nvar use_event_source_1 = require(\"./lib/use-event-source\");\nObject.defineProperty(exports, \"useEventSource\", { enumerable: true, get: function () { return use_event_source_1.useEventSource; } });\nvar util_1 = require(\"./lib/util\");\nObject.defineProperty(exports, \"resetGlobalState\", { enumerable: true, get: function () { return util_1.resetGlobalState; } });\n//# sourceMappingURL=index.js.map","/*! store2 - v2.14.3 - 2024-02-14\n* Copyright (c) 2024 Nathan Bubna; Licensed MIT */\n;(function(window, define) {\n var _ = {\n version: \"2.14.3\",\n areas: {},\n apis: {},\n nsdelim: '.',\n\n // utilities\n inherit: function(api, o) {\n for (var p in api) {\n if (!o.hasOwnProperty(p)) {\n Object.defineProperty(o, p, Object.getOwnPropertyDescriptor(api, p));\n }\n }\n return o;\n },\n stringify: function(d, fn) {\n return d === undefined || typeof d === \"function\" ? d+'' : JSON.stringify(d,fn||_.replace);\n },\n parse: function(s, fn) {\n // if it doesn't parse, return as is\n try{ return JSON.parse(s,fn||_.revive); }catch(e){ return s; }\n },\n\n // extension hooks\n fn: function(name, fn) {\n _.storeAPI[name] = fn;\n for (var api in _.apis) {\n _.apis[api][name] = fn;\n }\n },\n get: function(area, key){ return area.getItem(key); },\n set: function(area, key, string){ area.setItem(key, string); },\n remove: function(area, key){ area.removeItem(key); },\n key: function(area, i){ return area.key(i); },\n length: function(area){ return area.length; },\n clear: function(area){ area.clear(); },\n\n // core functions\n Store: function(id, area, namespace) {\n var store = _.inherit(_.storeAPI, function(key, data, overwrite) {\n if (arguments.length === 0){ return store.getAll(); }\n if (typeof data === \"function\"){ return store.transact(key, data, overwrite); }// fn=data, alt=overwrite\n if (data !== undefined){ return store.set(key, data, overwrite); }\n if (typeof key === \"string\" || typeof key === \"number\"){ return store.get(key); }\n if (typeof key === \"function\"){ return store.each(key); }\n if (!key){ return store.clear(); }\n return store.setAll(key, data);// overwrite=data, data=key\n });\n store._id = id;\n try {\n var testKey = '__store2_test';\n area.setItem(testKey, 'ok');\n store._area = area;\n area.removeItem(testKey);\n } catch (e) {\n store._area = _.storage('fake');\n }\n store._ns = namespace || '';\n if (!_.areas[id]) {\n _.areas[id] = store._area;\n }\n if (!_.apis[store._ns+store._id]) {\n _.apis[store._ns+store._id] = store;\n }\n return store;\n },\n storeAPI: {\n // admin functions\n area: function(id, area) {\n var store = this[id];\n if (!store || !store.area) {\n store = _.Store(id, area, this._ns);//new area-specific api in this namespace\n if (!this[id]){ this[id] = store; }\n }\n return store;\n },\n namespace: function(namespace, singleArea, delim) {\n delim = delim || this._delim || _.nsdelim;\n if (!namespace){\n return this._ns ? this._ns.substring(0,this._ns.length-delim.length) : '';\n }\n var ns = namespace, store = this[ns];\n if (!store || !store.namespace) {\n store = _.Store(this._id, this._area, this._ns+ns+delim);//new namespaced api\n store._delim = delim;\n if (!this[ns]){ this[ns] = store; }\n if (!singleArea) {\n for (var name in _.areas) {\n store.area(name, _.areas[name]);\n }\n }\n }\n return store;\n },\n isFake: function(force) {\n if (force) {\n this._real = this._area;\n this._area = _.storage('fake');\n } else if (force === false) {\n this._area = this._real || this._area;\n }\n return this._area.name === 'fake';\n },\n toString: function() {\n return 'store'+(this._ns?'.'+this.namespace():'')+'['+this._id+']';\n },\n\n // storage functions\n has: function(key) {\n if (this._area.has) {\n return this._area.has(this._in(key));//extension hook\n }\n return !!(this._in(key) in this._area);\n },\n size: function(){ return this.keys().length; },\n each: function(fn, fill) {// fill is used by keys(fillList) and getAll(fillList))\n for (var i=0, m=_.length(this._area); i _.length(this._area)) { m--; i--; }// in case of removeItem\n }\n return fill || this;\n },\n keys: function(fillList) {\n return this.each(function(k, v, list){ list.push(k); }, fillList || []);\n },\n get: function(key, alt) {\n var s = _.get(this._area, this._in(key)),\n fn;\n if (typeof alt === \"function\") {\n fn = alt;\n alt = null;\n }\n return s !== null ? _.parse(s, fn) :\n alt != null ? alt : s;\n },\n getAll: function(fillObj) {\n return this.each(function(k, v, all){ all[k] = v; }, fillObj || {});\n },\n transact: function(key, fn, alt) {\n var val = this.get(key, alt),\n ret = fn(val);\n this.set(key, ret === undefined ? val : ret);\n return this;\n },\n set: function(key, data, overwrite) {\n var d = this.get(key),\n replacer;\n if (d != null && overwrite === false) {\n return data;\n }\n if (typeof overwrite === \"function\") {\n replacer = overwrite;\n overwrite = undefined;\n }\n return _.set(this._area, this._in(key), _.stringify(data, replacer), overwrite) || d;\n },\n setAll: function(data, overwrite) {\n var changed, val;\n for (var key in data) {\n val = data[key];\n if (this.set(key, val, overwrite) !== val) {\n changed = true;\n }\n }\n return changed;\n },\n add: function(key, data, replacer) {\n var d = this.get(key);\n if (d instanceof Array) {\n data = d.concat(data);\n } else if (d !== null) {\n var type = typeof d;\n if (type === typeof data && type === 'object') {\n for (var k in data) {\n d[k] = data[k];\n }\n data = d;\n } else {\n data = d + data;\n }\n }\n _.set(this._area, this._in(key), _.stringify(data, replacer));\n return data;\n },\n remove: function(key, alt) {\n var d = this.get(key, alt);\n _.remove(this._area, this._in(key));\n return d;\n },\n clear: function() {\n if (!this._ns) {\n _.clear(this._area);\n } else {\n this.each(function(k){ _.remove(this._area, this._in(k)); }, 1);\n }\n return this;\n },\n clearAll: function() {\n var area = this._area;\n for (var id in _.areas) {\n if (_.areas.hasOwnProperty(id)) {\n this._area = _.areas[id];\n this.clear();\n }\n }\n this._area = area;\n return this;\n },\n\n // internal use functions\n _in: function(k) {\n if (typeof k !== \"string\"){ k = _.stringify(k); }\n return this._ns ? this._ns + k : k;\n },\n _out: function(k) {\n return this._ns ?\n k && k.indexOf(this._ns) === 0 ?\n k.substring(this._ns.length) :\n undefined : // so each() knows to skip it\n k;\n }\n },// end _.storeAPI\n storage: function(name) {\n return _.inherit(_.storageAPI, { items: {}, name: name });\n },\n storageAPI: {\n length: 0,\n has: function(k){ return this.items.hasOwnProperty(k); },\n key: function(i) {\n var c = 0;\n for (var k in this.items){\n if (this.has(k) && i === c++) {\n return k;\n }\n }\n },\n setItem: function(k, v) {\n if (!this.has(k)) {\n this.length++;\n }\n this.items[k] = v;\n },\n removeItem: function(k) {\n if (this.has(k)) {\n delete this.items[k];\n this.length--;\n }\n },\n getItem: function(k){ return this.has(k) ? this.items[k] : null; },\n clear: function(){ for (var k in this.items){ this.removeItem(k); } }\n }// end _.storageAPI\n };\n\n var store =\n // safely set this up (throws error in IE10/32bit mode for local files)\n _.Store(\"local\", (function(){try{ return localStorage; }catch(e){}})());\n store.local = store;// for completeness\n store._ = _;// for extenders and debuggers...\n // safely setup store.session (throws exception in FF for file:/// urls)\n store.area(\"session\", (function(){try{ return sessionStorage; }catch(e){}})());\n store.area(\"page\", _.storage(\"page\"));\n\n if (typeof define === 'function' && define.amd !== undefined) {\n define('store2', [], function () {\n return store;\n });\n } else if (typeof module !== 'undefined' && module.exports) {\n module.exports = store;\n } else {\n // expose the primary store fn to the global object and save conflicts\n if (window.store){ _.conflict = window.store; }\n window.store = store;\n }\n\n})(this, this && this.define);\n","import { createContext } from 'react';\n/**\n * Create the React Context\n */ export const DndContext = createContext({\n dragDropManager: undefined\n});\n\n//# sourceMappingURL=DndContext.js.map","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nexport default function _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\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","/**\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 */ export function invariant(condition, format, ...args) {\n if (isProduction()) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n if (!condition) {\n let error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n let argIndex = 0;\n error = new Error(format.replace(/%s/g, function() {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n error.framesToPop = 1 // we don't care about invariant's own frame\n ;\n throw error;\n }\n}\nfunction isProduction() {\n return typeof process !== 'undefined' && process.env['NODE_ENV'] === 'production';\n}\n\n//# sourceMappingURL=index.js.map","// cheap lodash replacements\n/**\n * drop-in replacement for _.get\n * @param obj\n * @param path\n * @param defaultValue\n */ export function get(obj, path, defaultValue) {\n return path.split('.').reduce((a, c)=>a && a[c] ? a[c] : defaultValue || null\n , obj);\n}\n/**\n * drop-in replacement for _.without\n */ export function without(items, item) {\n return items.filter((i)=>i !== item\n );\n}\n/**\n * drop-in replacement for _.isString\n * @param input\n */ export function isString(input) {\n return typeof input === 'string';\n}\n/**\n * drop-in replacement for _.isString\n * @param input\n */ export function isObject(input) {\n return typeof input === 'object';\n}\n/**\n * replacement for _.xor\n * @param itemsA\n * @param itemsB\n */ export function xor(itemsA, itemsB) {\n const map = new Map();\n const insertItem = (item)=>{\n map.set(item, map.has(item) ? map.get(item) + 1 : 1);\n };\n itemsA.forEach(insertItem);\n itemsB.forEach(insertItem);\n const result = [];\n map.forEach((count, key)=>{\n if (count === 1) {\n result.push(key);\n }\n });\n return result;\n}\n/**\n * replacement for _.intersection\n * @param itemsA\n * @param itemsB\n */ export function intersection(itemsA, itemsB) {\n return itemsA.filter((t)=>itemsB.indexOf(t) > -1\n );\n}\n\n//# sourceMappingURL=js_utils.js.map","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\n//# sourceMappingURL=types.js.map","import { INIT_COORDS } from '../types.js';\nexport function setClientOffset(clientOffset, sourceClientOffset) {\n return {\n type: INIT_COORDS,\n payload: {\n sourceClientOffset: sourceClientOffset || null,\n clientOffset: clientOffset || null\n }\n };\n}\n\n//# sourceMappingURL=setClientOffset.js.map","import { invariant } from '@react-dnd/invariant';\nimport { isObject } from '../../utils/js_utils.js';\nimport { setClientOffset } from './local/setClientOffset.js';\nimport { BEGIN_DRAG, INIT_COORDS } from './types.js';\nconst ResetCoordinatesAction = {\n type: INIT_COORDS,\n payload: {\n clientOffset: null,\n sourceClientOffset: null\n }\n};\nexport function createBeginDrag(manager) {\n return function beginDrag(sourceIds = [], options = {\n publishSource: true\n }) {\n const { publishSource =true , clientOffset , getSourceClientOffset , } = options;\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry();\n // Initialize the coordinates using the client offset\n manager.dispatch(setClientOffset(clientOffset));\n verifyInvariants(sourceIds, monitor, registry);\n // Get the draggable source\n const sourceId = getDraggableSource(sourceIds, monitor);\n if (sourceId == null) {\n manager.dispatch(ResetCoordinatesAction);\n return;\n }\n // Get the source client offset\n let sourceClientOffset = null;\n if (clientOffset) {\n if (!getSourceClientOffset) {\n throw new Error('getSourceClientOffset must be defined');\n }\n verifyGetSourceClientOffsetIsFunction(getSourceClientOffset);\n sourceClientOffset = getSourceClientOffset(sourceId);\n }\n // Initialize the full coordinates\n manager.dispatch(setClientOffset(clientOffset, sourceClientOffset));\n const source = registry.getSource(sourceId);\n const item = source.beginDrag(monitor, sourceId);\n // If source.beginDrag returns null, this is an indicator to cancel the drag\n if (item == null) {\n return undefined;\n }\n verifyItemIsObject(item);\n registry.pinSource(sourceId);\n const itemType = registry.getSourceType(sourceId);\n return {\n type: BEGIN_DRAG,\n payload: {\n itemType,\n item,\n sourceId,\n clientOffset: clientOffset || null,\n sourceClientOffset: sourceClientOffset || null,\n isSourcePublic: !!publishSource\n }\n };\n };\n}\nfunction verifyInvariants(sourceIds, monitor, registry) {\n invariant(!monitor.isDragging(), 'Cannot call beginDrag while dragging.');\n sourceIds.forEach(function(sourceId) {\n invariant(registry.getSource(sourceId), 'Expected sourceIds to be registered.');\n });\n}\nfunction verifyGetSourceClientOffsetIsFunction(getSourceClientOffset) {\n invariant(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.');\n}\nfunction verifyItemIsObject(item) {\n invariant(isObject(item), 'Item must be an object.');\n}\nfunction getDraggableSource(sourceIds, monitor) {\n let sourceId = null;\n for(let i = sourceIds.length - 1; i >= 0; i--){\n if (monitor.canDragSource(sourceIds[i])) {\n sourceId = sourceIds[i];\n break;\n }\n }\n return sourceId;\n}\n\n//# sourceMappingURL=beginDrag.js.map","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _objectSpread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n}\nimport { invariant } from '@react-dnd/invariant';\nimport { isObject } from '../../utils/js_utils.js';\nimport { DROP } from './types.js';\nexport function createDrop(manager) {\n return function drop(options = {}) {\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry();\n verifyInvariants(monitor);\n const targetIds = getDroppableTargets(monitor);\n // Multiple actions are dispatched here, which is why this doesn't return an action\n targetIds.forEach((targetId, index)=>{\n const dropResult = determineDropResult(targetId, index, registry, monitor);\n const action = {\n type: DROP,\n payload: {\n dropResult: _objectSpread({}, options, dropResult)\n }\n };\n manager.dispatch(action);\n });\n };\n}\nfunction verifyInvariants(monitor) {\n invariant(monitor.isDragging(), 'Cannot call drop while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.');\n}\nfunction determineDropResult(targetId, index, registry, monitor) {\n const target = registry.getTarget(targetId);\n let dropResult = target ? target.drop(monitor, targetId) : undefined;\n verifyDropResultType(dropResult);\n if (typeof dropResult === 'undefined') {\n dropResult = index === 0 ? {} : monitor.getDropResult();\n }\n return dropResult;\n}\nfunction verifyDropResultType(dropResult) {\n invariant(typeof dropResult === 'undefined' || isObject(dropResult), 'Drop result must either be an object or undefined.');\n}\nfunction getDroppableTargets(monitor) {\n const targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor);\n targetIds.reverse();\n return targetIds;\n}\n\n//# sourceMappingURL=drop.js.map","import { invariant } from '@react-dnd/invariant';\nimport { END_DRAG } from './types.js';\nexport function createEndDrag(manager) {\n return function endDrag() {\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry();\n verifyIsDragging(monitor);\n const sourceId = monitor.getSourceId();\n if (sourceId != null) {\n const source = registry.getSource(sourceId, true);\n source.endDrag(monitor, sourceId);\n registry.unpinSource();\n }\n return {\n type: END_DRAG\n };\n };\n}\nfunction verifyIsDragging(monitor) {\n invariant(monitor.isDragging(), 'Cannot call endDrag while not dragging.');\n}\n\n//# sourceMappingURL=endDrag.js.map","export function matchesType(targetType, draggedItemType) {\n if (draggedItemType === null) {\n return targetType === null;\n }\n return Array.isArray(targetType) ? targetType.some((t)=>t === draggedItemType\n ) : targetType === draggedItemType;\n}\n\n//# sourceMappingURL=matchesType.js.map","import { invariant } from '@react-dnd/invariant';\nimport { matchesType } from '../../utils/matchesType.js';\nimport { HOVER } from './types.js';\nexport function createHover(manager) {\n return function hover(targetIdsArg, { clientOffset } = {}) {\n verifyTargetIdsIsArray(targetIdsArg);\n const targetIds = targetIdsArg.slice(0);\n const monitor = manager.getMonitor();\n const registry = manager.getRegistry();\n const draggedItemType = monitor.getItemType();\n removeNonMatchingTargetIds(targetIds, registry, draggedItemType);\n checkInvariants(targetIds, monitor, registry);\n hoverAllTargets(targetIds, monitor, registry);\n return {\n type: HOVER,\n payload: {\n targetIds,\n clientOffset: clientOffset || null\n }\n };\n };\n}\nfunction verifyTargetIdsIsArray(targetIdsArg) {\n invariant(Array.isArray(targetIdsArg), 'Expected targetIds to be an array.');\n}\nfunction checkInvariants(targetIds, monitor, registry) {\n invariant(monitor.isDragging(), 'Cannot call hover while not dragging.');\n invariant(!monitor.didDrop(), 'Cannot call hover after drop.');\n for(let i = 0; i < targetIds.length; i++){\n const targetId = targetIds[i];\n invariant(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.');\n const target = registry.getTarget(targetId);\n invariant(target, 'Expected targetIds to be registered.');\n }\n}\nfunction removeNonMatchingTargetIds(targetIds, registry, draggedItemType) {\n // Remove those targetIds that don't match the targetType. This\n // fixes shallow isOver which would only be non-shallow because of\n // non-matching targets.\n for(let i = targetIds.length - 1; i >= 0; i--){\n const targetId = targetIds[i];\n const targetType = registry.getTargetType(targetId);\n if (!matchesType(targetType, draggedItemType)) {\n targetIds.splice(i, 1);\n }\n }\n}\nfunction hoverAllTargets(targetIds, monitor, registry) {\n // Finally call hover on all matching targets.\n targetIds.forEach(function(targetId) {\n const target = registry.getTarget(targetId);\n target.hover(monitor, targetId);\n });\n}\n\n//# sourceMappingURL=hover.js.map","import { PUBLISH_DRAG_SOURCE } from './types.js';\nexport function createPublishDragSource(manager) {\n return function publishDragSource() {\n const monitor = manager.getMonitor();\n if (monitor.isDragging()) {\n return {\n type: PUBLISH_DRAG_SOURCE\n };\n }\n return;\n };\n}\n\n//# sourceMappingURL=publishDragSource.js.map","import { createBeginDrag } from './beginDrag.js';\nimport { createDrop } from './drop.js';\nimport { createEndDrag } from './endDrag.js';\nimport { createHover } from './hover.js';\nimport { createPublishDragSource } from './publishDragSource.js';\nexport * from './types.js';\nexport function createDragDropActions(manager) {\n return {\n beginDrag: createBeginDrag(manager),\n publishDragSource: createPublishDragSource(manager),\n hover: createHover(manager),\n drop: createDrop(manager),\n endDrag: createEndDrag(manager)\n };\n}\n\n//# sourceMappingURL=index.js.map","import { createDragDropActions } from '../actions/dragDrop/index.js';\nexport class DragDropManagerImpl {\n receiveBackend(backend) {\n this.backend = backend;\n }\n getMonitor() {\n return this.monitor;\n }\n getBackend() {\n return this.backend;\n }\n getRegistry() {\n return this.monitor.registry;\n }\n getActions() {\n /* eslint-disable-next-line @typescript-eslint/no-this-alias */ const manager = this;\n const { dispatch } = this.store;\n function bindActionCreator(actionCreator) {\n return (...args)=>{\n const action = actionCreator.apply(manager, args);\n if (typeof action !== 'undefined') {\n dispatch(action);\n }\n };\n }\n const actions = createDragDropActions(this);\n return Object.keys(actions).reduce((boundActions, key)=>{\n const action = actions[key];\n boundActions[key] = bindActionCreator(action);\n return boundActions;\n }, {});\n }\n dispatch(action) {\n this.store.dispatch(action);\n }\n constructor(store, monitor){\n this.isSetUp = false;\n this.handleRefCountChange = ()=>{\n const shouldSetUp = this.store.getState().refCount > 0;\n if (this.backend) {\n if (shouldSetUp && !this.isSetUp) {\n this.backend.setup();\n this.isSetUp = true;\n } else if (!shouldSetUp && this.isSetUp) {\n this.backend.teardown();\n this.isSetUp = false;\n }\n }\n };\n this.store = store;\n this.monitor = monitor;\n store.subscribe(this.handleRefCountChange);\n }\n}\n\n//# sourceMappingURL=DragDropManagerImpl.js.map","/**\n * Coordinate addition\n * @param a The first coordinate\n * @param b The second coordinate\n */ export function add(a, b) {\n return {\n x: a.x + b.x,\n y: a.y + b.y\n };\n}\n/**\n * Coordinate subtraction\n * @param a The first coordinate\n * @param b The second coordinate\n */ export function subtract(a, b) {\n return {\n x: a.x - b.x,\n y: a.y - b.y\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 */ export function getSourceClientOffset(state) {\n const { clientOffset , initialClientOffset , initialSourceClientOffset } = state;\n if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {\n return null;\n }\n return subtract(add(clientOffset, initialSourceClientOffset), initialClientOffset);\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 */ export function getDifferenceFromInitialOffset(state) {\n const { clientOffset , initialClientOffset } = state;\n if (!clientOffset || !initialClientOffset) {\n return null;\n }\n return subtract(clientOffset, initialClientOffset);\n}\n\n//# sourceMappingURL=coords.js.map","import { intersection } from './js_utils.js';\nexport const NONE = [];\nexport const ALL = [];\nNONE.__IS_NONE__ = true;\nALL.__IS_ALL__ = true;\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 */ export function areDirty(dirtyIds, handlerIds) {\n if (dirtyIds === NONE) {\n return false;\n }\n if (dirtyIds === ALL || typeof handlerIds === 'undefined') {\n return true;\n }\n const commonIds = intersection(handlerIds, dirtyIds);\n return commonIds.length > 0;\n}\n\n//# sourceMappingURL=dirtiness.js.map","import { invariant } from '@react-dnd/invariant';\nimport { getDifferenceFromInitialOffset, getSourceClientOffset } from '../utils/coords.js';\nimport { areDirty } from '../utils/dirtiness.js';\nimport { matchesType } from '../utils/matchesType.js';\nexport class DragDropMonitorImpl {\n subscribeToStateChange(listener, options = {}) {\n const { handlerIds } = options;\n invariant(typeof listener === 'function', 'listener must be a function.');\n invariant(typeof handlerIds === 'undefined' || Array.isArray(handlerIds), 'handlerIds, when specified, must be an array of strings.');\n let prevStateId = this.store.getState().stateId;\n const handleChange = ()=>{\n const state = this.store.getState();\n const currentStateId = state.stateId;\n try {\n const canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !areDirty(state.dirtyHandlerIds, handlerIds);\n if (!canSkipListener) {\n listener();\n }\n } finally{\n prevStateId = currentStateId;\n }\n };\n return this.store.subscribe(handleChange);\n }\n subscribeToOffsetChange(listener) {\n invariant(typeof listener === 'function', 'listener must be a function.');\n let previousState = this.store.getState().dragOffset;\n const handleChange = ()=>{\n const nextState = this.store.getState().dragOffset;\n if (nextState === previousState) {\n return;\n }\n previousState = nextState;\n listener();\n };\n return this.store.subscribe(handleChange);\n }\n canDragSource(sourceId) {\n if (!sourceId) {\n return false;\n }\n const source = this.registry.getSource(sourceId);\n invariant(source, `Expected to find a valid source. sourceId=${sourceId}`);\n if (this.isDragging()) {\n return false;\n }\n return source.canDrag(this, sourceId);\n }\n canDropOnTarget(targetId) {\n // undefined on initial render\n if (!targetId) {\n return false;\n }\n const target = this.registry.getTarget(targetId);\n invariant(target, `Expected to find a valid target. targetId=${targetId}`);\n if (!this.isDragging() || this.didDrop()) {\n return false;\n }\n const targetType = this.registry.getTargetType(targetId);\n const draggedItemType = this.getItemType();\n return matchesType(targetType, draggedItemType) && target.canDrop(this, targetId);\n }\n isDragging() {\n return Boolean(this.getItemType());\n }\n isDraggingSource(sourceId) {\n // undefined on initial render\n if (!sourceId) {\n return false;\n }\n const source = this.registry.getSource(sourceId, true);\n invariant(source, `Expected to find a valid source. sourceId=${sourceId}`);\n if (!this.isDragging() || !this.isSourcePublic()) {\n return false;\n }\n const sourceType = this.registry.getSourceType(sourceId);\n const draggedItemType = this.getItemType();\n if (sourceType !== draggedItemType) {\n return false;\n }\n return source.isDragging(this, sourceId);\n }\n isOverTarget(targetId, options = {\n shallow: false\n }) {\n // undefined on initial render\n if (!targetId) {\n return false;\n }\n const { shallow } = options;\n if (!this.isDragging()) {\n return false;\n }\n const targetType = this.registry.getTargetType(targetId);\n const draggedItemType = this.getItemType();\n if (draggedItemType && !matchesType(targetType, draggedItemType)) {\n return false;\n }\n const targetIds = this.getTargetIds();\n if (!targetIds.length) {\n return false;\n }\n const index = targetIds.indexOf(targetId);\n if (shallow) {\n return index === targetIds.length - 1;\n } else {\n return index > -1;\n }\n }\n getItemType() {\n return this.store.getState().dragOperation.itemType;\n }\n getItem() {\n return this.store.getState().dragOperation.item;\n }\n getSourceId() {\n return this.store.getState().dragOperation.sourceId;\n }\n getTargetIds() {\n return this.store.getState().dragOperation.targetIds;\n }\n getDropResult() {\n return this.store.getState().dragOperation.dropResult;\n }\n didDrop() {\n return this.store.getState().dragOperation.didDrop;\n }\n isSourcePublic() {\n return Boolean(this.store.getState().dragOperation.isSourcePublic);\n }\n getInitialClientOffset() {\n return this.store.getState().dragOffset.initialClientOffset;\n }\n getInitialSourceClientOffset() {\n return this.store.getState().dragOffset.initialSourceClientOffset;\n }\n getClientOffset() {\n return this.store.getState().dragOffset.clientOffset;\n }\n getSourceClientOffset() {\n return getSourceClientOffset(this.store.getState().dragOffset);\n }\n getDifferenceFromInitialOffset() {\n return getDifferenceFromInitialOffset(this.store.getState().dragOffset);\n }\n constructor(store, registry){\n this.store = store;\n this.registry = registry;\n }\n}\n\n//# sourceMappingURL=DragDropMonitorImpl.js.map","// 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/* globals self */ const scope = typeof global !== 'undefined' ? global : self;\nconst BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;\nexport function makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n const timeoutHandle = setTimeout(handleTimer, 0);\n // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n const intervalHandle = setInterval(handleTimer, 50);\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\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) {\n let toggle = 1;\n const observer = new BrowserMutationObserver(callback);\n const node = document.createTextNode('');\n observer.observe(node, {\n characterData: true\n });\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n}\nexport const makeRequestCall = typeof BrowserMutationObserver === 'function' ? // reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nmakeRequestCallFromMutationObserver : // task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser's renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\nmakeRequestCallFromTimer;\n\n//# sourceMappingURL=makeRequestCall.js.map","/* eslint-disable no-restricted-globals, @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-non-null-assertion */ import { makeRequestCall, makeRequestCallFromTimer } from './makeRequestCall.js';\nexport class AsapQueue {\n // Use the fastest means possible to execute a task in its own turn, with\n // priority over other events including IO, animation, reflow, and redraw\n // events in browsers.\n //\n // An exception thrown by a task will permanently interrupt the processing of\n // subsequent tasks. The higher level `asap` function ensures that if an\n // exception is thrown by a task, that the task queue will continue flushing as\n // soon as possible, but if you use `rawAsap` directly, you are responsible to\n // either ensure that no exceptions are thrown from your task, or to manually\n // call `rawAsap.requestFlush` if an exception is thrown.\n enqueueTask(task) {\n const { queue: q , requestFlush } = this;\n if (!q.length) {\n requestFlush();\n this.flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n q[q.length] = task;\n }\n constructor(){\n this.queue = [];\n // We queue errors to ensure they are thrown in right order (FIFO).\n // Array-as-queue is good enough here, since we are just dealing with exceptions.\n this.pendingErrors = [];\n // Once a flush has been requested, no further calls to `requestFlush` are\n // necessary until the next `flush` completes.\n // @ts-ignore\n this.flushing = false;\n // The position of the next task to execute in the task queue. This is\n // preserved between calls to `flush` so that it can be resumed if\n // a task throws an exception.\n this.index = 0;\n // If a task schedules additional tasks recursively, the task queue can grow\n // unbounded. To prevent memory exhaustion, the task queue will periodically\n // truncate already-completed tasks.\n this.capacity = 1024;\n // The flush function processes all tasks that have been scheduled with\n // `rawAsap` unless and until one of those tasks throws an exception.\n // If a task throws an exception, `flush` ensures that its state will remain\n // consistent and will resume where it left off when called again.\n // However, `flush` does not make any arrangements to be called again if an\n // exception is thrown.\n this.flush = ()=>{\n const { queue: q } = this;\n while(this.index < q.length){\n const currentIndex = this.index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n this.index++;\n q[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (this.index > this.capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for(let scan = 0, newLength = q.length - this.index; scan < newLength; scan++){\n q[scan] = q[scan + this.index];\n }\n q.length -= this.index;\n this.index = 0;\n }\n }\n q.length = 0;\n this.index = 0;\n this.flushing = false;\n };\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n this.registerPendingError = (err)=>{\n this.pendingErrors.push(err);\n this.requestErrorThrow();\n };\n // `requestFlush` requests that the high priority event queue be flushed as\n // soon as possible.\n // This is useful to prevent an error thrown in a task from stalling the event\n // queue if the exception handled by Node.js’s\n // `process.on(\"uncaughtException\")` or by a domain.\n // `requestFlush` is implemented using a strategy based on data collected from\n // every available SauceLabs Selenium web driver worker at time of writing.\n // https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n this.requestFlush = makeRequestCall(this.flush);\n this.requestErrorThrow = makeRequestCallFromTimer(()=>{\n // Throw first error\n if (this.pendingErrors.length) {\n throw this.pendingErrors.shift();\n }\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 // 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 // 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 // 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 // function makeRequestCallFromSetImmediate(callback) {\n // return function requestCall() {\n // setImmediate(callback);\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 // `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 // 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 // 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\n//# sourceMappingURL=AsapQueue.js.map","// `call`, just like a function.\nexport class RawTask {\n call() {\n try {\n this.task && this.task();\n } catch (error) {\n this.onError(error);\n } finally{\n this.task = null;\n this.release(this);\n }\n }\n constructor(onError, release){\n this.onError = onError;\n this.release = release;\n this.task = null;\n }\n}\n\n//# sourceMappingURL=RawTask.js.map","import { RawTask } from './RawTask.js';\nexport class TaskFactory {\n create(task) {\n const tasks = this.freeTasks;\n const t1 = tasks.length ? tasks.pop() : new RawTask(this.onError, (t)=>tasks[tasks.length] = t\n );\n t1.task = task;\n return t1;\n }\n constructor(onError){\n this.onError = onError;\n this.freeTasks = [];\n }\n}\n\n//# sourceMappingURL=TaskFactory.js.map","import { AsapQueue } from './AsapQueue.js';\nimport { TaskFactory } from './TaskFactory.js';\nconst asapQueue = new AsapQueue();\nconst taskFactory = new TaskFactory(asapQueue.registerPendingError);\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 */ export function asap(task) {\n asapQueue.enqueueTask(taskFactory.create(task));\n}\n\n//# sourceMappingURL=asap.js.map","export 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';\nexport function addSource(sourceId) {\n return {\n type: ADD_SOURCE,\n payload: {\n sourceId\n }\n };\n}\nexport function addTarget(targetId) {\n return {\n type: ADD_TARGET,\n payload: {\n targetId\n }\n };\n}\nexport function removeSource(sourceId) {\n return {\n type: REMOVE_SOURCE,\n payload: {\n sourceId\n }\n };\n}\nexport function removeTarget(targetId) {\n return {\n type: REMOVE_TARGET,\n payload: {\n targetId\n }\n };\n}\n\n//# sourceMappingURL=registry.js.map","import { invariant } from '@react-dnd/invariant';\nexport function validateSourceContract(source) {\n invariant(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');\n invariant(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');\n invariant(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');\n}\nexport function validateTargetContract(target) {\n invariant(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');\n invariant(typeof target.hover === 'function', 'Expected hover to be a function.');\n invariant(typeof target.drop === 'function', 'Expected beginDrag to be a function.');\n}\nexport function validateType(type, allowArray) {\n if (allowArray && Array.isArray(type)) {\n type.forEach((t)=>validateType(t, false)\n );\n return;\n }\n invariant(typeof type === 'string' || typeof type === 'symbol', allowArray ? 'Type can only be a string, a symbol, or an array of either.' : 'Type can only be a string or a symbol.');\n}\n\n//# sourceMappingURL=contracts.js.map","export var HandlerRole;\n(function(HandlerRole) {\n HandlerRole[\"SOURCE\"] = \"SOURCE\";\n HandlerRole[\"TARGET\"] = \"TARGET\";\n})(HandlerRole || (HandlerRole = {}));\n\n//# sourceMappingURL=interfaces.js.map","let nextUniqueId = 0;\nexport function getNextUniqueId() {\n return nextUniqueId++;\n}\n\n//# sourceMappingURL=getNextUniqueId.js.map","import { asap } from '@react-dnd/asap';\nimport { invariant } from '@react-dnd/invariant';\nimport { addSource, addTarget, removeSource, removeTarget } from '../actions/registry.js';\nimport { validateSourceContract, validateTargetContract, validateType } from '../contracts.js';\nimport { HandlerRole } from '../interfaces.js';\nimport { getNextUniqueId } from '../utils/getNextUniqueId.js';\nfunction getNextHandlerId(role) {\n const id = getNextUniqueId().toString();\n switch(role){\n case HandlerRole.SOURCE:\n return `S${id}`;\n case HandlerRole.TARGET:\n return `T${id}`;\n default:\n throw new Error(`Unknown Handler Role: ${role}`);\n }\n}\nfunction parseRoleFromHandlerId(handlerId) {\n switch(handlerId[0]){\n case 'S':\n return HandlerRole.SOURCE;\n case 'T':\n return HandlerRole.TARGET;\n default:\n throw new Error(`Cannot parse handler ID: ${handlerId}`);\n }\n}\nfunction mapContainsValue(map, searchValue) {\n const entries = map.entries();\n let isDone = false;\n do {\n const { done , value: [, value] , } = entries.next();\n if (value === searchValue) {\n return true;\n }\n isDone = !!done;\n }while (!isDone)\n return false;\n}\nexport class HandlerRegistryImpl {\n addSource(type, source) {\n validateType(type);\n validateSourceContract(source);\n const sourceId = this.addHandler(HandlerRole.SOURCE, type, source);\n this.store.dispatch(addSource(sourceId));\n return sourceId;\n }\n addTarget(type, target) {\n validateType(type, true);\n validateTargetContract(target);\n const targetId = this.addHandler(HandlerRole.TARGET, type, target);\n this.store.dispatch(addTarget(targetId));\n return targetId;\n }\n containsHandler(handler) {\n return mapContainsValue(this.dragSources, handler) || mapContainsValue(this.dropTargets, handler);\n }\n getSource(sourceId, includePinned = false) {\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n const isPinned = includePinned && sourceId === this.pinnedSourceId;\n const source = isPinned ? this.pinnedSource : this.dragSources.get(sourceId);\n return source;\n }\n getTarget(targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.dropTargets.get(targetId);\n }\n getSourceType(sourceId) {\n invariant(this.isSourceId(sourceId), 'Expected a valid source ID.');\n return this.types.get(sourceId);\n }\n getTargetType(targetId) {\n invariant(this.isTargetId(targetId), 'Expected a valid target ID.');\n return this.types.get(targetId);\n }\n isSourceId(handlerId) {\n const role = parseRoleFromHandlerId(handlerId);\n return role === HandlerRole.SOURCE;\n }\n isTargetId(handlerId) {\n const role = parseRoleFromHandlerId(handlerId);\n return role === HandlerRole.TARGET;\n }\n removeSource(sourceId) {\n invariant(this.getSource(sourceId), 'Expected an existing source.');\n this.store.dispatch(removeSource(sourceId));\n asap(()=>{\n this.dragSources.delete(sourceId);\n this.types.delete(sourceId);\n });\n }\n removeTarget(targetId) {\n invariant(this.getTarget(targetId), 'Expected an existing target.');\n this.store.dispatch(removeTarget(targetId));\n this.dropTargets.delete(targetId);\n this.types.delete(targetId);\n }\n pinSource(sourceId) {\n const source = this.getSource(sourceId);\n invariant(source, 'Expected an existing source.');\n this.pinnedSourceId = sourceId;\n this.pinnedSource = source;\n }\n unpinSource() {\n invariant(this.pinnedSource, 'No source is pinned at the time.');\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n }\n addHandler(role, type, handler) {\n const id = getNextHandlerId(role);\n this.types.set(id, type);\n if (role === HandlerRole.SOURCE) {\n this.dragSources.set(id, handler);\n } else if (role === HandlerRole.TARGET) {\n this.dropTargets.set(id, handler);\n }\n return id;\n }\n constructor(store){\n this.types = new Map();\n this.dragSources = new Map();\n this.dropTargets = new Map();\n this.pinnedSourceId = null;\n this.pinnedSource = null;\n this.store = store;\n }\n}\n\n//# sourceMappingURL=HandlerRegistryImpl.js.map","export const strictEquality = (a, b)=>a === b\n;\n/**\n * Determine if two cartesian coordinate offsets are equal\n * @param offsetA\n * @param offsetB\n */ export function areCoordsEqual(offsetA, offsetB) {\n if (!offsetA && !offsetB) {\n return true;\n } else if (!offsetA || !offsetB) {\n return false;\n } else {\n return offsetA.x === offsetB.x && offsetA.y === offsetB.y;\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 */ export function areArraysEqual(a, b, isEqual = strictEquality) {\n if (a.length !== b.length) {\n return false;\n }\n for(let i = 0; i < a.length; ++i){\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n}\n\n//# sourceMappingURL=equality.js.map","import { BEGIN_DRAG, DROP, END_DRAG, HOVER, PUBLISH_DRAG_SOURCE } from '../actions/dragDrop/index.js';\nimport { ADD_SOURCE, ADD_TARGET, REMOVE_SOURCE, REMOVE_TARGET } from '../actions/registry.js';\nimport { ALL, NONE } from '../utils/dirtiness.js';\nimport { areArraysEqual } from '../utils/equality.js';\nimport { xor } from '../utils/js_utils.js';\nexport function reduce(// eslint-disable-next-line @typescript-eslint/no-unused-vars\n_state = NONE, action) {\n switch(action.type){\n case HOVER:\n break;\n case ADD_SOURCE:\n case ADD_TARGET:\n case REMOVE_TARGET:\n case REMOVE_SOURCE:\n return NONE;\n case BEGIN_DRAG:\n case PUBLISH_DRAG_SOURCE:\n case END_DRAG:\n case DROP:\n default:\n return ALL;\n }\n const { targetIds =[] , prevTargetIds =[] } = action.payload;\n const result = xor(targetIds, prevTargetIds);\n const didChange = result.length > 0 || !areArraysEqual(targetIds, prevTargetIds);\n if (!didChange) {\n return NONE;\n }\n // Check the target ids at the innermost position. If they are valid, add them\n // to the result\n const prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1];\n const innermostTargetId = targetIds[targetIds.length - 1];\n if (prevInnermostTargetId !== innermostTargetId) {\n if (prevInnermostTargetId) {\n result.push(prevInnermostTargetId);\n }\n if (innermostTargetId) {\n result.push(innermostTargetId);\n }\n }\n return result;\n}\n\n//# sourceMappingURL=dirtyHandlerIds.js.map","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _objectSpread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n}\nimport { BEGIN_DRAG, DROP, END_DRAG, HOVER, INIT_COORDS } from '../actions/dragDrop/index.js';\nimport { areCoordsEqual } from '../utils/equality.js';\nconst initialState = {\n initialSourceClientOffset: null,\n initialClientOffset: null,\n clientOffset: null\n};\nexport function reduce(state = initialState, action) {\n const { payload } = action;\n switch(action.type){\n case INIT_COORDS:\n case BEGIN_DRAG:\n return {\n initialSourceClientOffset: payload.sourceClientOffset,\n initialClientOffset: payload.clientOffset,\n clientOffset: payload.clientOffset\n };\n case HOVER:\n if (areCoordsEqual(state.clientOffset, payload.clientOffset)) {\n return state;\n }\n return _objectSpread({}, state, {\n clientOffset: payload.clientOffset\n });\n case END_DRAG:\n case DROP:\n return initialState;\n default:\n return state;\n }\n}\n\n//# sourceMappingURL=dragOffset.js.map","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _objectSpread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n}\nimport { BEGIN_DRAG, DROP, END_DRAG, HOVER, PUBLISH_DRAG_SOURCE } from '../actions/dragDrop/index.js';\nimport { REMOVE_TARGET } from '../actions/registry.js';\nimport { without } from '../utils/js_utils.js';\nconst initialState = {\n itemType: null,\n item: null,\n sourceId: null,\n targetIds: [],\n dropResult: null,\n didDrop: false,\n isSourcePublic: null\n};\nexport function reduce(state = initialState, action) {\n const { payload } = action;\n switch(action.type){\n case BEGIN_DRAG:\n return _objectSpread({}, state, {\n itemType: payload.itemType,\n item: payload.item,\n sourceId: payload.sourceId,\n isSourcePublic: payload.isSourcePublic,\n dropResult: null,\n didDrop: false\n });\n case PUBLISH_DRAG_SOURCE:\n return _objectSpread({}, state, {\n isSourcePublic: true\n });\n case HOVER:\n return _objectSpread({}, state, {\n targetIds: payload.targetIds\n });\n case REMOVE_TARGET:\n if (state.targetIds.indexOf(payload.targetId) === -1) {\n return state;\n }\n return _objectSpread({}, state, {\n targetIds: without(state.targetIds, payload.targetId)\n });\n case DROP:\n return _objectSpread({}, state, {\n dropResult: payload.dropResult,\n didDrop: true,\n targetIds: []\n });\n case END_DRAG:\n return _objectSpread({}, state, {\n itemType: null,\n item: null,\n sourceId: null,\n dropResult: null,\n didDrop: false,\n isSourcePublic: null,\n targetIds: []\n });\n default:\n return state;\n }\n}\n\n//# sourceMappingURL=dragOperation.js.map","import { ADD_SOURCE, ADD_TARGET, REMOVE_SOURCE, REMOVE_TARGET } from '../actions/registry.js';\nexport function reduce(state = 0, action) {\n switch(action.type){\n case ADD_SOURCE:\n case ADD_TARGET:\n return state + 1;\n case REMOVE_SOURCE:\n case REMOVE_TARGET:\n return state - 1;\n default:\n return state;\n }\n}\n\n//# sourceMappingURL=refCount.js.map","export function reduce(state = 0) {\n return state + 1;\n}\n\n//# sourceMappingURL=stateId.js.map","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _objectSpread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n}\nimport { get } from '../utils/js_utils.js';\nimport { reduce as dirtyHandlerIds } from './dirtyHandlerIds.js';\nimport { reduce as dragOffset } from './dragOffset.js';\nimport { reduce as dragOperation } from './dragOperation.js';\nimport { reduce as refCount } from './refCount.js';\nimport { reduce as stateId } from './stateId.js';\nexport function reduce(state = {}, action) {\n return {\n dirtyHandlerIds: dirtyHandlerIds(state.dirtyHandlerIds, {\n type: action.type,\n payload: _objectSpread({}, action.payload, {\n prevTargetIds: get(state, 'dragOperation.targetIds', [])\n })\n }),\n dragOffset: dragOffset(state.dragOffset, action),\n refCount: refCount(state.refCount, action),\n dragOperation: dragOperation(state.dragOperation, action),\n stateId: stateId(state.stateId)\n };\n}\n\n//# sourceMappingURL=index.js.map","import { createStore } from 'redux';\nimport { DragDropManagerImpl } from './classes/DragDropManagerImpl.js';\nimport { DragDropMonitorImpl } from './classes/DragDropMonitorImpl.js';\nimport { HandlerRegistryImpl } from './classes/HandlerRegistryImpl.js';\nimport { reduce } from './reducers/index.js';\nexport function createDragDropManager(backendFactory, globalContext = undefined, backendOptions = {}, debugMode = false) {\n const store = makeStoreInstance(debugMode);\n const monitor = new DragDropMonitorImpl(store, new HandlerRegistryImpl(store));\n const manager = new DragDropManagerImpl(store, monitor);\n const backend = backendFactory(manager, globalContext, backendOptions);\n manager.receiveBackend(backend);\n return manager;\n}\nfunction makeStoreInstance(debugMode) {\n // TODO: if we ever make a react-native version of this,\n // we'll need to consider how to pull off dev-tooling\n const reduxDevTools = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__;\n return createStore(reduce, debugMode && reduxDevTools && reduxDevTools({\n name: 'dnd-core',\n instanceId: 'dnd-core'\n }));\n}\n\n//# sourceMappingURL=createDragDropManager.js.map","function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createDragDropManager } from 'dnd-core';\nimport { memo, useEffect } from 'react';\nimport { DndContext } from './DndContext.js';\nlet refCount = 0;\nconst INSTANCE_SYM = Symbol.for('__REACT_DND_CONTEXT_INSTANCE__');\nvar DndProvider = /*#__PURE__*/ memo(function DndProvider(_param) {\n var { children } = _param, props = _objectWithoutProperties(_param, [\n \"children\"\n ]);\n const [manager, isGlobalInstance] = getDndContextValue(props) // memoized from props\n ;\n /**\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 */ useEffect(()=>{\n if (isGlobalInstance) {\n const context = getGlobalContext();\n ++refCount;\n return ()=>{\n if (--refCount === 0) {\n context[INSTANCE_SYM] = null;\n }\n };\n }\n return;\n }, []);\n return /*#__PURE__*/ _jsx(DndContext.Provider, {\n value: manager,\n children: children\n });\n});\n/**\n * A React component that provides the React-DnD context\n */ export { DndProvider, };\nfunction getDndContextValue(props) {\n if ('manager' in props) {\n const manager = {\n dragDropManager: props.manager\n };\n return [\n manager,\n false\n ];\n }\n const manager = createSingletonDndContext(props.backend, props.context, props.options, props.debugMode);\n const isGlobalInstance = !props.context;\n return [\n manager,\n isGlobalInstance\n ];\n}\nfunction createSingletonDndContext(backend, context = getGlobalContext(), options, debugMode) {\n const ctx = context;\n if (!ctx[INSTANCE_SYM]) {\n ctx[INSTANCE_SYM] = {\n dragDropManager: createDragDropManager(backend, context, options, debugMode)\n };\n }\n return ctx[INSTANCE_SYM];\n}\nfunction getGlobalContext() {\n return typeof global !== 'undefined' ? global : window;\n}\n\n//# sourceMappingURL=DndProvider.js.map","'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","import { useEffect, useLayoutEffect } from 'react';\n// suppress the useLayoutEffect warning on server side.\nexport const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\n//# sourceMappingURL=useIsomorphicLayoutEffect.js.map","import equal from 'fast-deep-equal';\nimport { useCallback, useState } from 'react';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';\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 */ export function useCollector(monitor, collect, onUpdate) {\n const [collected, setCollected] = useState(()=>collect(monitor)\n );\n const updateCollected = useCallback(()=>{\n const nextValue = collect(monitor);\n // This needs to be a deep-equality check because some monitor-collected values\n // include XYCoord objects that may be equivalent, but do not have instance equality.\n if (!equal(collected, nextValue)) {\n setCollected(nextValue);\n if (onUpdate) {\n onUpdate();\n }\n }\n }, [\n collected,\n monitor,\n onUpdate\n ]);\n // update the collected properties after react renders.\n // Note that the \"Dustbin Stress Test\" fails if this is not\n // done when the component updates\n useIsomorphicLayoutEffect(updateCollected);\n return [\n collected,\n updateCollected\n ];\n}\n\n//# sourceMappingURL=useCollector.js.map","import { useCollector } from './useCollector.js';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';\nexport function useMonitorOutput(monitor, collect, onCollect) {\n const [collected, updateCollected] = useCollector(monitor, collect, onCollect);\n useIsomorphicLayoutEffect(function subscribeToMonitorStateChange() {\n const handlerId = monitor.getHandlerId();\n if (handlerId == null) {\n return;\n }\n return monitor.subscribeToStateChange(updateCollected, {\n handlerIds: [\n handlerId\n ]\n });\n }, [\n monitor,\n updateCollected\n ]);\n return collected;\n}\n\n//# sourceMappingURL=useMonitorOutput.js.map","import { useMonitorOutput } from './useMonitorOutput.js';\nexport function useCollectedProps(collector, monitor, connector) {\n return useMonitorOutput(monitor, collector || (()=>({})\n ), ()=>connector.reconnect()\n );\n}\n\n//# sourceMappingURL=useCollectedProps.js.map","import { useMemo } from 'react';\nexport function useOptionalFactory(arg, deps) {\n const memoDeps = [\n ...deps || []\n ];\n if (deps == null && typeof arg !== 'function') {\n memoDeps.push(arg);\n }\n return useMemo(()=>{\n return typeof arg === 'function' ? arg() : arg;\n }, memoDeps);\n}\n\n//# sourceMappingURL=useOptionalFactory.js.map","import { useMemo } from 'react';\nexport function useConnectDragSource(connector) {\n return useMemo(()=>connector.hooks.dragSource()\n , [\n connector\n ]);\n}\nexport function useConnectDragPreview(connector) {\n return useMemo(()=>connector.hooks.dragPreview()\n , [\n connector\n ]);\n}\n\n//# sourceMappingURL=connectors.js.map","import { invariant } from '@react-dnd/invariant';\nlet isCallingCanDrag = false;\nlet isCallingIsDragging = false;\nexport class DragSourceMonitorImpl {\n receiveHandlerId(sourceId) {\n this.sourceId = sourceId;\n }\n getHandlerId() {\n return this.sourceId;\n }\n canDrag() {\n invariant(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');\n try {\n isCallingCanDrag = true;\n return this.internalMonitor.canDragSource(this.sourceId);\n } finally{\n isCallingCanDrag = false;\n }\n }\n isDragging() {\n if (!this.sourceId) {\n return false;\n }\n invariant(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');\n try {\n isCallingIsDragging = true;\n return this.internalMonitor.isDraggingSource(this.sourceId);\n } finally{\n isCallingIsDragging = false;\n }\n }\n subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n isDraggingSource(sourceId) {\n return this.internalMonitor.isDraggingSource(sourceId);\n }\n isOverTarget(targetId, options) {\n return this.internalMonitor.isOverTarget(targetId, options);\n }\n getTargetIds() {\n return this.internalMonitor.getTargetIds();\n }\n isSourcePublic() {\n return this.internalMonitor.isSourcePublic();\n }\n getSourceId() {\n return this.internalMonitor.getSourceId();\n }\n subscribeToOffsetChange(listener) {\n return this.internalMonitor.subscribeToOffsetChange(listener);\n }\n canDragSource(sourceId) {\n return this.internalMonitor.canDragSource(sourceId);\n }\n canDropOnTarget(targetId) {\n return this.internalMonitor.canDropOnTarget(targetId);\n }\n getItemType() {\n return this.internalMonitor.getItemType();\n }\n getItem() {\n return this.internalMonitor.getItem();\n }\n getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n didDrop() {\n return this.internalMonitor.didDrop();\n }\n getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n constructor(manager){\n this.sourceId = null;\n this.internalMonitor = manager.getMonitor();\n }\n}\n\n//# sourceMappingURL=DragSourceMonitorImpl.js.map","import { invariant } from '@react-dnd/invariant';\nlet isCallingCanDrop = false;\nexport class DropTargetMonitorImpl {\n receiveHandlerId(targetId) {\n this.targetId = targetId;\n }\n getHandlerId() {\n return this.targetId;\n }\n subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n canDrop() {\n // Cut out early if the target id has not been set. This should prevent errors\n // where the user has an older version of dnd-core like in\n // https://github.com/react-dnd/react-dnd/issues/1310\n if (!this.targetId) {\n return false;\n }\n invariant(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor');\n try {\n isCallingCanDrop = true;\n return this.internalMonitor.canDropOnTarget(this.targetId);\n } finally{\n isCallingCanDrop = false;\n }\n }\n isOver(options) {\n if (!this.targetId) {\n return false;\n }\n return this.internalMonitor.isOverTarget(this.targetId, options);\n }\n getItemType() {\n return this.internalMonitor.getItemType();\n }\n getItem() {\n return this.internalMonitor.getItem();\n }\n getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n didDrop() {\n return this.internalMonitor.didDrop();\n }\n getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n constructor(manager){\n this.targetId = null;\n this.internalMonitor = manager.getMonitor();\n }\n}\n\n//# sourceMappingURL=DropTargetMonitorImpl.js.map","export function registerTarget(type, target, manager) {\n const registry = manager.getRegistry();\n const targetId = registry.addTarget(type, target);\n return [\n targetId,\n ()=>registry.removeTarget(targetId)\n ];\n}\nexport function registerSource(type, source, manager) {\n const registry = manager.getRegistry();\n const sourceId = registry.addSource(type, source);\n return [\n sourceId,\n ()=>registry.removeSource(sourceId)\n ];\n}\n\n//# sourceMappingURL=registration.js.map","export function shallowEqual(objA, objB, compare, compareContext) {\n let compareResult = compare ? compare.call(compareContext, objA, objB) : void 0;\n if (compareResult !== void 0) {\n return !!compareResult;\n }\n if (objA === objB) {\n return true;\n }\n if (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {\n return false;\n }\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) {\n return false;\n }\n const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n // Test for A's keys different from B.\n for(let idx = 0; idx < keysA.length; idx++){\n const key = keysA[idx];\n if (!bHasOwnProperty(key)) {\n return false;\n }\n const valueA = objA[key];\n const valueB = objB[key];\n compareResult = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n if (compareResult === false || compareResult === void 0 && valueA !== valueB) {\n return false;\n }\n }\n return true;\n}\n\n//# sourceMappingURL=index.js.map","export function isRef(obj) {\n return(// eslint-disable-next-line no-prototype-builtins\n obj !== null && typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, 'current'));\n}\n\n//# sourceMappingURL=isRef.js.map","import { invariant } from '@react-dnd/invariant';\nimport { cloneElement, isValidElement } from 'react';\nfunction throwIfCompositeComponentElement(element) {\n // Custom components can no longer be wrapped directly in React DnD 2.0\n // so that we don't need to depend on findDOMNode() from react-dom.\n if (typeof element.type === 'string') {\n return;\n }\n const displayName = element.type.displayName || element.type.name || 'the component';\n throw new Error('Only native element nodes can now be passed to React DnD connectors.' + `You can either wrap ${displayName} into a
, or turn it into a ` + 'drag source or a drop target itself.');\n}\nfunction wrapHookToRecognizeElement(hook) {\n return (elementOrNode = null, options = null)=>{\n // When passed a node, call the hook straight away.\n if (!isValidElement(elementOrNode)) {\n const node = elementOrNode;\n hook(node, options);\n // return the node so it can be chained (e.g. when within callback refs\n //
connectDragSource(connectDropTarget(node))}/>\n return node;\n }\n // If passed a ReactElement, clone it and attach this function as a ref.\n // This helps us achieve a neat API where user doesn't even know that refs\n // are being used under the hood.\n const element = elementOrNode;\n throwIfCompositeComponentElement(element);\n // When no options are passed, use the hook directly\n const ref = options ? (node)=>hook(node, options)\n : hook;\n return cloneWithRef(element, ref);\n };\n}\nexport function wrapConnectorHooks(hooks) {\n const wrappedHooks = {};\n Object.keys(hooks).forEach((key)=>{\n const hook = hooks[key];\n // ref objects should be passed straight through without wrapping\n if (key.endsWith('Ref')) {\n wrappedHooks[key] = hooks[key];\n } else {\n const wrappedHook = wrapHookToRecognizeElement(hook);\n wrappedHooks[key] = ()=>wrappedHook\n ;\n }\n });\n return wrappedHooks;\n}\nfunction setRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n}\nfunction cloneWithRef(element, newRef) {\n const previousRef = element.ref;\n invariant(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a or
. ' + 'Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs');\n if (!previousRef) {\n // When there is no ref on the element, use the new ref directly\n return cloneElement(element, {\n ref: newRef\n });\n } else {\n return cloneElement(element, {\n ref: (node)=>{\n setRef(previousRef, node);\n setRef(newRef, node);\n }\n });\n }\n}\n\n//# sourceMappingURL=wrapConnectorHooks.js.map","import { shallowEqual } from '@react-dnd/shallowequal';\nimport { isRef } from './isRef.js';\nimport { wrapConnectorHooks } from './wrapConnectorHooks.js';\nexport class SourceConnector {\n receiveHandlerId(newHandlerId) {\n if (this.handlerId === newHandlerId) {\n return;\n }\n this.handlerId = newHandlerId;\n this.reconnect();\n }\n get connectTarget() {\n return this.dragSource;\n }\n get dragSourceOptions() {\n return this.dragSourceOptionsInternal;\n }\n set dragSourceOptions(options) {\n this.dragSourceOptionsInternal = options;\n }\n get dragPreviewOptions() {\n return this.dragPreviewOptionsInternal;\n }\n set dragPreviewOptions(options) {\n this.dragPreviewOptionsInternal = options;\n }\n reconnect() {\n const didChange = this.reconnectDragSource();\n this.reconnectDragPreview(didChange);\n }\n reconnectDragSource() {\n const dragSource = this.dragSource;\n // if nothing has changed then don't resubscribe\n const didChange = this.didHandlerIdChange() || this.didConnectedDragSourceChange() || this.didDragSourceOptionsChange();\n if (didChange) {\n this.disconnectDragSource();\n }\n if (!this.handlerId) {\n return didChange;\n }\n if (!dragSource) {\n this.lastConnectedDragSource = dragSource;\n return didChange;\n }\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDragSource = dragSource;\n this.lastConnectedDragSourceOptions = this.dragSourceOptions;\n this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, dragSource, this.dragSourceOptions);\n }\n return didChange;\n }\n reconnectDragPreview(forceDidChange = false) {\n const dragPreview = this.dragPreview;\n // if nothing has changed then don't resubscribe\n const didChange = forceDidChange || this.didHandlerIdChange() || this.didConnectedDragPreviewChange() || this.didDragPreviewOptionsChange();\n if (didChange) {\n this.disconnectDragPreview();\n }\n if (!this.handlerId) {\n return;\n }\n if (!dragPreview) {\n this.lastConnectedDragPreview = dragPreview;\n return;\n }\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDragPreview = dragPreview;\n this.lastConnectedDragPreviewOptions = this.dragPreviewOptions;\n this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, dragPreview, this.dragPreviewOptions);\n }\n }\n didHandlerIdChange() {\n return this.lastConnectedHandlerId !== this.handlerId;\n }\n didConnectedDragSourceChange() {\n return this.lastConnectedDragSource !== this.dragSource;\n }\n didConnectedDragPreviewChange() {\n return this.lastConnectedDragPreview !== this.dragPreview;\n }\n didDragSourceOptionsChange() {\n return !shallowEqual(this.lastConnectedDragSourceOptions, this.dragSourceOptions);\n }\n didDragPreviewOptionsChange() {\n return !shallowEqual(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);\n }\n disconnectDragSource() {\n if (this.dragSourceUnsubscribe) {\n this.dragSourceUnsubscribe();\n this.dragSourceUnsubscribe = undefined;\n }\n }\n disconnectDragPreview() {\n if (this.dragPreviewUnsubscribe) {\n this.dragPreviewUnsubscribe();\n this.dragPreviewUnsubscribe = undefined;\n this.dragPreviewNode = null;\n this.dragPreviewRef = null;\n }\n }\n get dragSource() {\n return this.dragSourceNode || this.dragSourceRef && this.dragSourceRef.current;\n }\n get dragPreview() {\n return this.dragPreviewNode || this.dragPreviewRef && this.dragPreviewRef.current;\n }\n clearDragSource() {\n this.dragSourceNode = null;\n this.dragSourceRef = null;\n }\n clearDragPreview() {\n this.dragPreviewNode = null;\n this.dragPreviewRef = null;\n }\n constructor(backend){\n this.hooks = wrapConnectorHooks({\n dragSource: (node, options)=>{\n this.clearDragSource();\n this.dragSourceOptions = options || null;\n if (isRef(node)) {\n this.dragSourceRef = node;\n } else {\n this.dragSourceNode = node;\n }\n this.reconnectDragSource();\n },\n dragPreview: (node, options)=>{\n this.clearDragPreview();\n this.dragPreviewOptions = options || null;\n if (isRef(node)) {\n this.dragPreviewRef = node;\n } else {\n this.dragPreviewNode = node;\n }\n this.reconnectDragPreview();\n }\n });\n this.handlerId = null;\n // The drop target may either be attached via ref or connect function\n this.dragSourceRef = null;\n this.dragSourceOptionsInternal = null;\n // The drag preview may either be attached via ref or connect function\n this.dragPreviewRef = null;\n this.dragPreviewOptionsInternal = null;\n this.lastConnectedHandlerId = null;\n this.lastConnectedDragSource = null;\n this.lastConnectedDragSourceOptions = null;\n this.lastConnectedDragPreview = null;\n this.lastConnectedDragPreviewOptions = null;\n this.backend = backend;\n }\n}\n\n//# sourceMappingURL=SourceConnector.js.map","import { shallowEqual } from '@react-dnd/shallowequal';\nimport { isRef } from './isRef.js';\nimport { wrapConnectorHooks } from './wrapConnectorHooks.js';\nexport class TargetConnector {\n get connectTarget() {\n return this.dropTarget;\n }\n reconnect() {\n // if nothing has changed then don't resubscribe\n const didChange = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();\n if (didChange) {\n this.disconnectDropTarget();\n }\n const dropTarget = this.dropTarget;\n if (!this.handlerId) {\n return;\n }\n if (!dropTarget) {\n this.lastConnectedDropTarget = dropTarget;\n return;\n }\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDropTarget = dropTarget;\n this.lastConnectedDropTargetOptions = this.dropTargetOptions;\n this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, dropTarget, this.dropTargetOptions);\n }\n }\n receiveHandlerId(newHandlerId) {\n if (newHandlerId === this.handlerId) {\n return;\n }\n this.handlerId = newHandlerId;\n this.reconnect();\n }\n get dropTargetOptions() {\n return this.dropTargetOptionsInternal;\n }\n set dropTargetOptions(options) {\n this.dropTargetOptionsInternal = options;\n }\n didHandlerIdChange() {\n return this.lastConnectedHandlerId !== this.handlerId;\n }\n didDropTargetChange() {\n return this.lastConnectedDropTarget !== this.dropTarget;\n }\n didOptionsChange() {\n return !shallowEqual(this.lastConnectedDropTargetOptions, this.dropTargetOptions);\n }\n disconnectDropTarget() {\n if (this.unsubscribeDropTarget) {\n this.unsubscribeDropTarget();\n this.unsubscribeDropTarget = undefined;\n }\n }\n get dropTarget() {\n return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;\n }\n clearDropTarget() {\n this.dropTargetRef = null;\n this.dropTargetNode = null;\n }\n constructor(backend){\n this.hooks = wrapConnectorHooks({\n dropTarget: (node, options)=>{\n this.clearDropTarget();\n this.dropTargetOptions = options;\n if (isRef(node)) {\n this.dropTargetRef = node;\n } else {\n this.dropTargetNode = node;\n }\n this.reconnect();\n }\n });\n this.handlerId = null;\n // The drop target may either be attached via ref or connect function\n this.dropTargetRef = null;\n this.dropTargetOptionsInternal = null;\n this.lastConnectedHandlerId = null;\n this.lastConnectedDropTarget = null;\n this.lastConnectedDropTargetOptions = null;\n this.backend = backend;\n }\n}\n\n//# sourceMappingURL=TargetConnector.js.map","import { invariant } from '@react-dnd/invariant';\nimport { useContext } from 'react';\nimport { DndContext } from '../core/index.js';\n/**\n * A hook to retrieve the DragDropManager from Context\n */ export function useDragDropManager() {\n const { dragDropManager } = useContext(DndContext);\n invariant(dragDropManager != null, 'Expected drag drop context');\n return dragDropManager;\n}\n\n//# sourceMappingURL=useDragDropManager.js.map","import { useMemo } from 'react';\nimport { SourceConnector } from '../../internals/index.js';\nimport { useDragDropManager } from '../useDragDropManager.js';\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js';\nexport function useDragSourceConnector(dragSourceOptions, dragPreviewOptions) {\n const manager = useDragDropManager();\n const connector = useMemo(()=>new SourceConnector(manager.getBackend())\n , [\n manager\n ]);\n useIsomorphicLayoutEffect(()=>{\n connector.dragSourceOptions = dragSourceOptions || null;\n connector.reconnect();\n return ()=>connector.disconnectDragSource()\n ;\n }, [\n connector,\n dragSourceOptions\n ]);\n useIsomorphicLayoutEffect(()=>{\n connector.dragPreviewOptions = dragPreviewOptions || null;\n connector.reconnect();\n return ()=>connector.disconnectDragPreview()\n ;\n }, [\n connector,\n dragPreviewOptions\n ]);\n return connector;\n}\n\n//# sourceMappingURL=useDragSourceConnector.js.map","import { useMemo } from 'react';\nimport { DragSourceMonitorImpl } from '../../internals/index.js';\nimport { useDragDropManager } from '../useDragDropManager.js';\nexport function useDragSourceMonitor() {\n const manager = useDragDropManager();\n return useMemo(()=>new DragSourceMonitorImpl(manager)\n , [\n manager\n ]);\n}\n\n//# sourceMappingURL=useDragSourceMonitor.js.map","export class DragSourceImpl {\n beginDrag() {\n const spec = this.spec;\n const monitor = this.monitor;\n let result = null;\n if (typeof spec.item === 'object') {\n result = spec.item;\n } else if (typeof spec.item === 'function') {\n result = spec.item(monitor);\n } else {\n result = {};\n }\n return result !== null && result !== void 0 ? result : null;\n }\n canDrag() {\n const spec = this.spec;\n const monitor = this.monitor;\n if (typeof spec.canDrag === 'boolean') {\n return spec.canDrag;\n } else if (typeof spec.canDrag === 'function') {\n return spec.canDrag(monitor);\n } else {\n return true;\n }\n }\n isDragging(globalMonitor, target) {\n const spec = this.spec;\n const monitor = this.monitor;\n const { isDragging } = spec;\n return isDragging ? isDragging(monitor) : target === globalMonitor.getSourceId();\n }\n endDrag() {\n const spec = this.spec;\n const monitor = this.monitor;\n const connector = this.connector;\n const { end } = spec;\n if (end) {\n end(monitor.getItem(), monitor);\n }\n connector.reconnect();\n }\n constructor(spec, monitor, connector){\n this.spec = spec;\n this.monitor = monitor;\n this.connector = connector;\n }\n}\n\n//# sourceMappingURL=DragSourceImpl.js.map","import { useEffect, useMemo } from 'react';\nimport { DragSourceImpl } from './DragSourceImpl.js';\nexport function useDragSource(spec, monitor, connector) {\n const handler = useMemo(()=>new DragSourceImpl(spec, monitor, connector)\n , [\n monitor,\n connector\n ]);\n useEffect(()=>{\n handler.spec = spec;\n }, [\n spec\n ]);\n return handler;\n}\n\n//# sourceMappingURL=useDragSource.js.map","import { invariant } from '@react-dnd/invariant';\nimport { useMemo } from 'react';\nexport function useDragType(spec) {\n return useMemo(()=>{\n const result = spec.type;\n invariant(result != null, 'spec.type must be defined');\n return result;\n }, [\n spec\n ]);\n}\n\n//# sourceMappingURL=useDragType.js.map","import { registerSource } from '../../internals/index.js';\nimport { useDragDropManager } from '../useDragDropManager.js';\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js';\nimport { useDragSource } from './useDragSource.js';\nimport { useDragType } from './useDragType.js';\nexport function useRegisteredDragSource(spec, monitor, connector) {\n const manager = useDragDropManager();\n const handler = useDragSource(spec, monitor, connector);\n const itemType = useDragType(spec);\n useIsomorphicLayoutEffect(function registerDragSource() {\n if (itemType != null) {\n const [handlerId, unregister] = registerSource(itemType, handler, manager);\n monitor.receiveHandlerId(handlerId);\n connector.receiveHandlerId(handlerId);\n return unregister;\n }\n return;\n }, [\n manager,\n monitor,\n connector,\n handler,\n itemType\n ]);\n}\n\n//# sourceMappingURL=useRegisteredDragSource.js.map","import { invariant } from '@react-dnd/invariant';\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 * 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 */ export function useDrag(specArg, deps) {\n const spec = useOptionalFactory(specArg, deps);\n invariant(!spec.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)`);\n const monitor = useDragSourceMonitor();\n const connector = useDragSourceConnector(spec.options, spec.previewOptions);\n useRegisteredDragSource(spec, monitor, connector);\n return [\n useCollectedProps(spec.collect, monitor, connector),\n useConnectDragSource(connector),\n useConnectDragPreview(connector), \n ];\n}\n\n//# sourceMappingURL=useDrag.js.map","import { useMemo } from 'react';\nexport function useConnectDropTarget(connector) {\n return useMemo(()=>connector.hooks.dropTarget()\n , [\n connector\n ]);\n}\n\n//# sourceMappingURL=connectors.js.map","import { useMemo } from 'react';\nimport { TargetConnector } from '../../internals/index.js';\nimport { useDragDropManager } from '../useDragDropManager.js';\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js';\nexport function useDropTargetConnector(options) {\n const manager = useDragDropManager();\n const connector = useMemo(()=>new TargetConnector(manager.getBackend())\n , [\n manager\n ]);\n useIsomorphicLayoutEffect(()=>{\n connector.dropTargetOptions = options || null;\n connector.reconnect();\n return ()=>connector.disconnectDropTarget()\n ;\n }, [\n options\n ]);\n return connector;\n}\n\n//# sourceMappingURL=useDropTargetConnector.js.map","import { useMemo } from 'react';\nimport { DropTargetMonitorImpl } from '../../internals/index.js';\nimport { useDragDropManager } from '../useDragDropManager.js';\nexport function useDropTargetMonitor() {\n const manager = useDragDropManager();\n return useMemo(()=>new DropTargetMonitorImpl(manager)\n , [\n manager\n ]);\n}\n\n//# sourceMappingURL=useDropTargetMonitor.js.map","import { invariant } from '@react-dnd/invariant';\nimport { useMemo } from 'react';\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 */ export function useAccept(spec) {\n const { accept } = spec;\n return useMemo(()=>{\n invariant(spec.accept != null, 'accept must be defined');\n return Array.isArray(accept) ? accept : [\n accept\n ];\n }, [\n accept\n ]);\n}\n\n//# sourceMappingURL=useAccept.js.map","export class DropTargetImpl {\n canDrop() {\n const spec = this.spec;\n const monitor = this.monitor;\n return spec.canDrop ? spec.canDrop(monitor.getItem(), monitor) : true;\n }\n hover() {\n const spec = this.spec;\n const monitor = this.monitor;\n if (spec.hover) {\n spec.hover(monitor.getItem(), monitor);\n }\n }\n drop() {\n const spec = this.spec;\n const monitor = this.monitor;\n if (spec.drop) {\n return spec.drop(monitor.getItem(), monitor);\n }\n return;\n }\n constructor(spec, monitor){\n this.spec = spec;\n this.monitor = monitor;\n }\n}\n\n//# sourceMappingURL=DropTargetImpl.js.map","import { useEffect, useMemo } from 'react';\nimport { DropTargetImpl } from './DropTargetImpl.js';\nexport function useDropTarget(spec, monitor) {\n const dropTarget = useMemo(()=>new DropTargetImpl(spec, monitor)\n , [\n monitor\n ]);\n useEffect(()=>{\n dropTarget.spec = spec;\n }, [\n spec\n ]);\n return dropTarget;\n}\n\n//# sourceMappingURL=useDropTarget.js.map","import { registerTarget } from '../../internals/index.js';\nimport { useDragDropManager } from '../useDragDropManager.js';\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect.js';\nimport { useAccept } from './useAccept.js';\nimport { useDropTarget } from './useDropTarget.js';\nexport function useRegisteredDropTarget(spec, monitor, connector) {\n const manager = useDragDropManager();\n const dropTarget = useDropTarget(spec, monitor);\n const accept = useAccept(spec);\n useIsomorphicLayoutEffect(function registerDropTarget() {\n const [handlerId, unregister] = registerTarget(accept, dropTarget, manager);\n monitor.receiveHandlerId(handlerId);\n connector.receiveHandlerId(handlerId);\n return unregister;\n }, [\n manager,\n monitor,\n dropTarget,\n connector,\n accept.map((a)=>a.toString()\n ).join('|'), \n ]);\n}\n\n//# sourceMappingURL=useRegisteredDropTarget.js.map","import { 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 * 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 */ export function useDrop(specArg, deps) {\n const spec = useOptionalFactory(specArg, deps);\n const monitor = useDropTargetMonitor();\n const connector = useDropTargetConnector(spec.options);\n useRegisteredDropTarget(spec, monitor, connector);\n return [\n useCollectedProps(spec.collect, monitor, connector),\n useConnectDropTarget(connector), \n ];\n}\n\n//# sourceMappingURL=useDrop.js.map","// cheap lodash replacements\nexport function memoize(fn) {\n let result = null;\n const memoized = ()=>{\n if (result == null) {\n result = fn();\n }\n return result;\n };\n return memoized;\n}\n/**\n * drop-in replacement for _.without\n */ export function without(items, item) {\n return items.filter((i)=>i !== item\n );\n}\nexport function union(itemsA, itemsB) {\n const set = new Set();\n const insertItem = (item)=>set.add(item)\n ;\n itemsA.forEach(insertItem);\n itemsB.forEach(insertItem);\n const result = [];\n set.forEach((key)=>result.push(key)\n );\n return result;\n}\n\n//# sourceMappingURL=js_utils.js.map","import { union, without } from './utils/js_utils.js';\nexport class EnterLeaveCounter {\n enter(enteringNode) {\n const previousLength = this.entered.length;\n const isNodeEntered = (node)=>this.isNodeInDocument(node) && (!node.contains || node.contains(enteringNode))\n ;\n this.entered = union(this.entered.filter(isNodeEntered), [\n enteringNode\n ]);\n return previousLength === 0 && this.entered.length > 0;\n }\n leave(leavingNode) {\n const previousLength = this.entered.length;\n this.entered = without(this.entered.filter(this.isNodeInDocument), leavingNode);\n return previousLength > 0 && this.entered.length === 0;\n }\n reset() {\n this.entered = [];\n }\n constructor(isNodeInDocument){\n this.entered = [];\n this.isNodeInDocument = isNodeInDocument;\n }\n}\n\n//# sourceMappingURL=EnterLeaveCounter.js.map","export class NativeDragSource {\n initializeExposedProperties() {\n Object.keys(this.config.exposeProperties).forEach((property)=>{\n Object.defineProperty(this.item, property, {\n configurable: true,\n enumerable: true,\n get () {\n // eslint-disable-next-line no-console\n console.warn(`Browser doesn't allow reading \"${property}\" until the drop event.`);\n return null;\n }\n });\n });\n }\n loadDataTransfer(dataTransfer) {\n if (dataTransfer) {\n const newProperties = {};\n Object.keys(this.config.exposeProperties).forEach((property)=>{\n const propertyFn = this.config.exposeProperties[property];\n if (propertyFn != null) {\n newProperties[property] = {\n value: propertyFn(dataTransfer, this.config.matchesTypes),\n configurable: true,\n enumerable: true\n };\n }\n });\n Object.defineProperties(this.item, newProperties);\n }\n }\n canDrag() {\n return true;\n }\n beginDrag() {\n return this.item;\n }\n isDragging(monitor, handle) {\n return handle === monitor.getSourceId();\n }\n endDrag() {\n // empty\n }\n constructor(config){\n this.config = config;\n this.item = {};\n this.initializeExposedProperties();\n }\n}\n\n//# sourceMappingURL=NativeDragSource.js.map","export const FILE = '__NATIVE_FILE__';\nexport const URL = '__NATIVE_URL__';\nexport const TEXT = '__NATIVE_TEXT__';\nexport const HTML = '__NATIVE_HTML__';\n\n//# sourceMappingURL=NativeTypes.js.map","export function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) {\n const result = typesToTry.reduce((resultSoFar, typeToTry)=>resultSoFar || dataTransfer.getData(typeToTry)\n , '');\n return result != null ? result : defaultValue;\n}\n\n//# sourceMappingURL=getDataFromDataTransfer.js.map","import * as NativeTypes from '../NativeTypes.js';\nimport { getDataFromDataTransfer } from './getDataFromDataTransfer.js';\nexport const nativeTypesConfig = {\n [NativeTypes.FILE]: {\n exposeProperties: {\n files: (dataTransfer)=>Array.prototype.slice.call(dataTransfer.files)\n ,\n items: (dataTransfer)=>dataTransfer.items\n ,\n dataTransfer: (dataTransfer)=>dataTransfer\n },\n matchesTypes: [\n 'Files'\n ]\n },\n [NativeTypes.HTML]: {\n exposeProperties: {\n html: (dataTransfer, matchesTypes)=>getDataFromDataTransfer(dataTransfer, matchesTypes, '')\n ,\n dataTransfer: (dataTransfer)=>dataTransfer\n },\n matchesTypes: [\n 'Html',\n 'text/html'\n ]\n },\n [NativeTypes.URL]: {\n exposeProperties: {\n urls: (dataTransfer, matchesTypes)=>getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\\n')\n ,\n dataTransfer: (dataTransfer)=>dataTransfer\n },\n matchesTypes: [\n 'Url',\n 'text/uri-list'\n ]\n },\n [NativeTypes.TEXT]: {\n exposeProperties: {\n text: (dataTransfer, matchesTypes)=>getDataFromDataTransfer(dataTransfer, matchesTypes, '')\n ,\n dataTransfer: (dataTransfer)=>dataTransfer\n },\n matchesTypes: [\n 'Text',\n 'text/plain'\n ]\n }\n};\n\n//# sourceMappingURL=nativeTypesConfig.js.map","import { NativeDragSource } from './NativeDragSource.js';\nimport { nativeTypesConfig } from './nativeTypesConfig.js';\nexport function createNativeDragSource(type, dataTransfer) {\n const config = nativeTypesConfig[type];\n if (!config) {\n throw new Error(`native type ${type} has no configuration`);\n }\n const result = new NativeDragSource(config);\n result.loadDataTransfer(dataTransfer);\n return result;\n}\nexport function matchNativeItemType(dataTransfer) {\n if (!dataTransfer) {\n return null;\n }\n const dataTransferTypes = Array.prototype.slice.call(dataTransfer.types || []);\n return Object.keys(nativeTypesConfig).filter((nativeItemType)=>{\n const typeConfig = nativeTypesConfig[nativeItemType];\n if (!(typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig.matchesTypes)) {\n return false;\n }\n return typeConfig.matchesTypes.some((t)=>dataTransferTypes.indexOf(t) > -1\n );\n })[0] || null;\n}\n\n//# sourceMappingURL=index.js.map","import { memoize } from './utils/js_utils.js';\nexport const isFirefox = memoize(()=>/firefox/i.test(navigator.userAgent)\n);\nexport const isSafari = memoize(()=>Boolean(window.safari)\n);\n\n//# sourceMappingURL=BrowserDetector.js.map","export class MonotonicInterpolant {\n interpolate(x) {\n const { xs , ys , c1s , c2s , c3s } = this;\n // The rightmost point in the dataset should give an exact result\n let i = xs.length - 1;\n if (x === xs[i]) {\n return ys[i];\n }\n // Search for the interval x is in, returning the corresponding y if x is one of the original xs\n let low = 0;\n let high = c3s.length - 1;\n let mid;\n while(low <= high){\n mid = Math.floor(0.5 * (low + high));\n const xHere = xs[mid];\n if (xHere < x) {\n low = mid + 1;\n } else if (xHere > x) {\n high = mid - 1;\n } else {\n return ys[mid];\n }\n }\n i = Math.max(0, high);\n // Interpolate\n const diff = x - xs[i];\n const diffSq = diff * diff;\n return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq;\n }\n constructor(xs, ys){\n const { length } = xs;\n // Rearrange xs and ys so that xs is sorted\n const indexes = [];\n for(let i = 0; i < length; i++){\n indexes.push(i);\n }\n indexes.sort((a, b)=>xs[a] < xs[b] ? -1 : 1\n );\n // Get consecutive differences and slopes\n const dys = [];\n const dxs = [];\n const ms = [];\n let dx;\n let dy;\n for(let i1 = 0; i1 < length - 1; i1++){\n dx = xs[i1 + 1] - xs[i1];\n dy = ys[i1 + 1] - ys[i1];\n dxs.push(dx);\n dys.push(dy);\n ms.push(dy / dx);\n }\n // Get degree-1 coefficients\n const c1s = [\n ms[0]\n ];\n for(let i2 = 0; i2 < dxs.length - 1; i2++){\n const m2 = ms[i2];\n const mNext = ms[i2 + 1];\n if (m2 * mNext <= 0) {\n c1s.push(0);\n } else {\n dx = dxs[i2];\n const dxNext = dxs[i2 + 1];\n const common = dx + dxNext;\n c1s.push(3 * common / ((common + dxNext) / m2 + (common + dx) / mNext));\n }\n }\n c1s.push(ms[ms.length - 1]);\n // Get degree-2 and degree-3 coefficients\n const c2s = [];\n const c3s = [];\n let m;\n for(let i3 = 0; i3 < c1s.length - 1; i3++){\n m = ms[i3];\n const c1 = c1s[i3];\n const invDx = 1 / dxs[i3];\n const common = c1 + c1s[i3 + 1] - m - m;\n c2s.push((m - c1 - common) * invDx);\n c3s.push(common * invDx * invDx);\n }\n this.xs = xs;\n this.ys = ys;\n this.c1s = c1s;\n this.c2s = c2s;\n this.c3s = c3s;\n }\n}\n\n//# sourceMappingURL=MonotonicInterpolant.js.map","import { isFirefox, isSafari } from './BrowserDetector.js';\nimport { MonotonicInterpolant } from './MonotonicInterpolant.js';\nconst ELEMENT_NODE = 1;\nexport function getNodeClientOffset(node) {\n const el = node.nodeType === ELEMENT_NODE ? node : node.parentElement;\n if (!el) {\n return null;\n }\n const { top , left } = el.getBoundingClientRect();\n return {\n x: left,\n y: top\n };\n}\nexport function getEventClientOffset(e) {\n return {\n x: e.clientX,\n y: e.clientY\n };\n}\nfunction isImageNode(node) {\n var ref;\n return node.nodeName === 'IMG' && (isFirefox() || !((ref = document.documentElement) === null || ref === void 0 ? void 0 : ref.contains(node)));\n}\nfunction getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight) {\n let dragPreviewWidth = isImage ? dragPreview.width : sourceWidth;\n let dragPreviewHeight = isImage ? dragPreview.height : sourceHeight;\n // Work around @2x coordinate discrepancies in browsers\n if (isSafari() && isImage) {\n dragPreviewHeight /= window.devicePixelRatio;\n dragPreviewWidth /= window.devicePixelRatio;\n }\n return {\n dragPreviewWidth,\n dragPreviewHeight\n };\n}\nexport function getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint) {\n // The browsers will use the image intrinsic size under different conditions.\n // Firefox only cares if it's an image, but WebKit also wants it to be detached.\n const isImage = isImageNode(dragPreview);\n const dragPreviewNode = isImage ? sourceNode : dragPreview;\n const dragPreviewNodeOffsetFromClient = getNodeClientOffset(dragPreviewNode);\n const offsetFromDragPreview = {\n x: clientOffset.x - dragPreviewNodeOffsetFromClient.x,\n y: clientOffset.y - dragPreviewNodeOffsetFromClient.y\n };\n const { offsetWidth: sourceWidth , offsetHeight: sourceHeight } = sourceNode;\n const { anchorX , anchorY } = anchorPoint;\n const { dragPreviewWidth , dragPreviewHeight } = getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight);\n const calculateYOffset = ()=>{\n const interpolantY = new MonotonicInterpolant([\n 0,\n 0.5,\n 1\n ], [\n // Dock to the top\n offsetFromDragPreview.y,\n // Align at the center\n (offsetFromDragPreview.y / sourceHeight) * dragPreviewHeight,\n // Dock to the bottom\n offsetFromDragPreview.y + dragPreviewHeight - sourceHeight, \n ]);\n let y = interpolantY.interpolate(anchorY);\n // Work around Safari 8 positioning bug\n if (isSafari() && isImage) {\n // We'll have to wait for @3x to see if this is entirely correct\n y += (window.devicePixelRatio - 1) * dragPreviewHeight;\n }\n return y;\n };\n const calculateXOffset = ()=>{\n // Interpolate coordinates depending on anchor point\n // If you know a simpler way to do this, let me know\n const interpolantX = new MonotonicInterpolant([\n 0,\n 0.5,\n 1\n ], [\n // Dock to the left\n offsetFromDragPreview.x,\n // Align at the center\n (offsetFromDragPreview.x / sourceWidth) * dragPreviewWidth,\n // Dock to the right\n offsetFromDragPreview.x + dragPreviewWidth - sourceWidth, \n ]);\n return interpolantX.interpolate(anchorX);\n };\n // Force offsets if specified in the options.\n const { offsetX , offsetY } = offsetPoint;\n const isManualOffsetX = offsetX === 0 || offsetX;\n const isManualOffsetY = offsetY === 0 || offsetY;\n return {\n x: isManualOffsetX ? offsetX : calculateXOffset(),\n y: isManualOffsetY ? offsetY : calculateYOffset()\n };\n}\n\n//# sourceMappingURL=OffsetUtils.js.map","export class OptionsReader {\n get window() {\n if (this.globalContext) {\n return this.globalContext;\n } else if (typeof window !== 'undefined') {\n return window;\n }\n return undefined;\n }\n get document() {\n var ref;\n if ((ref = this.globalContext) === null || ref === void 0 ? void 0 : ref.document) {\n return this.globalContext.document;\n } else if (this.window) {\n return this.window.document;\n } else {\n return undefined;\n }\n }\n get rootElement() {\n var ref;\n return ((ref = this.optionsArgs) === null || ref === void 0 ? void 0 : ref.rootElement) || this.window;\n }\n constructor(globalContext, options){\n this.ownerDocument = null;\n this.globalContext = globalContext;\n this.optionsArgs = options;\n }\n}\n\n//# sourceMappingURL=OptionsReader.js.map","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _objectSpread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n return target;\n}\nimport { EnterLeaveCounter } from './EnterLeaveCounter.js';\nimport { createNativeDragSource, matchNativeItemType } from './NativeDragSources/index.js';\nimport * as NativeTypes from './NativeTypes.js';\nimport { getDragPreviewOffset, getEventClientOffset, getNodeClientOffset } from './OffsetUtils.js';\nimport { OptionsReader } from './OptionsReader.js';\nexport class HTML5BackendImpl {\n /**\n\t * Generate profiling statistics for the HTML5Backend.\n\t */ profile() {\n var ref, ref1;\n return {\n sourcePreviewNodes: this.sourcePreviewNodes.size,\n sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,\n sourceNodeOptions: this.sourceNodeOptions.size,\n sourceNodes: this.sourceNodes.size,\n dragStartSourceIds: ((ref = this.dragStartSourceIds) === null || ref === void 0 ? void 0 : ref.length) || 0,\n dropTargetIds: this.dropTargetIds.length,\n dragEnterTargetIds: this.dragEnterTargetIds.length,\n dragOverTargetIds: ((ref1 = this.dragOverTargetIds) === null || ref1 === void 0 ? void 0 : ref1.length) || 0\n };\n }\n // public for test\n get window() {\n return this.options.window;\n }\n get document() {\n return this.options.document;\n }\n /**\n\t * Get the root element to use for event subscriptions\n\t */ get rootElement() {\n return this.options.rootElement;\n }\n setup() {\n const root = this.rootElement;\n if (root === undefined) {\n return;\n }\n if (root.__isReactDndBackendSetUp) {\n throw new Error('Cannot have two HTML5 backends at the same time.');\n }\n root.__isReactDndBackendSetUp = true;\n this.addEventListeners(root);\n }\n teardown() {\n const root = this.rootElement;\n if (root === undefined) {\n return;\n }\n root.__isReactDndBackendSetUp = false;\n this.removeEventListeners(this.rootElement);\n this.clearCurrentDragSourceNode();\n if (this.asyncEndDragFrameId) {\n var ref;\n (ref = this.window) === null || ref === void 0 ? void 0 : ref.cancelAnimationFrame(this.asyncEndDragFrameId);\n }\n }\n connectDragPreview(sourceId, node, options) {\n this.sourcePreviewNodeOptions.set(sourceId, options);\n this.sourcePreviewNodes.set(sourceId, node);\n return ()=>{\n this.sourcePreviewNodes.delete(sourceId);\n this.sourcePreviewNodeOptions.delete(sourceId);\n };\n }\n connectDragSource(sourceId, node, options) {\n this.sourceNodes.set(sourceId, node);\n this.sourceNodeOptions.set(sourceId, options);\n const handleDragStart = (e)=>this.handleDragStart(e, sourceId)\n ;\n const handleSelectStart = (e)=>this.handleSelectStart(e)\n ;\n node.setAttribute('draggable', 'true');\n node.addEventListener('dragstart', handleDragStart);\n node.addEventListener('selectstart', handleSelectStart);\n return ()=>{\n this.sourceNodes.delete(sourceId);\n this.sourceNodeOptions.delete(sourceId);\n node.removeEventListener('dragstart', handleDragStart);\n node.removeEventListener('selectstart', handleSelectStart);\n node.setAttribute('draggable', 'false');\n };\n }\n connectDropTarget(targetId, node) {\n const handleDragEnter = (e)=>this.handleDragEnter(e, targetId)\n ;\n const handleDragOver = (e)=>this.handleDragOver(e, targetId)\n ;\n const handleDrop = (e)=>this.handleDrop(e, targetId)\n ;\n node.addEventListener('dragenter', handleDragEnter);\n node.addEventListener('dragover', handleDragOver);\n node.addEventListener('drop', handleDrop);\n return ()=>{\n node.removeEventListener('dragenter', handleDragEnter);\n node.removeEventListener('dragover', handleDragOver);\n node.removeEventListener('drop', handleDrop);\n };\n }\n addEventListeners(target) {\n // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n if (!target.addEventListener) {\n return;\n }\n target.addEventListener('dragstart', this.handleTopDragStart);\n target.addEventListener('dragstart', this.handleTopDragStartCapture, true);\n target.addEventListener('dragend', this.handleTopDragEndCapture, true);\n target.addEventListener('dragenter', this.handleTopDragEnter);\n target.addEventListener('dragenter', this.handleTopDragEnterCapture, true);\n target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true);\n target.addEventListener('dragover', this.handleTopDragOver);\n target.addEventListener('dragover', this.handleTopDragOverCapture, true);\n target.addEventListener('drop', this.handleTopDrop);\n target.addEventListener('drop', this.handleTopDropCapture, true);\n }\n removeEventListeners(target) {\n // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813\n if (!target.removeEventListener) {\n return;\n }\n target.removeEventListener('dragstart', this.handleTopDragStart);\n target.removeEventListener('dragstart', this.handleTopDragStartCapture, true);\n target.removeEventListener('dragend', this.handleTopDragEndCapture, true);\n target.removeEventListener('dragenter', this.handleTopDragEnter);\n target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true);\n target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true);\n target.removeEventListener('dragover', this.handleTopDragOver);\n target.removeEventListener('dragover', this.handleTopDragOverCapture, true);\n target.removeEventListener('drop', this.handleTopDrop);\n target.removeEventListener('drop', this.handleTopDropCapture, true);\n }\n getCurrentSourceNodeOptions() {\n const sourceId = this.monitor.getSourceId();\n const sourceNodeOptions = this.sourceNodeOptions.get(sourceId);\n return _objectSpread({\n dropEffect: this.altKeyPressed ? 'copy' : 'move'\n }, sourceNodeOptions || {});\n }\n getCurrentDropEffect() {\n if (this.isDraggingNativeItem()) {\n // It makes more sense to default to 'copy' for native resources\n return 'copy';\n }\n return this.getCurrentSourceNodeOptions().dropEffect;\n }\n getCurrentSourcePreviewNodeOptions() {\n const sourceId = this.monitor.getSourceId();\n const sourcePreviewNodeOptions = this.sourcePreviewNodeOptions.get(sourceId);\n return _objectSpread({\n anchorX: 0.5,\n anchorY: 0.5,\n captureDraggingState: false\n }, sourcePreviewNodeOptions || {});\n }\n isDraggingNativeItem() {\n const itemType = this.monitor.getItemType();\n return Object.keys(NativeTypes).some((key)=>NativeTypes[key] === itemType\n );\n }\n beginDragNativeItem(type, dataTransfer) {\n this.clearCurrentDragSourceNode();\n this.currentNativeSource = createNativeDragSource(type, dataTransfer);\n this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource);\n this.actions.beginDrag([\n this.currentNativeHandle\n ]);\n }\n setCurrentDragSourceNode(node) {\n this.clearCurrentDragSourceNode();\n this.currentDragSourceNode = node;\n // A timeout of > 0 is necessary to resolve Firefox issue referenced\n // See:\n // * https://github.com/react-dnd/react-dnd/pull/928\n // * https://github.com/react-dnd/react-dnd/issues/869\n const MOUSE_MOVE_TIMEOUT = 1000;\n // Receiving a mouse event in the middle of a dragging operation\n // means it has ended and the drag source node disappeared from DOM,\n // so the browser didn't dispatch the dragend event.\n //\n // We need to wait before we start listening for mousemove events.\n // This is needed because the drag preview needs to be drawn or else it fires an 'mousemove' event\n // immediately in some browsers.\n //\n // See:\n // * https://github.com/react-dnd/react-dnd/pull/928\n // * https://github.com/react-dnd/react-dnd/issues/869\n //\n this.mouseMoveTimeoutTimer = setTimeout(()=>{\n var ref;\n return (ref = this.rootElement) === null || ref === void 0 ? void 0 : ref.addEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);\n }, MOUSE_MOVE_TIMEOUT);\n }\n clearCurrentDragSourceNode() {\n if (this.currentDragSourceNode) {\n this.currentDragSourceNode = null;\n if (this.rootElement) {\n var ref;\n (ref = this.window) === null || ref === void 0 ? void 0 : ref.clearTimeout(this.mouseMoveTimeoutTimer || undefined);\n this.rootElement.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);\n }\n this.mouseMoveTimeoutTimer = null;\n return true;\n }\n return false;\n }\n handleDragStart(e, sourceId) {\n if (e.defaultPrevented) {\n return;\n }\n if (!this.dragStartSourceIds) {\n this.dragStartSourceIds = [];\n }\n this.dragStartSourceIds.unshift(sourceId);\n }\n handleDragEnter(_e, targetId) {\n this.dragEnterTargetIds.unshift(targetId);\n }\n handleDragOver(_e, targetId) {\n if (this.dragOverTargetIds === null) {\n this.dragOverTargetIds = [];\n }\n this.dragOverTargetIds.unshift(targetId);\n }\n handleDrop(_e, targetId) {\n this.dropTargetIds.unshift(targetId);\n }\n constructor(manager, globalContext, options){\n this.sourcePreviewNodes = new Map();\n this.sourcePreviewNodeOptions = new Map();\n this.sourceNodes = new Map();\n this.sourceNodeOptions = new Map();\n this.dragStartSourceIds = null;\n this.dropTargetIds = [];\n this.dragEnterTargetIds = [];\n this.currentNativeSource = null;\n this.currentNativeHandle = null;\n this.currentDragSourceNode = null;\n this.altKeyPressed = false;\n this.mouseMoveTimeoutTimer = null;\n this.asyncEndDragFrameId = null;\n this.dragOverTargetIds = null;\n this.lastClientOffset = null;\n this.hoverRafId = null;\n this.getSourceClientOffset = (sourceId)=>{\n const source = this.sourceNodes.get(sourceId);\n return source && getNodeClientOffset(source) || null;\n };\n this.endDragNativeItem = ()=>{\n if (!this.isDraggingNativeItem()) {\n return;\n }\n this.actions.endDrag();\n if (this.currentNativeHandle) {\n this.registry.removeSource(this.currentNativeHandle);\n }\n this.currentNativeHandle = null;\n this.currentNativeSource = null;\n };\n this.isNodeInDocument = (node)=>{\n // Check the node either in the main document or in the current context\n return Boolean(node && this.document && this.document.body && this.document.body.contains(node));\n };\n this.endDragIfSourceWasRemovedFromDOM = ()=>{\n const node = this.currentDragSourceNode;\n if (node == null || this.isNodeInDocument(node)) {\n return;\n }\n if (this.clearCurrentDragSourceNode() && this.monitor.isDragging()) {\n this.actions.endDrag();\n }\n this.cancelHover();\n };\n this.scheduleHover = (dragOverTargetIds)=>{\n if (this.hoverRafId === null && typeof requestAnimationFrame !== 'undefined') {\n this.hoverRafId = requestAnimationFrame(()=>{\n if (this.monitor.isDragging()) {\n this.actions.hover(dragOverTargetIds || [], {\n clientOffset: this.lastClientOffset\n });\n }\n this.hoverRafId = null;\n });\n }\n };\n this.cancelHover = ()=>{\n if (this.hoverRafId !== null && typeof cancelAnimationFrame !== 'undefined') {\n cancelAnimationFrame(this.hoverRafId);\n this.hoverRafId = null;\n }\n };\n this.handleTopDragStartCapture = ()=>{\n this.clearCurrentDragSourceNode();\n this.dragStartSourceIds = [];\n };\n this.handleTopDragStart = (e)=>{\n if (e.defaultPrevented) {\n return;\n }\n const { dragStartSourceIds } = this;\n this.dragStartSourceIds = null;\n const clientOffset = getEventClientOffset(e);\n // Avoid crashing if we missed a drop event or our previous drag died\n if (this.monitor.isDragging()) {\n this.actions.endDrag();\n this.cancelHover();\n }\n // Don't publish the source just yet (see why below)\n this.actions.beginDrag(dragStartSourceIds || [], {\n publishSource: false,\n getSourceClientOffset: this.getSourceClientOffset,\n clientOffset\n });\n const { dataTransfer } = e;\n const nativeType = matchNativeItemType(dataTransfer);\n if (this.monitor.isDragging()) {\n if (dataTransfer && typeof dataTransfer.setDragImage === 'function') {\n // Use custom drag image if user specifies it.\n // If child drag source refuses drag but parent agrees,\n // use parent's node as drag image. Neither works in IE though.\n const sourceId = this.monitor.getSourceId();\n const sourceNode = this.sourceNodes.get(sourceId);\n const dragPreview = this.sourcePreviewNodes.get(sourceId) || sourceNode;\n if (dragPreview) {\n const { anchorX , anchorY , offsetX , offsetY } = this.getCurrentSourcePreviewNodeOptions();\n const anchorPoint = {\n anchorX,\n anchorY\n };\n const offsetPoint = {\n offsetX,\n offsetY\n };\n const dragPreviewOffset = getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint);\n dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);\n }\n }\n try {\n // Firefox won't drag without setting data\n dataTransfer === null || dataTransfer === void 0 ? void 0 : dataTransfer.setData('application/json', {});\n } catch (err) {\n // IE doesn't support MIME types in setData\n }\n // Store drag source node so we can check whether\n // it is removed from DOM and trigger endDrag manually.\n this.setCurrentDragSourceNode(e.target);\n // Now we are ready to publish the drag source.. or are we not?\n const { captureDraggingState } = this.getCurrentSourcePreviewNodeOptions();\n if (!captureDraggingState) {\n // Usually we want to publish it in the next tick so that browser\n // is able to screenshot the current (not yet dragging) state.\n //\n // It also neatly avoids a situation where render() returns null\n // in the same tick for the source element, and browser freaks out.\n setTimeout(()=>this.actions.publishDragSource()\n , 0);\n } else {\n // In some cases the user may want to override this behavior, e.g.\n // to work around IE not supporting custom drag previews.\n //\n // When using a custom drag layer, the only way to prevent\n // the default drag preview from drawing in IE is to screenshot\n // the dragging state in which the node itself has zero opacity\n // and height. In this case, though, returning null from render()\n // will abruptly end the dragging, which is not obvious.\n //\n // This is the reason such behavior is strictly opt-in.\n this.actions.publishDragSource();\n }\n } else if (nativeType) {\n // A native item (such as URL) dragged from inside the document\n this.beginDragNativeItem(nativeType);\n } else if (dataTransfer && !dataTransfer.types && (e.target && !e.target.hasAttribute || !e.target.hasAttribute('draggable'))) {\n // Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.\n // Just let it drag. It's a native type (URL or text) and will be picked up in\n // dragenter handler.\n return;\n } else {\n // If by this time no drag source reacted, tell browser not to drag.\n e.preventDefault();\n }\n };\n this.handleTopDragEndCapture = ()=>{\n if (this.clearCurrentDragSourceNode() && this.monitor.isDragging()) {\n // Firefox can dispatch this event in an infinite loop\n // if dragend handler does something like showing an alert.\n // Only proceed if we have not handled it already.\n this.actions.endDrag();\n }\n this.cancelHover();\n };\n this.handleTopDragEnterCapture = (e)=>{\n this.dragEnterTargetIds = [];\n if (this.isDraggingNativeItem()) {\n var ref;\n (ref = this.currentNativeSource) === null || ref === void 0 ? void 0 : ref.loadDataTransfer(e.dataTransfer);\n }\n const isFirstEnter = this.enterLeaveCounter.enter(e.target);\n if (!isFirstEnter || this.monitor.isDragging()) {\n return;\n }\n const { dataTransfer } = e;\n const nativeType = matchNativeItemType(dataTransfer);\n if (nativeType) {\n // A native item (such as file or URL) dragged from outside the document\n this.beginDragNativeItem(nativeType, dataTransfer);\n }\n };\n this.handleTopDragEnter = (e)=>{\n const { dragEnterTargetIds } = this;\n this.dragEnterTargetIds = [];\n if (!this.monitor.isDragging()) {\n // This is probably a native item type we don't understand.\n return;\n }\n this.altKeyPressed = e.altKey;\n // If the target changes position as the result of `dragenter`, `dragover` might still\n // get dispatched despite target being no longer there. The easy solution is to check\n // whether there actually is a target before firing `hover`.\n if (dragEnterTargetIds.length > 0) {\n this.actions.hover(dragEnterTargetIds, {\n clientOffset: getEventClientOffset(e)\n });\n }\n const canDrop = dragEnterTargetIds.some((targetId)=>this.monitor.canDropOnTarget(targetId)\n );\n if (canDrop) {\n // IE requires this to fire dragover events\n e.preventDefault();\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = this.getCurrentDropEffect();\n }\n }\n };\n this.handleTopDragOverCapture = (e)=>{\n this.dragOverTargetIds = [];\n if (this.isDraggingNativeItem()) {\n var ref;\n (ref = this.currentNativeSource) === null || ref === void 0 ? void 0 : ref.loadDataTransfer(e.dataTransfer);\n }\n };\n this.handleTopDragOver = (e)=>{\n const { dragOverTargetIds } = this;\n this.dragOverTargetIds = [];\n if (!this.monitor.isDragging()) {\n // This is probably a native item type we don't understand.\n // Prevent default \"drop and blow away the whole document\" action.\n e.preventDefault();\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = 'none';\n }\n return;\n }\n this.altKeyPressed = e.altKey;\n this.lastClientOffset = getEventClientOffset(e);\n this.scheduleHover(dragOverTargetIds);\n const canDrop = (dragOverTargetIds || []).some((targetId)=>this.monitor.canDropOnTarget(targetId)\n );\n if (canDrop) {\n // Show user-specified drop effect.\n e.preventDefault();\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = this.getCurrentDropEffect();\n }\n } else if (this.isDraggingNativeItem()) {\n // Don't show a nice cursor but still prevent default\n // \"drop and blow away the whole document\" action.\n e.preventDefault();\n } else {\n e.preventDefault();\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = 'none';\n }\n }\n };\n this.handleTopDragLeaveCapture = (e)=>{\n if (this.isDraggingNativeItem()) {\n e.preventDefault();\n }\n const isLastLeave = this.enterLeaveCounter.leave(e.target);\n if (!isLastLeave) {\n return;\n }\n if (this.isDraggingNativeItem()) {\n setTimeout(()=>this.endDragNativeItem()\n , 0);\n }\n this.cancelHover();\n };\n this.handleTopDropCapture = (e)=>{\n this.dropTargetIds = [];\n if (this.isDraggingNativeItem()) {\n var ref;\n e.preventDefault();\n (ref = this.currentNativeSource) === null || ref === void 0 ? void 0 : ref.loadDataTransfer(e.dataTransfer);\n } else if (matchNativeItemType(e.dataTransfer)) {\n // Dragging some elements, like and may still behave like a native drag event,\n // even if the current drag event matches a user-defined type.\n // Stop the default behavior when we're not expecting a native item to be dropped.\n e.preventDefault();\n }\n this.enterLeaveCounter.reset();\n };\n this.handleTopDrop = (e)=>{\n const { dropTargetIds } = this;\n this.dropTargetIds = [];\n this.actions.hover(dropTargetIds, {\n clientOffset: getEventClientOffset(e)\n });\n this.actions.drop({\n dropEffect: this.getCurrentDropEffect()\n });\n if (this.isDraggingNativeItem()) {\n this.endDragNativeItem();\n } else if (this.monitor.isDragging()) {\n this.actions.endDrag();\n }\n this.cancelHover();\n };\n this.handleSelectStart = (e)=>{\n const target = e.target;\n // Only IE requires us to explicitly say\n // we want drag drop operation to start\n if (typeof target.dragDrop !== 'function') {\n return;\n }\n // Inputs and textareas should be selectable\n if (target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return;\n }\n // For other targets, ask IE\n // to enable drag and drop\n e.preventDefault();\n target.dragDrop();\n };\n this.options = new OptionsReader(globalContext, options);\n this.actions = manager.getActions();\n this.monitor = manager.getMonitor();\n this.registry = manager.getRegistry();\n this.enterLeaveCounter = new EnterLeaveCounter(this.isNodeInDocument);\n }\n}\n\n//# sourceMappingURL=HTML5BackendImpl.js.map","import { HTML5BackendImpl } from './HTML5BackendImpl.js';\nimport * as _NativeTypes from './NativeTypes.js';\nexport { getEmptyImage } from './getEmptyImage.js';\nexport { _NativeTypes as NativeTypes };\nexport const HTML5Backend = function createBackend(manager, context, options) {\n return new HTML5BackendImpl(manager, context, options);\n};\n\n//# sourceMappingURL=index.js.map","'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isHeaders(header)) {\n for (const [key, value] of header.entries()) {\n setHeader(value, key, rewrite);\n }\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst composeSignals = (signals, timeout) => {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (cancel) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = cancel instanceof Error ? cancel : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal &&\n (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = unsubscribe;\n\n return [signal, () => {\n timer && clearTimeout(timer);\n timer = null;\n }];\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize, encode) {\n for await (const chunk of iterable) {\n yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {\n const iterator = readBytes(stream, chunkSize, encode);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils.isBlob(body)) {\n return body.size;\n }\n\n if(utils.isSpecCompliantForm(body)) {\n return (await new Request(body).arrayBuffer()).byteLength;\n }\n\n if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n}\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n}\n\nexport default isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?\n composeSignals([signal, cancelToken], timeout) : [];\n\n let finished, request;\n\n const onFinish = () => {\n !finished && setTimeout(() => {\n composedSignal && composedSignal.unsubscribe();\n });\n\n finished = true;\n }\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: withCredentials\n });\n\n let response = await fetch(request);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n isStreamResponse && onFinish();\n }, encodeText),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && onFinish();\n\n stopTimeout && stopTimeout();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n onFinish();\n\n if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\n\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.7.4\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","import { createContext, useEffect, useState, useCallback } from 'react';\nimport { ProviderProps } from \"./ContextTypes\";\nimport { UserData } from \"./User\";\nimport axios from \"axios\";\nimport { apiFetch, eventEmitter } from '.';\n\nexport interface Transcript {\n id: string;\n createdAt: string;\n createdBy: UserData;\n title: string;\n body?: string;\n metadata: unknown;\n}\n\nasync function getTranscript(id: string): Promise {\n return await apiFetch(`/transcript/${id}`, { method: \"GET\" });\n}\n\nasync function getTranscripts(page: number): Promise {\n return await apiFetch(`/transcript/list/${page}`, { method: \"GET\" });\n}\n\nasync function addTranscript(form: FormData): Promise {\n return await axios.post('/transcript', form, {\n headers: {\n \"Content-Type\": \"multipart/form-data\"\n }\n });\n}\n\nasync function addTranscriptFiles(targetFiles: FileList, meta?: object) {\n const addedTranscripts = [];\n for (const file of targetFiles) {\n const title = file.name;\n const formData = new FormData();\n formData.append(title, file)\n const metadata = {\n ...meta,\n lastModified: file.lastModified,\n type: file.type,\n size: file.size\n };\n formData.append(\"metadata\", JSON.stringify(metadata));\n try {\n const transcript = await addTranscript(formData);\n addedTranscripts.push(transcript);\n } catch (err) {\n eventEmitter.emit(\"ERROR\", `Could not upload transcript ${title}: ${err}`);\n break;\n }\n }\n return addedTranscripts;\n}\n\nexport interface DataContextProps {\n transcripts: Transcript[],\n hasNextPage: boolean,\n loadNextPage: () => void,\n clearTranscriptCache: () => void,\n getTranscript: (transcriptId: string) => Promise,\n addTranscripts: (targetFiles: FileList) => void,\n}\nexport const DataContext = createContext(undefined);\n\nconst fetchTranscripts = async (setHasNextPage: (value: boolean) => void,\n setTranscripts: (value: Transcript[]) => void,\n setPage: (value: number) => void,\n transcripts: Transcript[],\n page: number) => {\n const newTranscripts = await getTranscripts(page);\n if (newTranscripts.length === 0) {\n setHasNextPage(false);\n } else {\n setTranscripts([...transcripts, ...newTranscripts]);\n setPage(page + 1);\n }\n};\n\nconst DataProvider: React.FC = ({ children }) => {\n const [transcripts, setTranscripts] = useState([]);\n const [page, setPage] = useState(1);\n const [hasNextPage, setHasNextPage] = useState(true);\n const [dataCache, setDataCache] = useState(Date.now());\n\n const loadNextPage = useCallback(() => {\n fetchTranscripts(setHasNextPage, setTranscripts, setPage, transcripts, page);\n }, [page, transcripts]);\n\n useEffect(() => {\n setPage(1);\n setTranscripts([]);\n setHasNextPage(true);\n fetchTranscripts(setHasNextPage, setTranscripts, setPage, [], 1);\n }, [dataCache]);\n\n const addTranscripts = useCallback((files: FileList, meta?: object) => {\n addTranscriptFiles(files, meta).then((newTranscripts) => setTranscripts([...transcripts, ...newTranscripts]));\n }, [transcripts]);\n\n const value = {\n transcripts,\n hasNextPage,\n loadNextPage,\n clearTranscriptCache: () => setDataCache(Date.now()),\n getTranscript,\n addTranscripts,\n };\n\n return (\n {children}\n );\n}\nexport default DataProvider;\n","import { createContext, useEffect, useState, useCallback } from 'react';\nimport { ProviderProps } from \"./ContextTypes\";\nimport { apiFetch, apiFetchNoContent, eventEmitter, isDevelopment } from '.';\n\nfunction testMilestones(): Milestone[] {\n const milestones = [\n {\n id: \"2\",\n orgId: \"2\",\n milestoneType: \"checkpoint\",\n name: \"Milestone 2\",\n description: \"Description 1\",\n dueDate: \"2024-09-01T00:00:00\",\n created: \"2024-08-01T00:00:00\",\n completed: false,\n started: true,\n startDate: \"2024-08-01T00:00:00\",\n },\n {\n id: \"1\",\n orgId: \"1\",\n milestoneType: \"checkpoint\",\n name: \"Milestone 1\",\n description: \"Description 1\",\n dueDate: \"2024-09-01T00:00:00\",\n created: \"2024-08-01T00:00:00\",\n completedDate: \"2024-08-01T00:00:00\",\n completed: true,\n started: true,\n startDate: \"2024-08-01T00:00:00\",\n },\n ];\n return milestones;\n}\n\nexport interface Milestone {\n id: string;\n orgId: string;\n milestoneType: string;\n name: string;\n description: string;\n dueDate?: string;\n created: string;\n completed: boolean;\n completedDate?: string;\n started: boolean;\n startDate?: string;\n}\n\nexport interface NewMilestone {\n name: string;\n description: string;\n milestoneType: unknown;\n dueDate?: string;\n startDate?: string;\n}\n\nexport type UpdateMilestone = { \"name\": string } | { \"description\": string } | { \"type\": string } | { \"dueDate\": string } | { \"completed\": boolean };\n\nasync function getMilestone(milestoneId: string): Promise {\n return await apiFetch(`/milestone/${milestoneId}`, { method: \"GET\" });\n}\n\nasync function getMilestones(page: number): Promise {\n if (page === 1 && isDevelopment) {\n return testMilestones();\n }\n return await apiFetch(`/milestone/list/${page}`, { method: \"GET\" });\n}\n\nasync function postMilestone(milestone: NewMilestone): Promise {\n return await apiFetch('/milestone', {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(milestone)\n });\n}\n\nasync function removeMilestone(milestoneId: string): Promise {\n try {\n await apiFetchNoContent(`/milestone/${milestoneId}`, { method: \"DELETE\" });\n return true;\n } catch (e) {\n console.error(e);\n return false;\n }\n}\n\nasync function putUpdateMilestone(milestoneId: string, update: UpdateMilestone): Promise {\n return await apiFetch(`/milestone/${milestoneId}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(update)\n });\n}\n\nexport interface MilestoneContextProps {\n milestones: Milestone[],\n hasNextPage: boolean,\n loadNextPage: () => void,\n clearMilestoneCache: () => void,\n createMilestone: (milestone: NewMilestone) => Promise,\n deleteMilestone: (milestoneId: string) => Promise,\n getMilestone: (milestoneId: string) => Promise,\n updateMilestone: (milestoneId: string, update: UpdateMilestone) => Promise,\n}\n\nexport const MilestoneContext = createContext(undefined);\n\nconst fetchMilestones = async (setHasNextPage: (value: boolean) => void,\n setMilestones: (value: Milestone[]) => void,\n setPage: (value: number) => void,\n milestones: Milestone[],\n page: number) => {\n const newMilestones = await getMilestones(page);\n if (newMilestones.length === 0) {\n setHasNextPage(false);\n } else {\n setMilestones([...milestones, ...newMilestones]);\n setPage(page + 1);\n }\n};\n\nconst MilestoneProvider: React.FC = ({ children }) => {\n const [milestones, setMilestones] = useState([]);\n const [page, setPage] = useState(1);\n const [hasNextPage, setHasNextPage] = useState(true);\n const [dataCache, setMilestoneCache] = useState(Date.now());\n\n const loadNextPage = useCallback(() => {\n fetchMilestones(setHasNextPage, setMilestones, setPage, milestones, page);\n }, [page, milestones]);\n\n useEffect(() => {\n setPage(1);\n setMilestones([]);\n setHasNextPage(true);\n fetchMilestones(setHasNextPage, setMilestones, setPage, [], 1);\n }, [dataCache]);\n\n const createMilestone = useCallback(async (milestone: NewMilestone) => {\n try {\n const newMilestone = await postMilestone(milestone);\n setMilestones([...milestones, newMilestone]);\n } catch (e) {\n eventEmitter.emit(\"ERROR\", \"Failed to create milestone\");\n }\n }, [milestones]);\n\n const deleteMilestone = useCallback(async (milestoneId: string) => {\n if (await removeMilestone(milestoneId)) {\n const newMilestones = milestones.filter((m) => m.id !== milestoneId);\n setMilestones(newMilestones);\n } else {\n eventEmitter.emit(\"ERROR\", \"Failed to delete milestone\");\n }\n }, [milestones]);\n\n const updateMilestone = useCallback(async (milestoneId: string, update: UpdateMilestone) => {\n await putUpdateMilestone(milestoneId, update);\n const milestone = await getMilestone(milestoneId);\n const index = milestones.findIndex((m) => m.id === milestoneId);\n setMilestones([...milestones.slice(0, index), milestone, ...milestones.slice(index + 1)]);\n }, [milestones]);\n\n const value = {\n milestones,\n hasNextPage,\n loadNextPage,\n clearMilestoneCache: () => setMilestoneCache(Date.now()),\n createMilestone,\n deleteMilestone,\n getMilestone,\n updateMilestone,\n };\n\n return (\n {children}\n );\n}\nexport default MilestoneProvider;\n\n","import React from \"react\";\nimport { ProviderProps } from \"./ContextTypes\";\nimport { TaskUpdate } from \"./Task\";\nimport { eventEmitter, isDevelopment, useAppContext } from \".\";\n\nexport type Content = { text: string } | { object: object };\nexport type MessageState = \"ongoing\" | \"message\";\nexport interface Chat {\n role: string;\n content: Content;\n state?: MessageState;\n}\n\nexport interface ConsentTask {\n id: string;\n title: string;\n description: string;\n tags: string[];\n components: string[];\n}\n\nexport interface ConsentTaskUpdateWrapper {\n task: ConsentTask;\n update: TaskUpdate | string;\n}\n\nexport interface ConsentProject {\n title: string;\n description: string;\n}\nexport type ConsentRequest = { task: ConsentTask } | { taskUpdate: ConsentTaskUpdateWrapper } | { project: ConsentProject };\n\nexport interface Consent {\n consentId: string;\n payload: ConsentRequest\n}\n\nexport interface TipPayload {\n content: string;\n icon?: string;\n}\n\nexport interface Tip {\n tipId: string;\n payload: TipPayload;\n}\n\nexport type Message = Chat | Consent | Tip;\n\nexport interface InstructionContextProps {\n messages: Message[];\n addMessage: (message: Message) => void;\n clearMessages: () => void;\n onAcceptConsent: (index: number, content: string) => void;\n onRejectConsent: (index: number) => void;\n onAcceptAllConsent: () => void;\n onRejectAllConsent: () => void;\n\n conversationOpen: boolean;\n setConversationOpen: (open: boolean) => void;\n}\n\nexport const InstructionContext = React.createContext(undefined);\n\nfunction acceptString(payload: ConsentRequest): string {\n if (\"task\" in payload) {\n return `Created ${payload.task.title}`;\n } else if (\"taskUpdate\" in payload) {\n return `Updated ${payload.taskUpdate.task.id}`;\n } else if (\"project\" in payload) {\n return `Created ${payload.project.title}`;\n } else {\n return \"\";\n }\n}\n\nconst InstructionProvider: React.FC = ({ children }) => {\n const { sendWebMessage, socketIsConnected } = useAppContext();\n const [conversationOpen, setConversationOpen] = React.useState(false);\n const [messages, setMessages] = React.useState([]);\n\n const addMessage = React.useCallback((msg: Message) => {\n setMessages((currentItems) => [...currentItems, msg]);\n }, []);\n\n const clearMessages = React.useCallback(() => {\n setMessages([]);\n }, []);\n\n React.useEffect(() => {\n if (isDevelopment) {\n setMessages([\n { tipId: \"0\", payload: { \"icon\": \"lightbulb\", \"content\": \"This is a tip! It has a lot of words so we can see what overlapping looks like\" } },\n { tipId: \"1\", payload: { \"icon\": \"console\", \"content\": \"This is a tip! It has a lot of words so we can see what overlapping looks like\" } },\n { tipId: \"2\", payload: { \"icon\": \"pen\", \"content\": \"This is a tip! It has a lot of words so we can see what overlapping looks like\" } },\n { role: \"user\", content: { text: \"Hello\" } },\n { role: \"assistant\", content: { text: \"Hi there!\" } },\n { role: \"user\", content: { text: \"How are you?\" } },\n { role: \"assistant\", content: { text: \"I'm doing well, thank you!\" } },\n { role: \"error\", content: { text: \"This is a system message\" } },\n { consentId: \"0\", payload: { project: { title: \"Consent Project\", description: \"This is a project I would like to create\" } } },\n { consentId: \"1\", payload: { task: { id: \"1\", title: \"Consent Task\", description: \"This is a task I would like to create\", tags: [\"tag1\", \"tag2\"], components: [\"component1\", \"component2\"] } } },\n { consentId: \"2\", payload: { task: { id: \"2\", title: \"Consent Task 2\", description: \"This is a another task with an exceptionally long message so I can see what happens when the AI invariably types way too much to fit into the box. Here, we are writing so much text it's a wonder anyone would consider reading it all. For sure this is a crazy time for all of us to be blessed with this much conversation. But I hope it ends soon because we can't be overdoing ourselves in one go here! We need to parcel out the glorous text so we can truly savor the moment and enjoy every word as written. I hope you too will join me in welcoming this text to the screen.\", tags: [\"tag1\", \"tag2\"], components: [\"component1\", \"component2\"] } } },\n ]);\n }\n }, []);\n\n const sendConsentMessage = React.useCallback((consentId: string, consented: boolean, content: string | null) => {\n if (!socketIsConnected) {\n console.error(\"Websocket is not connected\");\n return;\n }\n sendWebMessage({ instruct: { consent: { consentId, message: content, state: consented ? \"accept\" : \"deny\" } } });\n }, [sendWebMessage, socketIsConnected]);\n\n const onAcceptAllConsent = React.useCallback(() => {\n for (let i = 0; i < messages.length; i++) {\n const message = messages[i];\n if (\"consentId\" in message) {\n const consentId: string = message.consentId\n const response = acceptString(message.payload);\n sendConsentMessage(consentId, true, response);\n }\n }\n const remainingMessages = messages.filter((message) => !(\"consentId\" in message));\n setMessages(remainingMessages);\n }, [messages, sendConsentMessage]);\n\n const onRejectAllConsent = React.useCallback(() => {\n for (let i = 0; i < messages.length; i++) {\n const message = messages[i];\n if (\"consentId\" in message) {\n const consentId: string = message.consentId\n sendConsentMessage(consentId, false, null);\n }\n }\n const remainingMessages = messages.filter((message) => !(\"consentId\" in message));\n setMessages(remainingMessages);\n }, [messages, sendConsentMessage]);\n\n const onAcceptConsent = React.useCallback((index: number, content: string) => {\n const message = messages[index];\n if (\"consentId\" in message) {\n const consentId: string = message.consentId\n sendConsentMessage(consentId, true, content);\n }\n setMessages((messages) => {\n console.log(\"Replacing message at index\", index);\n return [\n ...messages.slice(0, index),\n ...messages.slice(index + 1),\n ];\n });\n }, [messages, sendConsentMessage]);\n\n const onRejectConsent = React.useCallback((index: number) => {\n const message = messages[index];\n if (\"consentId\" in message) {\n const consentId: string = message.consentId\n sendConsentMessage(consentId, false, null);\n }\n setMessages((messages) => {\n console.log(\"Replacing message at index\", index);\n return [\n ...messages.slice(0, index),\n ...messages.slice(index + 1),\n ];\n });\n }, [messages, sendConsentMessage]);\n\n React.useEffect(() => {\n eventEmitter.on(\"INSTRUCT-MESSAGE\", addMessage);\n eventEmitter.on(\"INSTRUCT-CONSENT-REQUEST\", addMessage);\n eventEmitter.on(\"INSTRUCT-CLEAR\", clearMessages);\n\n return () => {\n eventEmitter.off(\"INSTRUCT-MESSAGE\", addMessage);\n eventEmitter.off(\"INSTRUCT-CONSENT-REQUEST\", addMessage);\n eventEmitter.off(\"INSTRUCT-CLEAR\", clearMessages);\n };\n }, [addMessage, clearMessages]);\n\n const value = {\n messages,\n addMessage,\n clearMessages,\n conversationOpen,\n setConversationOpen,\n onAcceptConsent,\n onRejectConsent,\n onAcceptAllConsent,\n onRejectAllConsent,\n };\n return (\n {children}\n );\n};\nexport default InstructionProvider;\n","export function getFont(element: HTMLElement): string {\n const computedStyle = window.getComputedStyle(element);\n return computedStyle.font;\n}\n\nexport function getTextWidth(text: string, font: string): number {\n // Create an off-screen canvas element\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n throw new Error(\"Unable to get 2D context for canvas.\");\n }\n\n // Set the context's font to the specified font style\n context.font = font;\n\n // Measure the width of the text\n const metrics = context.measureText(text);\n return metrics.width;\n}\n\nconst uuidRegex = new RegExp('^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$');\nexport function testUuid(candidate: string): boolean {\n return uuidRegex.test(candidate);\n}\n","export default \"__VITE_ASSET__DNRScG3S__\"","import { UserData } from \"./User\";\nimport React, { createContext, useCallback, useState, useEffect, useMemo } from 'react';\nimport { eventEmitter, apiFetch, isDevelopment, useProjectsContext } from \".\";\nimport { ProviderProps } from \"./ContextTypes\";\n\nimport { testUuid } from \"@/tools\";\nimport defaultImage from \"@/assets/unknown.jpg\";\nimport beEng from \"@/assets/fe-eng-light.webp\";\nimport feEng from \"@/assets/fe-eng.webp\";\nimport feMan from \"@/assets/fe-manager.webp\";\n\ninterface ProjectMetadataResponse { metadata: object[] }\n\nasync function getProjectMeta(projectId: string): Promise {\n const response = await apiFetch(`/project/${projectId}/metadata`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n return response.metadata;\n}\n\nexport type Option = { id: number; label: string; value: string; };\n\nexport interface TagComponent {\n component: string;\n}\n\nexport interface TagLabel {\n label: string;\n}\nexport type Tag = TagComponent | TagLabel;\n\nexport interface Milestone {\n milestoneType: string;\n name: string;\n description: string;\n dueDate?: string;\n created: string;\n completed: boolean;\n completedDate?: string;\n}\n\nexport interface TaskData {\n id: string;\n slug: string;\n created: string;\n title: string;\n titleSummaries: string[];\n description: string;\n author: UserData;\n assignee?: UserData;\n abstractState: string;\n priority: number;\n dueDate?: string;\n milestone?: Milestone;\n}\n\nfunction testTasks(): TaskData[] {\n const tasks = [\n {\n id: \"21e06126-ac0f-4698-ba01-acc4d0cb9c2e\",\n slug: \"WELCOME-0\",\n created: \"2024-01-01T00:00:00\",\n title: \"A task with a very long description\",\n titleSummaries: [\"Long description\", \"Long desc\"],\n description: `# Use Environment Variables To Pass Secrets To Your Application\nAs discussed earlier, use environment variables to distinguish between development and production environments.\n[Google](https://www.google.com)\n\n## Separate Test Code into Modules\nPlace your test code or development-only code in separate modules/files.\n\n### Conditionally Import Test Modules\nUse dynamic imports with environment checks. This makes sure that the test code is only imported and used in the development build.\n `,\n author: {\n id: \"ef991a7e-9c1f-4fae-922d-1bf73d2e563d\",\n created: \"2024-01-01T00:00:00\",\n username: \"CARMACK\",\n email: \"carmack@subseq.io\",\n imageId: defaultImage,\n jobTitle: \"Software Architect\",\n },\n assignee: {\n id: \"7e2fd3e6-f6a7-4261-84ed-b31cfdbe9804\",\n created: \"2024-01-01T00:00:00\",\n username: \"COCO\",\n email: \"coco@subseq.io\",\n imageId: beEng,\n jobTitle: \"Backend Engineer\",\n },\n abstractState: 'closed',\n priority: 1,\n },\n {\n id: \"dca4e0e4-81b8-4a09-8500-0ec8e8db694e\",\n slug: \"WELCOME-1\",\n created: \"2024-01-01T00:00:00\",\n title: \"Create a great UI\",\n titleSummaries: [\"great UI\"],\n description: \"Vite + React + TSX -> All the juice\",\n author: {\n id: \"181215e4-4b2b-4820-b057-a7a827c59fba\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\",\n },\n assignee: {\n id: \"b73a3ff6-335f-4527-ba4e-9d55e5cee261\",\n created: \"2024-01-01T00:00:00\",\n username: \"FILIP\",\n email: \"filip@subseq.io\",\n imageId: feEng,\n jobTitle: \"Frontend Engineer\",\n },\n abstractState: 'inProgress',\n dueDate: \"2024-07-01T12:00:00Z\",\n milestone: {\n milestoneType: \"deadline: commitment\",\n name: \"Promise\",\n description: \"Promise to Gabe\",\n dueDate: \"2024-07-01T12:00:00Z\",\n created: \"2024-04-01T12:00:00Z\",\n completed: false,\n },\n priority: 0,\n },\n {\n id: \"3db04396-93f6-42de-ae77-814572788ea5\",\n slug: \"WELCOME-2\",\n created: \"2024-01-01T00:00:00\",\n title: \"Populate more tasks\",\n titleSummaries: [\"More tasks\"],\n description: \"We need a lot of tasks for testing our system\",\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\",\n },\n assignee: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n abstractState: 'inProgress',\n priority: -1,\n },\n {\n id: \"4709d787-dcac-42ca-a3c0-750be8a5159a\",\n slug: \"WELCOME-3\",\n created: \"2024-01-01T00:00:00\",\n title: \"Implement Responsive Navbar\",\n titleSummaries: [\"Responsive Navbar\"],\n description: \"Develop a responsive navigation bar component using React and CSS Modules. Ensure compatibility with mobile and desktop views and integrate dropdown menus for complex navigation structures.\",\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n abstractState: 'open',\n priority: 0,\n },\n {\n id: \"90b6440b-251b-4485-b6c4-6f5a976cffeb\",\n slug: \"WELCOME-4\",\n created: \"2024-01-01T00:00:00\",\n title: \"Optimize Re-render Performance\",\n titleSummaries: [\"Render perf\"],\n description: \"Analyze and optimize the re-rendering process of the React application to enhance performance. Utilize React.memo and useCallback hooks to prevent unnecessary re-renders and improve overall responsiveness.\",\n abstractState: 'open',\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n priority: 0,\n },\n {\n id: \"837a1fba-29e2-430f-b276-43d3b9ef3c17\",\n slug: \"WELCOME-5\",\n created: \"2024-01-01T00:00:00\",\n title: \"Integrate Redux for State Management\",\n titleSummaries: [\"Redux\"],\n description: \"Set up Redux for centralized state management. Define actions, reducers, and store to manage the state of user sessions and API data efficiently across the entire application.\",\n abstractState: 'open',\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n assignee: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n priority: -1,\n },\n {\n id: \"c73242ad-a145-4e7e-9319-f96c065adf98\",\n slug: \"WELCOME-6\",\n created: \"2024-01-01T00:00:00\",\n title: \"Develop Custom Hooks for Data Fetching\",\n titleSummaries: [\"Custom Hooks\"],\n description: \"Create custom React hooks that handle API calls and data fetching logic. Ensure that the hooks are reusable and support error handling and loading states.\",\n abstractState: 'open',\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n priority: 0,\n },\n {\n id: \"587b84a7-0bd0-4092-83b2-fc6fc64f8121\",\n slug: \"WELCOME-7\",\n created: \"2024-01-01T00:00:00\",\n title: \"Implement Dark Mode Toggle\",\n titleSummaries: [\"Style Toggle\"],\n description: \"Implement a toggle switch to enable dark mode across the entire React application. Use Context API to manage the state and ensure UI consistency under both light and dark modes.\",\n abstractState: 'open',\n priority: 0,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"2c188bb0-1865-4342-ade7-6a579bdc0e59\",\n slug: \"WELCOME-8\",\n created: \"2024-01-01T00:00:00\",\n title: \"Refactor Class Components to Functional\",\n titleSummaries: [\"Refactor Class Components\"],\n description: \"Refactor existing class components into functional components using React Hooks. Focus on maintaining functionality and improving readability and maintainability of the code.\",\n abstractState: 'open',\n priority: 0,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"b631b02a-f33c-44ad-b7cd-9c3a3f93115b\",\n slug: \"WELCOME-9\",\n created: \"2024-01-01T00:00:00\",\n title: \"Create Form Validation Library\",\n titleSummaries: [\"Form Validation\"],\n description: \"Develop a custom form validation library tailored for React applications. The library should support asynchronous validation and integrate seamlessly with controlled components.\",\n abstractState: 'open',\n priority: 0,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"df211d28-4e36-4429-9c26-a8c1a9bc246a\",\n slug: \"WELCOME-10\",\n created: \"2024-01-01T00:00:00\",\n title: \"Setup Automated Testing Environment\",\n titleSummaries: [\"Automated Testing\"],\n description: \"Set up an automated testing environment using Jest and React Testing Library. Write unit and integration tests for existing components to ensure robustness and prevent regressions.\",\n abstractState: 'open',\n priority: 0,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"ed32f1d5-2577-4a24-ba91-60a9f108385f\",\n slug: \"WELCOME-11\",\n created: \"2024-01-01T00:00:00\",\n title: \"Design Dynamic Table Component\",\n titleSummaries: [\"Dynamic Table\"],\n description: \"Create a dynamic table component capable of handling sorting, pagination, and filtering. Ensure that it can dynamically adapt to different datasets and maintain performance.\",\n abstractState: 'open',\n priority: 0,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"7918d3f6-9704-45e1-8df1-148be9d2e22d\",\n slug: \"WELCOME-12\",\n created: \"2024-01-01T00:00:00\",\n title: \"Enhance Accessibility Features\",\n titleSummaries: [\"Accessibility\"],\n description: \"Audit the application for accessibility issues and implement improvements. Focus on keyboard navigability, screen reader support, and semantic HTML in React components.\",\n abstractState: 'open',\n priority: 10,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"345f8b61-1ba6-4645-a9e1-e019260a3e86\",\n slug: \"WELCOME-13\",\n created: \"2024-01-01T00:00:00\",\n title: \"Develop Real-time Data Visualization Tool\",\n titleSummaries: [\"Real-time Data Viz\", \"Data Viz\"],\n description: \"Build a real-time data visualization tool using React and a suitable charting library (e.g., D3.js). Ensure the tool can handle large volumes of data and update dynamically.\",\n abstractState: 'open',\n priority: 10,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"80ed1b00-dcbb-4e0d-b5de-0bd8e6a9e05b\",\n slug: \"WELCOME-14\",\n created: \"2024-01-01T00:00:00\",\n title: \"Implement End-to-End Encryption\",\n titleSummaries: [\"Implement E2EE\"],\n description: \"Implement end-to-end encryption for sensitive data communications in the React application, using WebCrypto API and secure key management practices.\",\n abstractState: 'open',\n priority: 10,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"2cd65054-c17a-4dd9-b3f9-546939a75ea3\",\n slug: \"WELCOME-15\",\n created: \"2024-01-01T00:00:00\",\n title: \"Build a Progressive Web App (PWA)\",\n titleSummaries: [\"PWA\"],\n description: \"Convert the existing React application into a Progressive Web App (PWA), ensuring it is fully functional offline and meets all PWA criteria.\",\n abstractState: 'open',\n priority: 20,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"fccc525a-4ac1-4271-9c6e-f1145bdc783a\",\n slug: \"WELCOME-16\",\n created: \"2024-01-01T00:00:00\",\n title: \"Integrate GraphQL API\",\n titleSummaries: [\"GraphQL API\"],\n description: \"Integrate a GraphQL API to replace existing REST API calls in the application, ensuring more efficient data fetching and reduced bandwidth usage.\",\n abstractState: 'open',\n priority: 20,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n },\n {\n id: \"900dbacb-9cdd-4699-ba0f-d6ee395c0b8c\",\n slug: \"WELCOME-17\",\n created: \"2024-01-01T00:00:00\",\n title: \"Implement Server-Side Rendering (SSR)\",\n titleSummaries: [\"Implement SSR\"],\n description: \"Implement server-side rendering for the React application to improve initial load time and enhance SEO performance.\",\n abstractState: 'open',\n priority: 20,\n author: {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n imageId: feMan,\n jobTitle: \"Frontend Manager\"\n },\n }\n ];\n\n return tasks;\n}\n\nexport const TASKS_PER_PAGE = 50;\ntype Order = \"alphabetical\" | \"created\" | \"due\" | \"priority\";\n\nasync function searchTasks(searchTerm: string, page: number, order: Order): Promise<{ tasks: TaskData[] }> {\n return await apiFetch(\"/task/search\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n page,\n pageSize: TASKS_PER_PAGE,\n query: searchTerm,\n order,\n }),\n }, \"Failed to search tasks\");\n}\n\nexport type MetadataSource = 'tag';\n\nexport type TaskUpdate = { assignOther: { userId: string } } |\n \"assignSelf\" |\n{ changeDescription: { description: string } } |\n{ changeTitle: { title: string } } |\n{ changePriority: { value: number } } |\n{ changeDueDate: { dueDate: string | null } } |\n{ changeMilestone: { milestoneId?: string } } |\n{ addComment: { content: string, parentId?: string } } |\n{ editComment: { commentId: string, content: string } } |\n{ removeComment: { commentId: string } } |\n{ addRelease: { releaseId: string } } |\n{ removeRelease: { releaseId: string } } |\n{ link: { taskId: string, linkType: string } } |\n \"stopWatchingTask\" |\n{ metadata: { source: MetadataSource, value: object } } |\n{ transition: { nodeId: string } } |\n \"close\" |\n \"restart\" |\n \"archive\" |\n \"unassign\" |\n \"undo\" |\n{ unlink: { taskId: string } } |\n{ removeMetadata: { value: object } } |\n \"watchTask\";\n\nexport async function updateTask(taskId: string, data: TaskUpdate): Promise {\n console.log(\"Update task\", data);\n return await apiFetch(`/task/${taskId}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n }, `Failed to update task ${taskId}`);\n}\n\ninterface GetTasksResponse {\n tasks: TaskData[];\n total?: number;\n}\n\ninterface GetTasksResponse {\n tasks: TaskData[];\n total?: number;\n}\n\nasync function getTaskBySlug(slug: string): Promise {\n const query = { slug };\n try {\n const response = await apiFetch(\"/task/query\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n page: 1,\n pageSize: 1,\n query,\n order: \"priority\",\n }),\n });\n return response.tasks[0];\n } catch (error) {\n return null;\n }\n}\n\nasync function getTasks(index: number, order: Order, count: boolean): Promise {\n if (isDevelopment) {\n if (index === 1) {\n return { tasks: testTasks(), total: 17 };\n } else {\n return { tasks: [] };\n }\n }\n\n const query: { count?: string, project: string } = { project: \"active\" };\n if (count) {\n query.count = \"true\";\n }\n\n try {\n return await apiFetch(\"/task/query\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n page: index,\n pageSize: TASKS_PER_PAGE,\n query,\n order,\n }),\n });\n } catch (error) {\n return { tasks: [] };\n }\n}\n\ntype SlugTaskMap = {\n [id: string]: TaskData;\n}\n\nexport interface TasksContextProps {\n tasks: TaskData[];\n count: number;\n indexesById: Record;\n slugToTask: SlugTaskMap;\n returnedByQuery: Record;\n order: Order;\n taskCache: Record;\n\n getTask(slugOrtaskId: string): Promise;\n loadNextPage: () => void;\n hasNextPage: () => boolean;\n addTask: (task: TaskData) => void;\n swapTaskItem: (fromId: string, toId: string) => void;\n updateTaskItem: (task: TaskData) => void;\n closeTask: (task: TaskData) => void;\n clearCache: () => void;\n archiveTask: (task: TaskData) => void;\n restartTask: (task: TaskData) => void;\n fetchBySearch: (searchTerm: string, page: number) => void;\n setOrder: (order: Order) => void;\n\n projectTags: Option[];\n projectComponents: Option[];\n}\n\nexport const TasksContext = createContext(undefined);\n\nasync function apiGetTask(taskId: string): Promise {\n try {\n const response = await apiFetch(`/task/${taskId}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n return response;\n } catch (error) {\n return null;\n }\n}\n\nconst TasksProvider: React.FC = ({ children }) => {\n const { activeProject } = useProjectsContext();\n const [tasks, setTasks_] = useState([]);\n const [count, setCount] = useState(51);\n const [slugToTask] = useState({});\n const [order, setOrder] = useState(\"priority\");\n const [taskCache, setTaskCache] = useState>({});\n\n const [returnedByQuery,] = useState>({});\n\n const getTask = useCallback(async (slugOrtaskId: string): Promise => {\n if (testUuid(slugOrtaskId)) {\n const task = tasks.find((task) => task.id === slugOrtaskId) || null;\n if (task) {\n return task;\n }\n return await apiGetTask(slugOrtaskId);\n } else {\n // Assume it's a slug\n const task = slugToTask[slugOrtaskId] || null;\n if (task) {\n return task;\n }\n return await getTaskBySlug(slugOrtaskId);\n }\n }, [tasks, slugToTask]);\n\n const clearCache = useCallback(() => {\n const newCache: Record = {};\n for (let i = 0; i < tasks.length; i++) {\n newCache[tasks[i].id] = Date.now();\n }\n setTaskCache(newCache);\n }, [tasks]);\n\n const indexesById = useMemo(() => {\n const indexesById: Record = {};\n for (let i = 0; i < tasks.length; i += 1) {\n indexesById[tasks[i].id] = i;\n }\n return indexesById;\n }, [tasks]);\n\n const [projectTags, setProjectTags] = useState([]);\n const [projectComponents, setProjectComponents] = useState([]);\n\n useEffect(() => {\n if (activeProject?.id) {\n getProjectMeta(activeProject.id).then((metadata: object[]) => {\n const tagsParsed: Tag[] = metadata.filter((meta) => {\n return \"label\" in meta || \"component\" in meta;\n }) as Tag[];\n const tagElements: Option[] = tagsParsed\n .filter((tag: Tag) => \"label\" in tag)\n .map((tag, id) => {\n const label = (tag as TagLabel).label;\n return { id, label, value: label };\n });\n setProjectTags(tagElements);\n const componentElements: Option[] = tagsParsed\n .filter((tag) => \"component\" in tag)\n .map((tag, id) => {\n const label = (tag as TagComponent).component;\n return { id, label, value: label };\n });\n setProjectComponents(componentElements);\n });\n }\n }, [activeProject?.id]);\n\n const setTasks = useCallback((newTasks: TaskData[]) => {\n for (let i = 0; i < newTasks.length; i++) {\n const task = newTasks[i];\n slugToTask[task.slug] = task;\n taskCache[task.id] = Date.now();\n }\n setTasks_([...newTasks]);\n }, [slugToTask, taskCache]);\n\n const [page, setPage] = useState(1);\n\n const loadNextPage = useCallback(() => {\n getTasks(page, order, false).then((response) => {\n if (response.tasks.length) {\n const newTasks = response.tasks.filter((task: TaskData) => {\n return !(task.id in indexesById);\n });\n setTasks([...tasks, ...newTasks]);\n }\n });\n }, [page, tasks, setTasks, order, indexesById]);\n\n const hasNextPage = useCallback(() => {\n return tasks.length < count;\n }, [tasks, count]);\n\n useEffect(() => {\n const fetchTasks = async () => {\n setPage(1);\n const { tasks, total } = await getTasks(1, order, true);\n if (total) {\n setCount(total);\n }\n setTasks(tasks);\n };\n fetchTasks();\n }, [activeProject?.id, setTasks, order, taskCache]);\n\n const updateTaskItem = useCallback((task: TaskData) => {\n console.log(\"Updating task\", task.id);\n const newTasks = tasks.map(item => {\n if (item.id === task.id) {\n return task;\n }\n return item;\n });\n taskCache[task.id] = Date.now();\n slugToTask[task.slug] = task;\n setTasks_(newTasks);\n }, [tasks, slugToTask, taskCache]);\n\n const addTask = useCallback((task: TaskData) => {\n console.log(\"Add task\", task.id);\n if (task.id in indexesById) {\n updateTaskItem(task);\n } else {\n const newTasks = [task, ...tasks];\n setTasks(newTasks);\n }\n }, [tasks, setTasks, indexesById, updateTaskItem]);\n\n useEffect(() => {\n const addTaskEvent = ({ task }: { task: TaskData }) => {\n addTask(task);\n };\n\n eventEmitter.on(\"TASK-ADD\", addTaskEvent);\n return () => {\n eventEmitter.off(\"TASK-ADD\", addTaskEvent);\n };\n }, [addTask]);\n\n const closeTask = useCallback((task: TaskData) => {\n updateTask(task.id, \"close\").then((newTaskItem) => {\n console.log(\"Closed task\", task.id);\n if (newTaskItem) {\n updateTaskItem(newTaskItem);\n } else {\n task.abstractState = 'closed';\n }\n });\n }, [updateTaskItem]);\n\n const archiveTask = useCallback((task: TaskData) => {\n updateTask(task.id, \"archive\").then(() => {\n console.log(\"Archived task\", task.id);\n const newTasks = tasks.filter((item) => item.id !== task.id)\n setTasks(newTasks);\n });\n }, [tasks, setTasks]);\n\n const restartTask = useCallback((task: TaskData) => {\n updateTask(task.id, \"restart\").then((newTaskItem) => {\n console.log(\"Restarted task\", task.id);\n if (newTaskItem) {\n updateTaskItem(newTaskItem);\n } else {\n task.abstractState = 'closed';\n }\n });\n }, [updateTaskItem]);\n\n const swapTaskItem = useCallback((fromId: string, toId: string) => {\n const cardIndex: number = indexesById[fromId];\n const afterIndex: number = indexesById[toId];\n const card = tasks[cardIndex];\n const newItems = [...tasks];\n newItems.splice(cardIndex, 1);\n newItems.splice(afterIndex, 0, card);\n setTasks_(newItems);\n }, [tasks, indexesById]);\n\n const fetchBySearch = useCallback((searchTerm: string, page: number) => {\n searchTasks(searchTerm, page, order).then((response) => {\n const taskIds = response.tasks.map((task: TaskData) => task.id);\n if (searchTerm in returnedByQuery) {\n returnedByQuery[searchTerm] = [...returnedByQuery[searchTerm], ...taskIds];\n } else {\n returnedByQuery[searchTerm] = taskIds;\n }\n const newTasks = response.tasks.filter((task: TaskData) => {\n return !(task.id in indexesById);\n });\n setTasks([...tasks, ...newTasks]);\n });\n }, [indexesById, tasks, setTasks, returnedByQuery, order]);\n\n const value = useMemo(() => {\n return {\n addTask,\n archiveTask,\n clearCache,\n closeTask,\n taskCache,\n count,\n fetchBySearch,\n hasNextPage,\n getTask,\n indexesById,\n loadNextPage,\n order,\n projectComponents,\n projectTags,\n restartTask,\n returnedByQuery,\n setOrder,\n slugToTask,\n swapTaskItem,\n tasks,\n updateTaskItem,\n };\n }, [addTask,\n archiveTask,\n clearCache,\n closeTask,\n taskCache,\n count,\n fetchBySearch,\n hasNextPage,\n getTask,\n indexesById,\n loadNextPage,\n order,\n projectComponents,\n projectTags,\n restartTask,\n returnedByQuery,\n setOrder,\n slugToTask,\n swapTaskItem,\n tasks,\n updateTaskItem]\n );\n\n return (\n \n {children}\n \n );\n};\nexport default TasksProvider;\n","import { createContext, useCallback, useEffect, useMemo, useState } from \"react\";\nimport { ProviderProps } from \"./ContextTypes\";\nimport { cache, isDevelopment, eventEmitter, apiFetch, apiFetchNoContent } from \".\";\n\nimport defaultImage from \"../assets/unknown.jpg\";\nimport beEng from \"../assets/be-eng.webp\";\nimport dopsEng from \"../assets/dops-eng.webp\";\nimport feManager from \"../assets/fe-manager.webp\";\nimport beManager from \"../assets/be-manager.webp\";\nimport dopsManager from \"../assets/dops-manager.webp\";\n\nexport interface OrganizationData {\n id: string;\n name: string;\n created: string;\n pricingPlanId: string;\n metadata: OrganizationMetadata;\n}\n\nexport interface OrganizationMetadata {\n max_capacity?: number;\n max_projects?: number;\n credits?: number;\n premium_features?: unknown;\n last_payment_date?: string;\n overdue_since?: string;\n description?: string;\n notes?: string;\n region?: string;\n timezone?: string;\n contact?: string;\n phone?: string;\n}\n\nexport type OrganizationRole = \"owner\" | \"admin\" | \"member\" | { \"memberWithPermissions\": string[] };\n\nexport interface UserEmailSettings {\n notifications: boolean;\n frequency: string;\n channels: string[];\n}\n\nexport interface UserPersonalSettings {\n timezone?: string;\n currency?: string;\n units?: string;\n phone?: string;\n billingAddress?: unknown;\n mailingAddress?: unknown;\n locale?: string;\n theme?: string;\n applicableLaws?: string[];\n consents?: string[];\n preferences?: unknown;\n}\n\nexport interface UserHistoryData {\n locationData?: unknown;\n favorites?: unknown;\n recent?: unknown;\n history?: unknown;\n}\n\nexport interface UserNotificationSettings {\n notifications: boolean;\n channels: string[];\n}\n\nexport interface UserSecuritySettings {\n knownDevices?: unknown;\n knownIps?: unknown;\n mfa?: unknown;\n}\n\nexport interface UserSettings {\n lastLogin?: string;\n email: UserEmailSettings;\n personal: UserPersonalSettings;\n history: UserHistoryData;\n notifications: UserNotificationSettings;\n scheduling?: unknown;\n security: UserSecuritySettings;\n}\n\nexport interface UserData {\n id: string;\n created: string;\n username: string;\n email: string;\n jobId?: string;\n role?: string;\n orgRole?: OrganizationRole;\n org?: OrganizationData;\n\n // Metadata\n jobTitle: string;\n givenName?: string;\n familyName?: string;\n settings?: UserSettings;\n\n imageId?: string;\n}\n\nexport function isOrgAdmin(user: UserData | null): boolean {\n return user?.orgRole === \"owner\" || user?.orgRole === \"admin\";\n}\n\nexport function isOrgPlanner(user: UserData | null): boolean {\n if (!user?.orgRole) {\n return false;\n }\n if (typeof (user.orgRole) === \"object\") {\n return user.orgRole.memberWithPermissions.includes(\"planner\");\n } else {\n return user.orgRole === \"owner\" || user.orgRole === \"admin\";\n }\n}\n\nexport function orgRoleString(orgRole: OrganizationRole | undefined): string {\n if (typeof orgRole === \"object\") {\n return \"Member\";\n }\n\n switch (orgRole) {\n case \"owner\":\n return \"Owner\";\n case \"admin\":\n return \"Admin\";\n case \"member\":\n return \"Member\";\n default:\n return \"Unknown\";\n }\n}\n\nfunction testUsers(): UserData[] {\n cache.setPortrait('1', defaultImage);\n cache.setPortrait('2', beEng);\n cache.setPortrait('3', dopsEng);\n cache.setPortrait('4', feManager);\n cache.setPortrait('5', beManager);\n cache.setPortrait('6', dopsManager);\n cache.setPortrait('7', defaultImage);\n\n const users = [\n {\n id: \"1\",\n created: \"2024-01-01T00:00:00\",\n username: \"FILIP\",\n email: \"filip@subseq.io\",\n jobTitle: \"Frontend Engineer\",\n jobId: \"2\",\n },\n {\n id: \"2\",\n created: \"2024-01-01T00:00:00\",\n username: \"COCO\",\n email: \"coco@subseq.io\",\n jobTitle: \"Backend Engineer\",\n },\n {\n id: \"3\",\n created: \"2024-01-01T00:00:00\",\n username: \"RONAN\",\n email: \"ronan@subseq.io\",\n jobTitle: \"Devops Engineer\",\n },\n {\n id: \"4\",\n created: \"2024-01-01T00:00:00\",\n username: \"GARRETT\",\n email: \"garrett@subseq.io\",\n jobTitle: \"Frontend Manager\",\n },\n {\n id: \"5\",\n created: \"2024-01-01T00:00:00\",\n username: \"GABE\",\n email: \"gabe@subseq.io\",\n jobTitle: \"Backend Manager\",\n },\n {\n id: \"6\",\n created: \"2024-01-01T00:00:00\",\n username: \"NIKKI\",\n email: \"nikki@subseq.io\",\n jobTitle: \"Devops Manager\",\n },\n {\n id: \"7\",\n created: \"2024-01-01T00:00:00\",\n username: \"CARMACK\",\n email: \"carmack@subseq.io\",\n jobTitle: \"Software Architect\",\n },\n ];\n return users;\n}\n\nexport async function getUsers(page: number): Promise {\n if (isDevelopment) {\n if (page == 1) {\n return testUsers();\n } else {\n return [];\n }\n }\n\n return await apiFetch(`/user/list/${page}`, {\n method: \"GET\",\n });\n}\n\nexport async function verifyEmail(token: string): Promise<{ message: string }> {\n if (isDevelopment) {\n return { message: \"verified\" };\n }\n return await apiFetch(`/email/verify?id=${token}`, { method: 'POST', });\n}\n\nexport async function resendEmail() {\n return await apiFetch('/email/verify', {\n method: 'PUT',\n });\n}\n\nexport interface Invite {\n id: string;\n created: string;\n orgName: string;\n invitedBy: UserData;\n}\n\nexport async function inviteList(): Promise {\n return await apiFetch(\"/org/user/invite/list\", {\n method: \"GET\",\n });\n}\n\nexport async function inviteResponse(inviteId: string, accept: boolean) {\n try {\n await apiFetch(`/org/user/invite/${inviteId}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ inviteResponse: accept }),\n });\n return true;\n } catch (error) {\n return false;\n }\n}\n\nasync function inviteUserToOrg(userEmail: string): Promise {\n try {\n await apiFetch('/org/user/invite', {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ email: userEmail }),\n });\n return true;\n } catch (error) {\n const text = (await (error as Response).json() as { error: string }).error;\n eventEmitter.emit(\"ERROR\", `${text}`);\n return false;\n }\n}\n\nasync function removeUserFromOrg(userId: string): Promise {\n try {\n await apiFetchNoContent(`/org/user/${userId}`, {\n method: \"DELETE\",\n });\n return true;\n } catch (error) {\n return false;\n }\n}\n\nexport interface UsersContextProps {\n users: UserData[];\n indexesById: Record;\n addUser: (user: UserData) => void;\n clearUserCache: () => void;\n updateUser: (user: UserData) => void;\n inviteToOrg: (email: string) => void;\n removeFromOrg: (userId: string) => void;\n}\nexport const UsersContext = createContext(undefined);\n\nconst UsersProvider: React.FC = ({ children }) => {\n const [users, setUsers] = useState([]);\n const [userCache, setUserCache] = useState(Date.now());\n\n const indexesById = useMemo(() => {\n const indexesById: Record = {};\n for (let i = 0; i < users.length; i += 1) {\n indexesById[users[i].id] = i;\n }\n return indexesById;\n }, [users]);\n\n const clearUserCache = useCallback(() => {\n setUserCache(Date.now());\n }, []);\n\n useEffect(() => {\n const fetchUsers = async () => {\n let page = 1;\n let lastLen = -1;\n let newUsers: UserData[] = [];\n while (newUsers.length !== lastLen) {\n lastLen = newUsers.length;\n newUsers = [...newUsers, ...await getUsers(page)];\n setUsers(newUsers);\n page += 1;\n }\n };\n fetchUsers();\n }, [userCache]);\n\n const updateUser = useCallback((task: UserData) => {\n const newUsers = users.map(item => {\n if (item.id === task.id) {\n return task;\n }\n return item;\n });\n setUsers(newUsers);\n }, [users]);\n\n const addUser = useCallback((user: UserData) => {\n if (!(user.id in indexesById)) {\n const newUsers = [...users, user];\n setUsers(newUsers);\n }\n }, [setUsers, users, indexesById]);\n\n useEffect(() => {\n const addUserEvent = ({ user }: { user: UserData }) => {\n addUser(user);\n };\n\n eventEmitter.on(\"USER-ADD\", addUserEvent);\n return () => {\n eventEmitter.off(\"USER-ADD\", addUserEvent);\n };\n }, [addUser]);\n\n const inviteToOrg = useCallback((email: string) => {\n inviteUserToOrg(email).then(() => { });\n }, []);\n\n const removeFromOrg = useCallback((userId: string) => {\n removeUserFromOrg(userId).then((success) => {\n if (success) {\n const newUsers = users.filter(user => user.id !== userId);\n setUsers(newUsers);\n } else {\n eventEmitter.emit(\"ERROR\", \"You don't have permission to remove this user from the organization.\");\n }\n });\n }, [users]);\n\n const value = {\n users,\n addUser,\n clearUserCache,\n indexesById,\n updateUser,\n inviteToOrg,\n removeFromOrg\n };\n return (\n {children}\n );\n};\nexport default UsersProvider;\n","import React from 'react';\n\nexport interface ProviderProps {\n children: React.ReactNode;\n}\n\nexport const LOGGED_OUT = \"loggedOutError\";\n\nexport function checkLoggedOut(response: Response) {\n if (response.status == 401) {\n throw LOGGED_OUT;\n }\n}\n\nexport async function getJsonOrLogout(response: Response): Promise {\n if (!response.ok && response.status == 401) {\n throw LOGGED_OUT;\n }\n return await response.json();\n}\n","import { eventEmitter } from \".\";\nimport defaultImage from \"../assets/unknown.jpg\";\nimport { LOGGED_OUT } from \"./ContextTypes\";\n\nclass PortraitCache {\n portraits: Record;\n\n constructor() {\n this.portraits = {};\n }\n\n setPortrait(userId: string, url: string) {\n this.portraits[userId] = url;\n }\n\n async getPortrait(userId: string): Promise {\n let url = this.portraits[userId];\n if (url) {\n return url;\n }\n\n try {\n if (!userId) {\n return defaultImage;\n }\n\n const response = await fetch(`/portrait/${userId}`, {\n method: \"GET\",\n });\n\n if (!response.ok) {\n if (response.status == 401) {\n eventEmitter.emit(\"LOGGED_OUT\");\n throw LOGGED_OUT;\n }\n\n throw new Error(\"No such portrait\");\n }\n\n const blob = await response.blob();\n url = URL.createObjectURL(blob);\n this.portraits[userId] = url;\n } catch (error) {\n url = defaultImage;\n }\n return url;\n }\n}\nexport default PortraitCache;\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","import { createContext, useCallback, useEffect, useMemo, useState } from \"react\";\nimport { apiFetch, apiFetchNoContent, eventEmitter, isDevelopment } from \".\";\nimport { ProviderProps } from \"./ContextTypes\";\nimport { Milestone } from \"./Task\";\n\nexport type ImportStateInfo = \"none\" | { issues: { issues: number } } | { comments: { total: number } } | { portraits: { total: number } };\nexport type InProgressState = \"issues\" | \"comments\" | \"portraits\";\nexport type ImportState = \"pending\" | { inProgress: InProgressState } | { paused: InProgressState } | \"done\" | \"error\";\n\nexport interface ImportUpdate {\n projectId: string;\n projectTrackerId: string;\n state: ImportState;\n error: null | string;\n info: ImportStateInfo;\n}\n\nexport interface ProjectTracker {\n id: string,\n projectId: string,\n tracker: string,\n repo: string,\n created: string,\n repoUrl: string | null,\n isDefault: boolean,\n}\n\nexport interface ProjectImportState {\n id: string,\n projectId: string,\n projectTracker: ProjectTracker,\n importState: ImportState,\n importError: string | null,\n}\n\nexport interface Import {\n state: ImportState;\n error: null | string;\n info: ImportStateInfo;\n}\n\nexport interface Repo {\n id: string;\n tracker: string;\n repoGitRemote: string;\n repoWebUrl?: string;\n isDefault: boolean;\n importState?: Import;\n}\n\nexport interface Release {\n repo: Repo;\n previousRelease: Release | null;\n milestone: Milestone;\n name: string;\n releasedDate: string | null;\n plannedDate: string | null;\n metadata: object;\n}\n\nexport interface Deployment {\n release: Release;\n deployedAt: string;\n environment: string;\n metadata: object;\n}\n\nexport interface Project {\n id: string;\n name: string;\n slug: string;\n description: string;\n repos: Repo[];\n keys: string[];\n orgId?: string;\n}\n\nexport interface ChartPlan {\n id: string;\n org_id: string;\n created_at: string;\n created_by: string;\n metadata: unknown;\n}\n\nfunction testProjects(org: boolean): Project[] {\n return [\n {\n id: org ? \"bcde3dbb-7b5a-47c8-8923-e66f3485968d\" : \"cea84677-7335-4a11-b4bf-4c7d5c5c045f\",\n name: \"welcome\",\n slug: \"WELCOME\",\n description: \"Welcome\",\n keys: [\"github\"],\n repos: [\n {\n id: \"1\",\n tracker: \"JIRA\",\n repoGitRemote: \"git@github.com:user/project.git\",\n repoWebUrl: \"https://github.com/user/project\",\n isDefault: true,\n importState: { state: \"done\", error: null, info: \"none\" },\n },\n {\n id: \"2\",\n tracker: \"JIRA\",\n repoGitRemote: \"git@github.com:user/project2.git\",\n repoWebUrl: \"https://github.com/user/project2\",\n isDefault: false,\n importState: {\n state: \"error\",\n error: \"Didn't do a good job\",\n info: \"none\"\n },\n },\n ],\n },\n {\n id: org ? \"079c5474-0bd1-40a6-998e-af4df19f60a7\" : \"659a478d-b828-4c7d-90d0-4da968e6fae3\",\n name: \"jest\",\n slug: \"JEST\",\n description: \"Jest\",\n keys: [\"github\"],\n repos: [\n {\n id: \"3\",\n tracker: \"JIRA\",\n repoGitRemote: \"git@github.com:user/project.git\",\n repoWebUrl: \"https://github.com/user/project\",\n isDefault: true,\n importState: {\n state: { inProgress: \"issues\" },\n error: null,\n info: { issues: { issues: 10 } }\n },\n },\n ],\n }\n ];\n}\n\nexport interface ExistingProject {\n repo: string,\n projectTracker: string,\n}\n\nexport type ProjectSource = \"personal\" | \"organization\";\n\nasync function getProjects(index: number, source: ProjectSource): Promise {\n if (isDevelopment) {\n if (index === 1) {\n return testProjects(source === \"organization\");\n } else {\n return [];\n }\n }\n\n let list = \"list\";\n if (source === \"organization\") {\n list = \"org_list\";\n }\n\n try {\n return await apiFetch(`/project/${list}/${index}`, {\n method: \"GET\",\n });\n } catch (error) {\n return [];\n }\n}\n\nasync function createProject(\n name: string,\n description: string,\n projectSource: ProjectSource | null\n): Promise {\n\n let path = '/project';\n if (projectSource === 'organization') {\n path = '/org/project';\n }\n\n return await apiFetch(path, {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n name,\n description,\n active: true,\n }),\n },\n (response) => {\n if (!response.ok) {\n if (response.status === 403) {\n eventEmitter.emit(\"ERROR\", \"You cannot create more projects\");\n } else {\n eventEmitter.emit(\"ERROR\", \"Failed to create project\");\n }\n throw new Error(\"Failed to create project\");\n }\n }\n );\n}\n\nasync function fetchProject(projectId: string): Promise {\n try {\n return await apiFetch(`/project/${projectId}`, { method: \"GET\", });\n } catch (err) {\n return null;\n }\n}\n\nexport type ProjectTrackerType = \"zini\" | \"github\";\nexport type ProjectTrackerUpdate = { tracker: ProjectTrackerType } |\n{ repo: string } |\n{ repoUrl: string } |\n{ isDefault: boolean };\nexport type ProjectKeyType = \"github\";\n\nexport type ProjectUpdate = { name: string } |\n{ description: string } |\n{ defaultFlow: { flowId: string } } |\n{ addRepo: { tracker: ProjectTrackerType, repo: string, repoUrl?: string, isDefault: boolean } } |\n{ updateRepo: { repoId: string, update: ProjectTrackerUpdate } } |\n{ deleteRepo: { repoId: string } } |\n{ updateProjectKey: { key: ProjectKeyType, token: string } } |\n{ deleteProjectKey: ProjectKeyType } |\n \"setActiveProject\";\n\n\nasync function updateProject(projectId: string, update: ProjectUpdate): Promise {\n return await apiFetch(`/project/${projectId}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(update),\n }, \"Failed to update project\");\n}\n\nasync function callDeleteProject(projectId: string): Promise {\n await apiFetchNoContent(`/project/${projectId}`, {\n method: \"DELETE\",\n }, \"You cannot delete this project\");\n}\n\nexport interface ProjectsContextProps {\n projects: Project[];\n orgProjects: Project[];\n nameToProject: Record;\n priorityValues: Record | null;\n activeProject: Project | null;\n\n refreshProjects: () => void;\n clearProjectCache: () => void;\n setProjects: (projects: Project[]) => void;\n setActiveProject: (project: Project) => void;\n addProject: (card: CreatedProject) => void;\n updateProject: (projectId: string, update: ProjectUpdate) => void;\n deleteProject: (projectId: string) => void;\n moveProjectToOrg: (project: Project) => void;\n}\n\nasync function doMoveProjectToOrg(project: Project): Promise {\n return await apiFetchNoContent(`/project/${project.id}/to_org`, {\n method: \"POST\",\n });\n}\n\nexport const ProjectsContext = createContext(undefined);\n\ninterface PriorityLevel { name: string, value: number }\ninterface ProjectPriorityLevelsResponse { priorityLevels: PriorityLevel[] }\n\nasync function fetchPriorityValues(projectId: string): Promise> {\n const result = await apiFetch(`/project/${projectId}/priority_levels`, {\n method: \"GET\",\n });\n const record: Record = {};\n for (let i = 0; i < result.priorityLevels.length; i += 1) {\n const item = result.priorityLevels[i];\n record[item.value] = item.name;\n }\n return record;\n}\n\nexport interface CreatedProject {\n name: string;\n description: string;\n projectSource: ProjectSource | null;\n}\n\nasync function fetchProjects(setProjects: (projects: Project[]) => void,\n getProjects: (page: number) => Promise) {\n let page = 1;\n let lastLen = -1;\n let newProjects: Project[] = [];\n while (newProjects.length !== lastLen) {\n lastLen = newProjects.length;\n newProjects = [...newProjects, ...await getProjects(page)];\n setProjects(newProjects);\n page += 1\n }\n}\n\nconst ProjectsProvider: React.FC = ({ children }) => {\n const [projects, setProjects] = useState([]);\n const [orgProjects, setOrgProjects] = useState([]);\n const [projectCache, setProjectCache] = useState(Date.now());\n const [activeProject, setActiveProject_] = useState(null);\n const [priorityValues, setPriorityValues] = useState | null>(null);\n\n const refreshProjects = useCallback(async () => {\n await Promise.allSettled([\n fetchProjects(setProjects, (page) => getProjects(page, \"personal\")),\n fetchProjects(setOrgProjects, (page) => getProjects(page, \"organization\"))\n ]);\n }, []);\n useEffect(() => { refreshProjects(); }, [refreshProjects, projectCache]);\n\n const clearProjectCache = useCallback(() => {\n setProjectCache(Date.now());\n }, []);\n\n const nameToProject = useMemo(() => {\n const nameToProject: Record = {};\n for (let i = 0; i < projects.length; i += 1) {\n const project = projects[i];\n nameToProject[project.name] = project;\n }\n return nameToProject;\n }, [projects]);\n\n const insertProject = useCallback((project: Project) => {\n if (project.orgId) {\n if (orgProjects.find((item) => item.id === project.id)) {\n return;\n }\n setOrgProjects([...orgProjects, project]);\n } else {\n if (projects.find((item) => item.id === project.id)) {\n return;\n }\n setProjects([...projects, project]);\n }\n }, [projects, orgProjects]);\n\n const addProject = useCallback(({ name, description, projectSource }: CreatedProject) => {\n createProject(name, description, projectSource).then((project) => insertProject(project));\n }, [insertProject])\n\n useEffect(() => {\n const addProjectEvent = ({ project }: { project: Project }) => {\n insertProject(project);\n };\n\n eventEmitter.on(\"PROJECT-ADD\", addProjectEvent);\n return () => {\n eventEmitter.off(\"PROJECT-ADD\", addProjectEvent);\n };\n }, [insertProject]);\n\n const _updateProject = useCallback((projectId: string, update: ProjectUpdate) => {\n updateProject(projectId, update).then((project) => {\n const updatedProjects = projects.map((item) => {\n if (project.id === item.id) {\n return project;\n }\n return item;\n })\n setProjects(updatedProjects);\n })\n .catch(() => {\n return null;\n });\n }, [projects]);\n\n const deleteProject = useCallback((projectId: string) => {\n callDeleteProject(projectId).then(() => {\n const updatedProjects = projects.filter((item) => projectId !== item.id);\n setProjects(updatedProjects);\n const updatedOrgProjects = orgProjects.filter((item) => projectId !== item.id);\n setOrgProjects(updatedOrgProjects);\n console.log(\"Deleted project\", projectId);\n });\n }, [projects, orgProjects]);\n\n const setActiveProject = useCallback((project: Project) => {\n updateProject(project.id, \"setActiveProject\").then((project) => {\n setActiveProject_(project);\n });\n }, []);\n\n useEffect(() => {\n if (isDevelopment) {\n setActiveProject_(projects[0]);\n return;\n }\n\n if (activeProject) {\n return;\n }\n\n fetchProject(\"active\").then((project) => {\n if (project) {\n setActiveProject_(project);\n } else if (projects.length > 0) {\n setActiveProject(projects[0]);\n } else if (orgProjects.length > 0) {\n setActiveProject(orgProjects[0]);\n }\n });\n }, [projects, orgProjects, setActiveProject, activeProject]);\n\n useEffect(() => {\n if (activeProject) {\n if (isDevelopment) {\n const record: Record = { 0: \"High\", 10: \"Medium\", 20: \"Low\" };\n record[-1] = \"Critical\"; // Typescript can't hondle negative numbers?\n return setPriorityValues(record);\n }\n fetchPriorityValues(activeProject.id).then(setPriorityValues);\n }\n }, [activeProject]);\n\n const moveProjectToOrg = useCallback((project: Project) => {\n doMoveProjectToOrg(project).then(() => {\n const updatedProjects = projects.filter((item) => item.id !== project.id);\n setProjects(updatedProjects);\n setOrgProjects([...orgProjects, project]);\n console.log(\"Moved project\", project.id);\n });\n }, [projects, orgProjects]);\n\n const value = useMemo(() => {\n return {\n projects,\n orgProjects,\n nameToProject,\n priorityValues,\n refreshProjects,\n clearProjectCache,\n setProjects,\n activeProject,\n setActiveProject,\n moveProjectToOrg,\n addProject,\n updateProject: _updateProject,\n deleteProject\n };\n }, [projects,\n orgProjects,\n nameToProject,\n activeProject,\n priorityValues,\n moveProjectToOrg,\n clearProjectCache,\n refreshProjects,\n setActiveProject,\n _updateProject,\n deleteProject,\n addProject]);\n\n return (\n \n {children}\n \n );\n}\nexport default ProjectsProvider;\n","import { createContext, useEffect, useState, useCallback } from 'react';\nimport { ProviderProps } from \"./ContextTypes\";\nimport { apiFetch, apiFetchNoContent, eventEmitter } from '.';\nimport { UserData } from './User';\nimport { Project } from './Project';\n\nexport interface Window {\n start: number;\n end: number;\n}\nexport interface RepeatedBound {\n \"n\": number;\n \"bound\": Window;\n}\nexport type Bound = { \"lower\": number } | { \"upper\": number };\nexport type Constraint = { \"hardConstraint\": Bound } | { \"repeatedBlock\": RepeatedBound } | { \"block\": Window };\n\nexport interface EventSegment {\n start: number;\n duration: number;\n}\n\nexport interface ChartTask {\n taskId: string;\n slug: string;\n titleSummaries: string[];\n state: string;\n priority: number;\n attention: number;\n row: number;\n assignee?: UserData;\n expectedStart: string;\n actualStart?: string;\n\n expectedDuration: number;\n actualDuration?: number;\n\n constraints: Constraint[];\n dependencies: string[];\n children: string[];\n dueDate: string;\n segments: EventSegment[];\n}\n\nexport interface ChartProblem {\n eventId: string;\n problem: string;\n}\n\nexport interface ChartPlan {\n planId: string;\n completed: boolean;\n completedOn: string;\n error?: string;\n seed: string;\n tasks: ChartTask[];\n workers: { workers: Record, usernames: Record };\n problems: ChartProblem[];\n utilization: Record;\n}\n\nexport interface Utilization {\n workerId: string;\n utilizationRate: number;\n}\n\nexport interface ChartPlanMetadata {\n projectIds: string[];\n startDate: string;\n timeZone: string;\n workingDays: boolean[];\n problems: ChartProblem[];\n utilization: Utilization[];\n}\n\nexport interface Chart {\n planId: string;\n orgId: string;\n createdAt: string;\n createdBy: UserData;\n projects: Project[];\n metadata: ChartPlanMetadata;\n processingFinishedAt?: string;\n}\n\nexport interface CreateChart {\n projectIds: string[];\n startDate: string;\n timeZone: string;\n workingDays: boolean[];\n}\n\ninterface NewPlan {\n planId: string;\n}\n\nasync function createChart(create: CreateChart): Promise {\n return await apiFetch(\"/plan\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(create),\n });\n}\n\nasync function getCharts(): Promise {\n const result = await apiFetch(\"/plan/list\", { method: \"GET\" });\n return result;\n}\n\nasync function getChart(planId: string): Promise {\n return await apiFetch(`/plan/${planId}`, { method: \"GET\" });\n}\n\nasync function deleteChart(planId: string): Promise {\n try {\n await apiFetchNoContent(`/plan/${planId}`, { method: \"DELETE\" });\n return true;\n } catch (e) {\n console.error(e);\n return false;\n }\n}\n\nexport type ChartTaskUpdate = { \"expected\": { \"start\": string, \"end\": string } } |\n{ \"segments\": { \"segments\": EventSegment[], \"today\": string, \"units\": string } } |\n{ \"assignee\": string };\n\nasync function updateChartTask(planId: string, taskId: string, update: ChartTaskUpdate) {\n await apiFetchNoContent(`/plan/${planId}/task/${taskId}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(update),\n });\n}\n\nexport interface ChartContextProps {\n charts: Chart[];\n createChart: (create: CreateChart) => Promise;\n deleteChart: (planId: string) => Promise;\n getChart: (planId: string) => Promise;\n updateChartTask: (planId: string, taskId: string, update: ChartTaskUpdate) => Promise;\n}\n\nexport const ChartContext = createContext(undefined);\n\nconst ChartProvider: React.FC = ({ children }) => {\n const [charts, setCharts] = useState([]);\n\n useEffect(() => {\n getCharts().then(setCharts).catch(() => { });\n }, []);\n\n const createChartCb = useCallback(async (create: CreateChart) => {\n const newPlan = await createChart(create);\n const charts = await getCharts();\n setCharts(charts);\n return newPlan.planId;\n }, []);\n\n const deleteChartCb = useCallback(async (planId: string) => {\n if (await deleteChart(planId)) {\n const charts = await getCharts();\n setCharts(charts);\n } else {\n eventEmitter.emit(\"ERROR\", \"Failed to delete chart\");\n }\n }, []);\n\n const getChartCb = useCallback(async (planId: string) => {\n return await getChart(planId);\n }, []);\n\n const updateChartTaskCb = useCallback(async (planId: string, taskId: string, update: ChartTaskUpdate) => {\n await updateChartTask(planId, taskId, update)\n }, []);\n\n const value = {\n charts,\n createChart: createChartCb,\n getChart: getChartCb,\n deleteChart: deleteChartCb,\n updateChartTask: updateChartTaskCb,\n };\n\n return (\n {children}\n );\n}\nexport default ChartProvider;\n","import { useContext } from 'react';\nimport { AppContext, AppContextProps } from './AppContext';\nimport { DataContext, DataContextProps } from './Data';\nimport { MilestoneContext, MilestoneContextProps } from './Milestone';\nimport { InstructionContext, InstructionContextProps } from './InstructionContext';\nimport { TasksContext, TasksContextProps } from './Task';\nimport { UsersContext, UsersContextProps } from './User';\nimport { LOGGED_OUT } from './ContextTypes';\nimport PortraitCache from \"./Portrait\";\nimport EventEmitter from \"eventemitter3\";\nimport { ProjectsContext, ProjectsContextProps } from './Project.js';\nimport { ChartContext, ChartContextProps } from './Chart.js';\n\nexport const isDevelopment = import.meta.env.VITE_IS_DEV;\nexport const eventEmitter = new EventEmitter();\nexport const cache = new PortraitCache();\n\nexport function login() {\n const location = window.location.pathname;\n window.location.replace(`/auth/login?origin=${encodeURI(location)}`);\n}\n\nexport async function apiFetchNoContent(url: string, details: object, handler?: string | ((response: Response) => void)): Promise {\n const response = await fetch(url, details);\n if (!response.ok) {\n if (response.status === 401) {\n eventEmitter.emit(\"LOGGED_OUT\");\n throw new Error(LOGGED_OUT);\n }\n if (handler) {\n if (typeof handler === \"string\") {\n eventEmitter.emit(\"ERROR\", handler);\n } else {\n handler(response);\n }\n }\n throw new Error(`Failed calling ${url}: ${response.status} ${response.statusText}`);\n }\n}\n\nexport async function apiFetch(url: string, details: object, handler?: string | ((response: Response) => void)): Promise {\n const response = await fetch(url, details);\n if (!response.ok) {\n if (response.status === 401) {\n eventEmitter.emit(\"LOGGED_OUT\");\n throw new Error(LOGGED_OUT);\n }\n if (handler) {\n if (typeof handler === \"string\") {\n eventEmitter.emit(\"ERROR\", handler);\n } else {\n handler(response);\n }\n }\n throw response;\n }\n return await response.json();\n}\n\nexport const handleLogout = (otherwise?: (err?: unknown) => void) => {\n return (err: unknown) => {\n if (err === LOGGED_OUT) {\n eventEmitter.emit(\"LOGGED_OUT\");\n } else if (otherwise) {\n otherwise(err)\n }\n }\n}\n\nexport function useDataContext(): DataContextProps {\n const context = useContext(DataContext);\n if (context === undefined) {\n throw new Error(\"useDataContext must be used within a DataProvider\");\n }\n return context\n}\n\nexport function useAppContext(): AppContextProps {\n const context = useContext(AppContext);\n if (context === null) {\n throw new Error('useAppContext must be used within an AppContextProvider');\n }\n return context;\n}\n\nexport function useInstructionContext(): InstructionContextProps {\n const context = useContext(InstructionContext);\n if (context === undefined) {\n throw new Error(\"useInstructionContext must be used within an InstructionProvider\");\n }\n return context;\n}\n\nexport function useTasksContext(): TasksContextProps {\n const context = useContext(TasksContext);\n if (context === undefined) {\n throw new Error(\"useTasksContext must be used within a TasksProvider\");\n }\n return context;\n}\n\nexport function useUsersContext(): UsersContextProps {\n const context = useContext(UsersContext);\n if (context === undefined) {\n throw new Error(\"useUsersContext must be used within a UsersProvider\");\n }\n return context;\n}\n\nexport function useProjectsContext(): ProjectsContextProps {\n const context = useContext(ProjectsContext);\n if (context === undefined) {\n throw new Error(\"useTasksContext must be used within a TasksProvider\");\n }\n return context;\n}\n\nexport function useChartContext(): ChartContextProps {\n const context = useContext(ChartContext);\n if (context === undefined) {\n throw new Error(\"useChartContext must be used within a ChartProvider\");\n }\n return context;\n}\n\nexport function useMilestoneContext(): MilestoneContextProps {\n const context = useContext(MilestoneContext);\n if (context === undefined) {\n throw new Error(\"useMilestoneContext must be used within a MilestoneProvider\");\n }\n return context\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","const plugin = require(\"tailwindcss/plugin\")\n\nfunction filterDefault(values) {\n\treturn Object.fromEntries(\n\t\tObject.entries(values).filter(([key]) => key !== \"DEFAULT\"),\n\t)\n}\n\nmodule.exports = plugin(\n\t({ addUtilities, matchUtilities, theme }) => {\n\t\taddUtilities({\n\t\t\t\"@keyframes enter\": theme(\"keyframes.enter\"),\n\t\t\t\"@keyframes exit\": theme(\"keyframes.exit\"),\n\t\t\t\".animate-in\": {\n\t\t\t\tanimationName: \"enter\",\n\t\t\t\tanimationDuration: theme(\"animationDuration.DEFAULT\"),\n\t\t\t\t\"--tw-enter-opacity\": \"initial\",\n\t\t\t\t\"--tw-enter-scale\": \"initial\",\n\t\t\t\t\"--tw-enter-rotate\": \"initial\",\n\t\t\t\t\"--tw-enter-translate-x\": \"initial\",\n\t\t\t\t\"--tw-enter-translate-y\": \"initial\",\n\t\t\t},\n\t\t\t\".animate-out\": {\n\t\t\t\tanimationName: \"exit\",\n\t\t\t\tanimationDuration: theme(\"animationDuration.DEFAULT\"),\n\t\t\t\t\"--tw-exit-opacity\": \"initial\",\n\t\t\t\t\"--tw-exit-scale\": \"initial\",\n\t\t\t\t\"--tw-exit-rotate\": \"initial\",\n\t\t\t\t\"--tw-exit-translate-x\": \"initial\",\n\t\t\t\t\"--tw-exit-translate-y\": \"initial\",\n\t\t\t},\n\t\t})\n\n\t\tmatchUtilities(\n\t\t\t{\n\t\t\t\t\"fade-in\": (value) => ({ \"--tw-enter-opacity\": value }),\n\t\t\t\t\"fade-out\": (value) => ({ \"--tw-exit-opacity\": value }),\n\t\t\t},\n\t\t\t{ values: theme(\"animationOpacity\") },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{\n\t\t\t\t\"zoom-in\": (value) => ({ \"--tw-enter-scale\": value }),\n\t\t\t\t\"zoom-out\": (value) => ({ \"--tw-exit-scale\": value }),\n\t\t\t},\n\t\t\t{ values: theme(\"animationScale\") },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{\n\t\t\t\t\"spin-in\": (value) => ({ \"--tw-enter-rotate\": value }),\n\t\t\t\t\"spin-out\": (value) => ({ \"--tw-exit-rotate\": value }),\n\t\t\t},\n\t\t\t{ values: theme(\"animationRotate\") },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{\n\t\t\t\t\"slide-in-from-top\": (value) => ({\n\t\t\t\t\t\"--tw-enter-translate-y\": `-${value}`,\n\t\t\t\t}),\n\t\t\t\t\"slide-in-from-bottom\": (value) => ({\n\t\t\t\t\t\"--tw-enter-translate-y\": value,\n\t\t\t\t}),\n\t\t\t\t\"slide-in-from-left\": (value) => ({\n\t\t\t\t\t\"--tw-enter-translate-x\": `-${value}`,\n\t\t\t\t}),\n\t\t\t\t\"slide-in-from-right\": (value) => ({\n\t\t\t\t\t\"--tw-enter-translate-x\": value,\n\t\t\t\t}),\n\t\t\t\t\"slide-out-to-top\": (value) => ({\n\t\t\t\t\t\"--tw-exit-translate-y\": `-${value}`,\n\t\t\t\t}),\n\t\t\t\t\"slide-out-to-bottom\": (value) => ({\n\t\t\t\t\t\"--tw-exit-translate-y\": value,\n\t\t\t\t}),\n\t\t\t\t\"slide-out-to-left\": (value) => ({\n\t\t\t\t\t\"--tw-exit-translate-x\": `-${value}`,\n\t\t\t\t}),\n\t\t\t\t\"slide-out-to-right\": (value) => ({\n\t\t\t\t\t\"--tw-exit-translate-x\": value,\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{ values: theme(\"animationTranslate\") },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{ duration: (value) => ({ animationDuration: value }) },\n\t\t\t{ values: filterDefault(theme(\"animationDuration\")) },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{ delay: (value) => ({ animationDelay: value }) },\n\t\t\t{ values: theme(\"animationDelay\") },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{ ease: (value) => ({ animationTimingFunction: value }) },\n\t\t\t{ values: filterDefault(theme(\"animationTimingFunction\")) },\n\t\t)\n\n\t\taddUtilities({\n\t\t\t\".running\": { animationPlayState: \"running\" },\n\t\t\t\".paused\": { animationPlayState: \"paused\" },\n\t\t})\n\n\t\tmatchUtilities(\n\t\t\t{ \"fill-mode\": (value) => ({ animationFillMode: value }) },\n\t\t\t{ values: theme(\"animationFillMode\") },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{ direction: (value) => ({ animationDirection: value }) },\n\t\t\t{ values: theme(\"animationDirection\") },\n\t\t)\n\n\t\tmatchUtilities(\n\t\t\t{ repeat: (value) => ({ animationIterationCount: value }) },\n\t\t\t{ values: theme(\"animationRepeat\") },\n\t\t)\n\t},\n\t{\n\t\ttheme: {\n\t\t\textend: {\n\t\t\t\tanimationDelay: ({ theme }) => ({\n\t\t\t\t\t...theme(\"transitionDelay\"),\n\t\t\t\t}),\n\t\t\t\tanimationDuration: ({ theme }) => ({\n\t\t\t\t\t0: \"0ms\",\n\t\t\t\t\t...theme(\"transitionDuration\"),\n\t\t\t\t}),\n\t\t\t\tanimationTimingFunction: ({ theme }) => ({\n\t\t\t\t\t...theme(\"transitionTimingFunction\"),\n\t\t\t\t}),\n\t\t\t\tanimationFillMode: {\n\t\t\t\t\tnone: \"none\",\n\t\t\t\t\tforwards: \"forwards\",\n\t\t\t\t\tbackwards: \"backwards\",\n\t\t\t\t\tboth: \"both\",\n\t\t\t\t},\n\t\t\t\tanimationDirection: {\n\t\t\t\t\tnormal: \"normal\",\n\t\t\t\t\treverse: \"reverse\",\n\t\t\t\t\talternate: \"alternate\",\n\t\t\t\t\t\"alternate-reverse\": \"alternate-reverse\",\n\t\t\t\t},\n\t\t\t\tanimationOpacity: ({ theme }) => ({\n\t\t\t\t\tDEFAULT: 0,\n\t\t\t\t\t...theme(\"opacity\"),\n\t\t\t\t}),\n\t\t\t\tanimationTranslate: ({ theme }) => ({\n\t\t\t\t\tDEFAULT: \"100%\",\n\t\t\t\t\t...theme(\"translate\"),\n\t\t\t\t}),\n\t\t\t\tanimationScale: ({ theme }) => ({\n\t\t\t\t\tDEFAULT: 0,\n\t\t\t\t\t...theme(\"scale\"),\n\t\t\t\t}),\n\t\t\t\tanimationRotate: ({ theme }) => ({\n\t\t\t\t\tDEFAULT: \"30deg\",\n\t\t\t\t\t...theme(\"rotate\"),\n\t\t\t\t}),\n\t\t\t\tanimationRepeat: {\n\t\t\t\t\t0: \"0\",\n\t\t\t\t\t1: \"1\",\n\t\t\t\t\tinfinite: \"infinite\",\n\t\t\t\t},\n\t\t\t\tkeyframes: {\n\t\t\t\t\tenter: {\n\t\t\t\t\t\tfrom: {\n\t\t\t\t\t\t\topacity: \"var(--tw-enter-opacity, 1)\",\n\t\t\t\t\t\t\ttransform:\n\t\t\t\t\t\t\t\t\"translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\texit: {\n\t\t\t\t\t\tto: {\n\t\t\t\t\t\t\topacity: \"var(--tw-exit-opacity, 1)\",\n\t\t\t\t\t\t\ttransform:\n\t\t\t\t\t\t\t\t\"translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n)\n","/** @type {import('tailwindcss').Config} */\nimport animate from 'tailwindcss-animate';\nimport { DarkModeConfig } from 'tailwindcss/types/config';\n\nexport default {\n mode: \"jit\",\n darkMode: 'class' as Partial,\n content: [\"./index.html\", \"./src/**/*.{js,ts,jsx,tsx}\"],\n theme: {\n extend: {\n fontSize: {\n sm: ['12px', '20px'] as [string, string],\n base: ['16px', '24px'] as [string, string],\n lg: ['20px', '28px'] as [string, string],\n xl: ['24px', '32px'] as [string, string]\n },\n colors: {\n cerulean: {\n '300': '#8AB8D0',\n '600': '#4281A4',\n '800': '#295166'\n },\n verdigris: {\n '300': '#8DCECC',\n '500': '#48A9A6',\n '700': '#37817E'\n },\n vanilla: {\n '100': '#FBF8DA',\n '300': '#F5EE9E'\n },\n rufous: {\n '400': '#EA340B',\n '600': '#A72608'\n },\n spacecadet: {\n '700': '#21295C'\n },\n ultraviolet: {\n '400': '#6046AA',\n '600': '#54428E'\n },\n hellotrope: {\n '400': '#E879F9'\n },\n night: {\n '600': '#404040',\n '900': '#151515'\n },\n aquamarine: {\n '400': '#7AE7C7'\n },\n vermillion: {\n '700': '#F24333'\n },\n background: 'hsl(var(--background))',\n foreground: 'hsl(var(--foreground))',\n card: {\n DEFAULT: 'hsl(var(--card))',\n foreground: 'hsl(var(--card-foreground))'\n },\n popover: {\n DEFAULT: 'hsl(var(--popover))',\n foreground: 'hsl(var(--popover-foreground))'\n },\n primary: {\n DEFAULT: 'hsl(var(--primary))',\n foreground: 'hsl(var(--primary-foreground))'\n },\n secondary: {\n DEFAULT: 'hsl(var(--secondary))',\n foreground: 'hsl(var(--secondary-foreground))'\n },\n muted: {\n DEFAULT: 'hsl(var(--muted))',\n foreground: 'hsl(var(--muted-foreground))'\n },\n accent: {\n DEFAULT: 'hsl(var(--accent))',\n foreground: 'hsl(var(--accent-foreground))'\n },\n destructive: {\n DEFAULT: 'hsl(var(--destructive))',\n foreground: 'hsl(var(--destructive-foreground))'\n },\n border: 'hsl(var(--border))',\n input: 'hsl(var(--input))',\n ring: 'hsl(var(--ring))',\n chart: {\n '1': 'hsl(var(--chart-1))',\n '2': 'hsl(var(--chart-2))',\n '3': 'hsl(var(--chart-3))',\n '4': 'hsl(var(--chart-4))',\n '5': 'hsl(var(--chart-5))'\n }\n },\n borderRadius: {\n lg: 'var(--radius)',\n md: 'calc(var(--radius) - 2px)',\n sm: 'calc(var(--radius) - 4px)'\n }\n }\n },\n plugins: [animate],\n};\n","// packages/core/primitive/src/primitive.tsx\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nexport {\n composeEventHandlers\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/compose-refs/src/composeRefs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => refs.forEach((ref) => setRef(ref, node));\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/context/src/createContext.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n function Provider(props) {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n function Provider(props) {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName][index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName][index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/slot/src/Slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\nvar Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n});\nSlot.displayName = \"Slot\";\nvar SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n return React.cloneElement(children, {\n ...mergeProps(slotProps, children.props),\n // @ts-ignore\n ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef\n });\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment, { children });\n};\nfunction isSlottable(child) {\n return React.isValidElement(child) && child.type === Slottable;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Slot;\nexport {\n Root,\n Slot,\n Slottable\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/primitive/src/Primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-callback-ref/src/useCallbackRef.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n if (event.key === \"Escape\") {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\nexport {\n useEscapeKeydown\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/dismissable-layer/src/DismissableLayer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-layout-effect/src/useLayoutEffect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/id/src/id.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useReactId = React[\"useId\".toString()] || (() => void 0);\nvar count = 0;\nfunction useId(deterministicId) {\n const [id, setId] = React.useState(useReactId());\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : \"\");\n}\nexport {\n useId\n};\n//# sourceMappingURL=index.mjs.map\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$map$so;\n const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (isYAxis) {\n availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;\n } else {\n availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n // Browsers without `ShadowRoot` support.\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(element) {\n const webkit = isWebKit();\n const css = getComputedStyle(element);\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isTopLayer(currentNode)) {\n return null;\n }\n if (isContainingBlock(currentNode)) {\n return currentNode;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.pageXOffset,\n scrollTop: element.pageYOffset\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getDocumentElement, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = currentWin.frameElement;\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = currentWin.frameElement;\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(element) {\n return topLayerSelectors.some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n ...clippingAncestor,\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const x = rect.left + scroll.scrollLeft - offsets.x;\n const y = rect.top + scroll.scrollTop - offsets.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n return element.offsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle