{"version":3,"file":"js/vendors-_yarn___virtual___reach-tabs-virtual-b9916299e2_0_cache_reach-tabs-npm-0_12_1-9ee506b-9c49e0.js?_t=47f296b9080c5f59c420","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://@mlssoccer/netcore/./.yarn/__virtual__/@reach-auto-id-virtual-d1519476ff/0/cache/@reach-auto-id-npm-0.12.1-441ea23204-1f3fe10030.zip/node_modules/@reach/auto-id/dist/auto-id.esm.js","webpack://@mlssoccer/netcore/./.yarn/__virtual__/@reach-descendants-virtual-2b89c67ee7/0/cache/@reach-descendants-npm-0.12.1-763f473347-8230de2f9d.zip/node_modules/@reach/descendants/dist/descendants.esm.js","webpack://@mlssoccer/netcore/./.yarn/__virtual__/@reach-tabs-virtual-b9916299e2/0/cache/@reach-tabs-npm-0.12.1-9ee506b21c-302bf1b9bc.zip/node_modules/@reach/tabs/dist/tabs.esm.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { useIsomorphicLayoutEffect } from '@reach/utils';\n\n/*\r\n * Welcome to @reach/auto-id!\r\n\n * Let's see if we can make sense of why this hook exists and its\r\n * implementation.\r\n *\r\n * Some background:\r\n * 1. Accessibiliy APIs rely heavily on element IDs\r\n * 2. Requiring developers to put IDs on every element in Reach UI is both\r\n * cumbersome and error-prone\r\n * 3. With a component model, we can generate IDs for them!\r\n *\r\n * Solution 1: Generate random IDs.\r\n *\r\n * This works great as long as you don't server render your app. When React (in\r\n * the client) tries to reuse the markup from the server, the IDs won't match\r\n * and React will then recreate the entire DOM tree.\r\n *\r\n * Solution 2: Increment an integer\r\n *\r\n * This sounds great. Since we're rendering the exact same tree on the server\r\n * and client, we can increment a counter and get a deterministic result between\r\n * client and server. Also, JS integers can go up to nine-quadrillion. I'm\r\n * pretty sure the tab will be closed before an app never needs\r\n * 10 quadrillion IDs!\r\n *\r\n * Problem solved, right?\r\n *\r\n * Ah, but there's a catch! React's concurrent rendering makes this approach\r\n * non-deterministic. While the client and server will end up with the same\r\n * elements in the end, depending on suspense boundaries (and possibly some user\r\n * input during the initial render) the incrementing integers won't always match\r\n * up.\r\n *\r\n * Solution 3: Don't use IDs at all on the server; patch after first render.\r\n *\r\n * What we've done here is solution 2 with some tricks. With this approach, the\r\n * ID returned is an empty string on the first render. This way the server and\r\n * client have the same markup no matter how wild the concurrent rendering may\r\n * have gotten.\r\n *\r\n * After the render, we patch up the components with an incremented ID. This\r\n * causes a double render on any components with `useId`. Shouldn't be a problem\r\n * since the components using this hook should be small, and we're only updating\r\n * the ID attribute on the DOM, nothing big is happening.\r\n *\r\n * It doesn't have to be an incremented number, though--we could do generate\r\n * random strings instead, but incrementing a number is probably the cheapest\r\n * thing we can do.\r\n *\r\n * Additionally, we only do this patchup on the very first client render ever.\r\n * Any calls to `useId` that happen dynamically in the client will be\r\n * populated immediately with a value. So, we only get the double render after\r\n * server hydration and never again, SO BACK OFF ALRIGHT?\r\n */\nvar serverHandoffComplete = false;\nvar id = 0;\n\nvar genId = function genId() {\n return ++id;\n};\n/**\r\n * useId\r\n *\r\n * Autogenerate IDs to facilitate WAI-ARIA and server rendering.\r\n *\r\n * Note: The returned ID will initially be `null` and will update after a\r\n * component mounts. Users may need to supply their own ID if they need\r\n * consistent values for SSR.\r\n *\r\n * @see Docs https://reach.tech/auto-id\r\n */\n\n\nfunction useId(idFromProps) {\n /*\r\n * If this instance isn't part of the initial render, we don't have to do the\r\n * double render/patch-up dance. We can just generate the ID and return it.\r\n */\n var initialId = idFromProps || (serverHandoffComplete ? genId() : null);\n\n var _React$useState = useState(initialId),\n id = _React$useState[0],\n setId = _React$useState[1];\n\n useIsomorphicLayoutEffect(function () {\n if (id === null) {\n /*\r\n * Patch the ID after render. We do this in `useLayoutEffect` to avoid any\r\n * rendering flicker, though it'll make the first render slower (unlikely\r\n * to matter, but you're welcome to measure your app and let us know if\r\n * it's a problem).\r\n */\n setId(genId());\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n useEffect(function () {\n if (serverHandoffComplete === false) {\n /*\r\n * Flag all future uses of `useId` to skip the update dance. This is in\r\n * `useEffect` because it goes after `useLayoutEffect`, ensuring we don't\r\n * accidentally bail out of the patch-up dance prematurely.\r\n */\n serverHandoffComplete = true;\n }\n }, []);\n return id != null ? String(id) : undefined;\n}\n\nexport { useId };\n//# sourceMappingURL=auto-id.esm.js.map\n","import { useContext, useState, useCallback, createElement, useMemo } from 'react';\nimport { createNamedContext, useForceUpdate, usePrevious, useIsomorphicLayoutEffect, noop } from '@reach/utils';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\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\n return target;\n}\n\nfunction createDescendantContext(name, initialValue) {\n if (initialValue === void 0) {\n initialValue = {};\n }\n\n var descendants = [];\n return createNamedContext(name, _extends({\n descendants: descendants,\n registerDescendant: noop,\n unregisterDescendant: noop\n }, initialValue));\n}\n/**\r\n * This hook registers our descendant by passing it into an array. We can then\r\n * search that array by to find its index when registering it in the component.\r\n * We use this for focus management, keyboard navigation, and typeahead\r\n * functionality for some components.\r\n *\r\n * The hook accepts the element node and (optionally) a key. The key is useful\r\n * if multiple descendants have identical text values and we need to\r\n * differentiate siblings for some reason.\r\n *\r\n * Our main goals with this are:\r\n * 1) maximum composability,\r\n * 2) minimal API friction\r\n * 3) SSR compatibility*\r\n * 4) concurrent safe\r\n * 5) index always up-to-date with the tree despite changes\r\n * 6) works with memoization of any component in the tree (hopefully)\r\n *\r\n * * As for SSR, the good news is that we don't actually need the index on the\r\n * server for most use-cases, as we are only using it to determine the order of\r\n * composed descendants for keyboard navigation. However, in the few cases where\r\n * this is not the case, we can require an explicit index from the app.\r\n */\n\n\nfunction useDescendant(descendant, context, indexProp) {\n var forceUpdate = useForceUpdate();\n\n var _React$useContext = useContext(context),\n registerDescendant = _React$useContext.registerDescendant,\n unregisterDescendant = _React$useContext.unregisterDescendant,\n descendants = _React$useContext.descendants; // This will initially return -1 because we haven't registered the descendant\n // on the first render. After we register, this will then return the correct\n // index on the following render and we will re-register descendants\n // so that everything is up-to-date before the user interacts with a\n // collection.\n\n\n var index = indexProp !== null && indexProp !== void 0 ? indexProp : descendants.findIndex(function (item) {\n return item.element === descendant.element;\n });\n var previousDescendants = usePrevious(descendants); // We also need to re-register descendants any time ANY of the other\n // descendants have changed. My brain was melting when I wrote this and it\n // feels a little off, but checking in render and using the result in the\n // effect's dependency array works well enough.\n\n var someDescendantsHaveChanged = descendants.some(function (descendant, index) {\n var _previousDescendants$;\n\n return descendant.element !== (previousDescendants === null || previousDescendants === void 0 ? void 0 : (_previousDescendants$ = previousDescendants[index]) === null || _previousDescendants$ === void 0 ? void 0 : _previousDescendants$.element);\n }); // Prevent any flashing\n\n useIsomorphicLayoutEffect(function () {\n if (!descendant.element) forceUpdate();\n registerDescendant(_extends({}, descendant, {\n index: index\n }));\n return function () {\n return unregisterDescendant(descendant.element);\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [forceUpdate, index, registerDescendant, someDescendantsHaveChanged, unregisterDescendant].concat(Object.values(descendant)));\n return index;\n}\n\nfunction useDescendantsInit() {\n return useState([]);\n}\n\nfunction useDescendants(ctx) {\n return useContext(ctx).descendants;\n}\n\nfunction DescendantProvider(_ref) {\n var Ctx = _ref.context,\n children = _ref.children,\n items = _ref.items,\n set = _ref.set;\n var registerDescendant = useCallback(function (_ref2) {\n var element = _ref2.element,\n explicitIndex = _ref2.index,\n rest = _objectWithoutPropertiesLoose(_ref2, [\"element\", \"index\"]);\n\n if (!element) {\n return;\n }\n\n set(function (items) {\n var newItems;\n\n if (explicitIndex != null) {\n newItems = [].concat(items, [_extends({}, rest, {\n element: element,\n index: explicitIndex\n })]);\n } else if (items.length === 0) {\n // If there are no items, register at index 0 and bail.\n newItems = [].concat(items, [_extends({}, rest, {\n element: element,\n index: 0\n })]);\n } else if (items.find(function (item) {\n return item.element === element;\n })) {\n // If the element is already registered, just use the same array\n newItems = items;\n } else {\n // When registering a descendant, we need to make sure we insert in\n // into the array in the same order that it appears in the DOM. So as\n // new descendants are added or maybe some are removed, we always know\n // that the array is up-to-date and correct.\n //\n // So here we look at our registered descendants and see if the new\n // element we are adding appears earlier than an existing descendant's\n // DOM node via `node.compareDocumentPosition`. If it does, we insert\n // the new element at this index. Because `registerDescendant` will be\n // called in an effect every time the descendants state value changes,\n // we should be sure that this index is accurate when descendent\n // elements come or go from our component.\n var index = items.findIndex(function (item) {\n if (!item.element || !element) {\n return false;\n } // Does this element's DOM node appear before another item in the\n // array in our DOM tree? If so, return true to grab the index at\n // this point in the array so we know where to insert the new\n // element.\n\n\n return Boolean(item.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING);\n });\n\n var newItem = _extends({}, rest, {\n element: element,\n index: index\n }); // If an index is not found we will push the element to the end.\n\n\n if (index === -1) {\n newItems = [].concat(items, [newItem]);\n } else {\n newItems = [].concat(items.slice(0, index), [newItem], items.slice(index));\n }\n }\n\n return newItems.map(function (item, index) {\n return _extends({}, item, {\n index: index\n });\n });\n });\n }, // set is a state setter initialized by the useDescendantsInit hook.\n // We can safely ignore the lint warning here because it will not change\n // between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n var unregisterDescendant = useCallback(function (element) {\n if (!element) {\n return;\n }\n\n set(function (items) {\n return items.filter(function (item) {\n return element !== item.element;\n });\n });\n }, // set is a state setter initialized by the useDescendantsInit hook.\n // We can safely ignore the lint warning here because it will not change\n // between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n return createElement(Ctx.Provider, {\n value: useMemo(function () {\n return {\n descendants: items,\n registerDescendant: registerDescendant,\n unregisterDescendant: unregisterDescendant\n };\n }, [items, registerDescendant, unregisterDescendant])\n }, children);\n}\n/**\r\n * Testing this as an abstraction for compound components that use keyboard\r\n * navigation. Hoping this will help us prevent bugs and mismatched behavior\r\n * across various components, but it may also prove to be too messy of an\r\n * abstraction in the end.\r\n *\r\n * Currently used in:\r\n * - Tabs\r\n * - Accordion\r\n *\r\n * @param context\r\n * @param options\r\n */\n\n\nfunction useDescendantKeyDown(context, options) {\n var _React$useContext2 = useContext(context),\n descendants = _React$useContext2.descendants;\n\n var callback = options.callback,\n currentIndex = options.currentIndex,\n filter = options.filter,\n _options$key = options.key,\n key = _options$key === void 0 ? \"index\" : _options$key,\n _options$orientation = options.orientation,\n orientation = _options$orientation === void 0 ? \"vertical\" : _options$orientation,\n _options$rotate = options.rotate,\n rotate = _options$rotate === void 0 ? true : _options$rotate,\n _options$rtl = options.rtl,\n rtl = _options$rtl === void 0 ? false : _options$rtl;\n var index = currentIndex !== null && currentIndex !== void 0 ? currentIndex : -1;\n return function handleKeyDown(event) {\n if (![\"ArrowDown\", \"ArrowUp\", \"ArrowLeft\", \"ArrowRight\", \"PageUp\", \"PageDown\", \"Home\", \"End\"].includes(event.key)) {\n return;\n } // If we use a filter function, we need to re-index our descendants array\n // so that filtered descendent elements aren't selected.\n\n\n var selectableDescendants = filter ? descendants.filter(filter) : descendants; // Current index should map to the updated array vs. the original\n // descendants array.\n\n if (filter) {\n index = selectableDescendants.findIndex(function (descendant) {\n return descendant.index === currentIndex;\n });\n } // We need some options for any of this to work!\n\n\n if (!selectableDescendants.length) {\n return;\n }\n\n function getNextOption() {\n var atBottom = index === selectableDescendants.length - 1;\n return atBottom ? rotate ? getFirstOption() : selectableDescendants[index] : selectableDescendants[(index + 1) % selectableDescendants.length];\n }\n\n function getPreviousOption() {\n var atTop = index === 0;\n return atTop ? rotate ? getLastOption() : selectableDescendants[index] : selectableDescendants[(index - 1 + selectableDescendants.length) % selectableDescendants.length];\n }\n\n function getFirstOption() {\n return selectableDescendants[0];\n }\n\n function getLastOption() {\n return selectableDescendants[selectableDescendants.length - 1];\n }\n\n switch (event.key) {\n case \"ArrowDown\":\n if (orientation === \"vertical\" || orientation === \"both\") {\n event.preventDefault();\n var next = getNextOption();\n callback(key === \"option\" ? next : next[key]);\n }\n\n break;\n\n case \"ArrowUp\":\n if (orientation === \"vertical\" || orientation === \"both\") {\n event.preventDefault();\n var prev = getPreviousOption();\n callback(key === \"option\" ? prev : prev[key]);\n }\n\n break;\n\n case \"ArrowLeft\":\n if (orientation === \"horizontal\" || orientation === \"both\") {\n event.preventDefault();\n var nextOrPrev = (rtl ? getNextOption : getPreviousOption)();\n callback(key === \"option\" ? nextOrPrev : nextOrPrev[key]);\n }\n\n break;\n\n case \"ArrowRight\":\n if (orientation === \"horizontal\" || orientation === \"both\") {\n event.preventDefault();\n var prevOrNext = (rtl ? getPreviousOption : getNextOption)();\n callback(key === \"option\" ? prevOrNext : prevOrNext[key]);\n }\n\n break;\n\n case \"PageUp\":\n event.preventDefault();\n var prevOrFirst = (event.ctrlKey ? getPreviousOption : getFirstOption)();\n callback(key === \"option\" ? prevOrFirst : prevOrFirst[key]);\n break;\n\n case \"Home\":\n event.preventDefault();\n var first = getFirstOption();\n callback(key === \"option\" ? first : first[key]);\n break;\n\n case \"PageDown\":\n event.preventDefault();\n var nextOrLast = (event.ctrlKey ? getNextOption : getLastOption)();\n callback(key === \"option\" ? nextOrLast : nextOrLast[key]);\n break;\n\n case \"End\":\n event.preventDefault();\n var last = getLastOption();\n callback(key === \"option\" ? last : last[key]);\n break;\n }\n };\n}\n\nexport { DescendantProvider, createDescendantContext, useDescendant, useDescendantKeyDown, useDescendants, useDescendantsInit };\n//# sourceMappingURL=descendants.esm.js.map\n","import { useRef, useState, useMemo, createElement, useContext, useEffect, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport { useDescendantsInit, DescendantProvider, useDescendant, createDescendantContext, useDescendants, useDescendantKeyDown } from '@reach/descendants';\nimport { forwardRefWithAs, useControlledSwitchWarning, makeId, useControlledState, isFunction, noop, useCheckStyles, isNumber, memoWithAs, useForkedRef, useUpdateEffect, useEventCallback, wrapEvent, createNamedContext, getElementComputedStyle, useIsomorphicLayoutEffect, boolOrBoolString, cloneValidElement } from '@reach/utils';\nimport { useId } from '@reach/auto-id';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\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\n return target;\n}\n\nvar TabsDescendantsContext = /*#__PURE__*/createDescendantContext(\"TabsDescendantsContext\");\nvar TabPanelDescendantsContext = /*#__PURE__*/createDescendantContext(\"TabPanelDescendantsContext\");\nvar TabsContext = /*#__PURE__*/createNamedContext(\"TabsContext\", {});\nvar TabsKeyboardActivation;\n\n(function (TabsKeyboardActivation) {\n TabsKeyboardActivation[\"Auto\"] = \"auto\";\n TabsKeyboardActivation[\"Manual\"] = \"manual\";\n})(TabsKeyboardActivation || (TabsKeyboardActivation = {}));\n\nvar TabsOrientation;\n\n(function (TabsOrientation) {\n TabsOrientation[\"Horizontal\"] = \"horizontal\";\n TabsOrientation[\"Vertical\"] = \"vertical\";\n})(TabsOrientation || (TabsOrientation = {})); ////////////////////////////////////////////////////////////////////////////////\n\n/**\r\n * Tabs\r\n *\r\n * The parent component of the tab interface.\r\n *\r\n * @see Docs https://reach.tech/tabs#tabs\r\n */\n\n\nvar Tabs = /*#__PURE__*/forwardRefWithAs(function Tabs(_ref, ref) {\n var _props$id;\n\n var _ref$as = _ref.as,\n Comp = _ref$as === void 0 ? \"div\" : _ref$as,\n children = _ref.children,\n defaultIndex = _ref.defaultIndex,\n _ref$orientation = _ref.orientation,\n orientation = _ref$orientation === void 0 ? TabsOrientation.Horizontal : _ref$orientation,\n _ref$index = _ref.index,\n controlledIndex = _ref$index === void 0 ? undefined : _ref$index,\n _ref$keyboardActivati = _ref.keyboardActivation,\n keyboardActivation = _ref$keyboardActivati === void 0 ? TabsKeyboardActivation.Auto : _ref$keyboardActivati,\n onChange = _ref.onChange,\n _ref$readOnly = _ref.readOnly,\n readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,\n props = _objectWithoutPropertiesLoose(_ref, [\"as\", \"children\", \"defaultIndex\", \"orientation\", \"index\", \"keyboardActivation\", \"onChange\", \"readOnly\"]);\n\n var isControlled = useRef(controlledIndex != null);\n useControlledSwitchWarning(controlledIndex, \"index\", \"Tabs\");\n\n var _id = useId(props.id);\n\n var id = (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : makeId(\"tabs\", _id); // We only manage focus if the user caused the update vs. a new controlled\n // index coming in.\n\n var userInteractedRef = useRef(false);\n var selectedPanelRef = useRef(null);\n var isRTL = useRef(false);\n\n var _useControlledState = useControlledState(controlledIndex, defaultIndex !== null && defaultIndex !== void 0 ? defaultIndex : 0),\n selectedIndex = _useControlledState[0],\n setSelectedIndex = _useControlledState[1];\n\n var _React$useState = useState(-1),\n focusedIndex = _React$useState[0],\n setFocusedIndex = _React$useState[1];\n\n var _useDescendantsInit = useDescendantsInit(),\n tabs = _useDescendantsInit[0],\n setTabs = _useDescendantsInit[1];\n\n var context = useMemo(function () {\n return {\n focusedIndex: focusedIndex,\n id: id,\n isControlled: isControlled.current,\n isRTL: isRTL,\n keyboardActivation: keyboardActivation,\n onFocusPanel: function onFocusPanel() {\n if (selectedPanelRef.current && isFunction(selectedPanelRef.current.focus)) {\n selectedPanelRef.current.focus();\n }\n },\n onSelectTab: readOnly ? noop : function (index) {\n userInteractedRef.current = true;\n onChange && onChange(index);\n setSelectedIndex(index);\n },\n onSelectTabWithKeyboard: readOnly ? noop : function (index) {\n userInteractedRef.current = true;\n\n switch (keyboardActivation) {\n case TabsKeyboardActivation.Manual:\n var tabElement = tabs[index] && tabs[index].element;\n\n if (tabElement && isFunction(tabElement.focus)) {\n tabElement.focus();\n }\n\n return;\n\n case TabsKeyboardActivation.Auto:\n default:\n onChange && onChange(index);\n setSelectedIndex(index);\n return;\n }\n },\n orientation: orientation,\n selectedIndex: selectedIndex,\n selectedPanelRef: selectedPanelRef,\n setFocusedIndex: setFocusedIndex,\n setSelectedIndex: setSelectedIndex,\n userInteractedRef: userInteractedRef\n };\n }, [focusedIndex, id, keyboardActivation, onChange, orientation, readOnly, selectedIndex, setSelectedIndex, tabs]);\n useCheckStyles(\"tabs\");\n return createElement(DescendantProvider, {\n context: TabsDescendantsContext,\n items: tabs,\n set: setTabs\n }, createElement(TabsContext.Provider, {\n value: context\n }, createElement(Comp, Object.assign({}, props, {\n ref: ref,\n \"data-reach-tabs\": \"\",\n \"data-orientation\": orientation,\n id: props.id\n }), isFunction(children) ? children({\n focusedIndex: focusedIndex,\n id: id,\n selectedIndex: selectedIndex\n }) : children)));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n Tabs.displayName = \"Tabs\";\n Tabs.propTypes = {\n children: /*#__PURE__*/PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n onChange: PropTypes.func,\n orientation: /*#__PURE__*/PropTypes.oneOf( /*#__PURE__*/Object.values(TabsOrientation)),\n index: function index(props, name, compName, location, propName) {\n var val = props[name];\n\n if (props.index > -1 && props.onChange == null && props.readOnly !== true) {\n return new Error(\"You provided a value prop to `\" + compName + \"` without an `onChange` handler. This will render a read-only tabs element. If the tabs should be mutable use `defaultIndex`. Otherwise, set `onChange`.\");\n } else if (val != null && !isNumber(val)) {\n return new Error(\"Invalid prop `\" + propName + \"` supplied to `\" + compName + \"`. Expected `number`, received `\" + (Array.isArray(val) ? \"array\" : typeof val) + \"`.\");\n }\n\n return null;\n },\n defaultIndex: PropTypes.number\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\r\n * TabList\r\n *\r\n * The parent component of the tabs.\r\n *\r\n * @see Docs https://reach.tech/tabs#tablist\r\n */\n\n\nvar TabListImpl = /*#__PURE__*/forwardRefWithAs(function TabList(_ref2, forwardedRef) {\n var children = _ref2.children,\n _ref2$as = _ref2.as,\n Comp = _ref2$as === void 0 ? \"div\" : _ref2$as,\n onKeyDown = _ref2.onKeyDown,\n props = _objectWithoutPropertiesLoose(_ref2, [\"children\", \"as\", \"onKeyDown\"]);\n\n var _React$useContext = useContext(TabsContext),\n focusedIndex = _React$useContext.focusedIndex,\n isControlled = _React$useContext.isControlled,\n isRTL = _React$useContext.isRTL,\n keyboardActivation = _React$useContext.keyboardActivation,\n onSelectTabWithKeyboard = _React$useContext.onSelectTabWithKeyboard,\n orientation = _React$useContext.orientation,\n selectedIndex = _React$useContext.selectedIndex,\n setSelectedIndex = _React$useContext.setSelectedIndex;\n\n var tabs = useDescendants(TabsDescendantsContext);\n var ownRef = useRef(null);\n var ref = useForkedRef(forwardedRef, ownRef);\n useEffect(function () {\n if (ownRef.current && (ownRef.current.ownerDocument && ownRef.current.ownerDocument.dir === \"rtl\" || getElementComputedStyle(ownRef.current, \"direction\") === \"rtl\")) {\n isRTL.current = true;\n }\n }, [isRTL]);\n var handleKeyDown = useEventCallback(wrapEvent(onKeyDown, useDescendantKeyDown(TabsDescendantsContext, {\n currentIndex: keyboardActivation === TabsKeyboardActivation.Manual ? focusedIndex : selectedIndex,\n orientation: orientation,\n rotate: true,\n callback: onSelectTabWithKeyboard,\n filter: function filter(tab) {\n return !tab.disabled;\n },\n rtl: isRTL.current\n })));\n useIsomorphicLayoutEffect(function () {\n var _tabs$selectedIndex;\n\n // In the event an uncontrolled component's selected index is disabled,\n // (this should only happen if the first tab is disabled and no default\n // index is set), we need to override the selection to the next selectable\n // index value.\n if (!isControlled && boolOrBoolString((_tabs$selectedIndex = tabs[selectedIndex]) === null || _tabs$selectedIndex === void 0 ? void 0 : _tabs$selectedIndex.disabled)) {\n var next = tabs.find(function (tab) {\n return !tab.disabled;\n });\n\n if (next) {\n setSelectedIndex(next.index);\n }\n }\n }, [tabs, isControlled, selectedIndex, setSelectedIndex]);\n return createElement(Comp // The element that serves as the container for the set of tabs has role\n // `tablist`\n // https://www.w3.org/TR/wai-aria-practices-1.2/#tabpanel\n , Object.assign({\n // The element that serves as the container for the set of tabs has role\n // `tablist`\n // https://www.w3.org/TR/wai-aria-practices-1.2/#tabpanel\n role: \"tablist\",\n \"aria-orientation\": orientation\n }, props, {\n \"data-reach-tab-list\": \"\",\n ref: ref,\n onKeyDown: handleKeyDown\n }), Children.map(children, function (child, index) {\n // TODO: Remove in 1.0\n return cloneValidElement(child, {\n isSelected: index === selectedIndex\n });\n }));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n TabListImpl.displayName = \"TabList\";\n TabListImpl.propTypes = {\n as: PropTypes.any,\n children: PropTypes.node\n };\n}\n\nvar TabList = /*#__PURE__*/memoWithAs(TabListImpl);\n\nif (process.env.NODE_ENV !== \"production\") {\n TabList.displayName = \"TabList\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\r\n * Tab\r\n *\r\n * The interactive element that changes the selected panel.\r\n *\r\n * @see Docs https://reach.tech/tabs#tab\r\n */\n\n\nvar Tab = /*#__PURE__*/forwardRefWithAs(function Tab(_ref3, forwardedRef) {\n var _ = _ref3.isSelected,\n children = _ref3.children,\n _ref3$as = _ref3.as,\n Comp = _ref3$as === void 0 ? \"button\" : _ref3$as,\n indexProp = _ref3.index,\n disabled = _ref3.disabled,\n onBlur = _ref3.onBlur,\n onFocus = _ref3.onFocus,\n props = _objectWithoutPropertiesLoose(_ref3, [\"isSelected\", \"children\", \"as\", \"index\", \"disabled\", \"onBlur\", \"onFocus\"]);\n\n var _React$useContext2 = useContext(TabsContext),\n tabsId = _React$useContext2.id,\n onSelectTab = _React$useContext2.onSelectTab,\n orientation = _React$useContext2.orientation,\n selectedIndex = _React$useContext2.selectedIndex,\n userInteractedRef = _React$useContext2.userInteractedRef,\n setFocusedIndex = _React$useContext2.setFocusedIndex;\n\n var ownRef = useRef(null);\n var ref = useForkedRef(forwardedRef, ownRef);\n var index = useDescendant({\n element: ownRef.current,\n disabled: !!disabled\n }, TabsDescendantsContext, indexProp);\n var htmlType = Comp === \"button\" && props.type == null ? \"button\" : props.type;\n var isSelected = index === selectedIndex;\n\n function onSelect() {\n onSelectTab(index);\n }\n\n useUpdateEffect(function () {\n if (isSelected && ownRef.current && userInteractedRef.current) {\n userInteractedRef.current = false;\n\n if (isFunction(ownRef.current.focus)) {\n ownRef.current.focus();\n }\n }\n }, [isSelected, userInteractedRef]);\n var handleFocus = useEventCallback(wrapEvent(onFocus, function () {\n setFocusedIndex(index);\n }));\n var handleBlur = useEventCallback(wrapEvent(onBlur, function () {\n setFocusedIndex(-1);\n }));\n return createElement(Comp // Each element with role `tab` has the property `aria-controls` referring\n // to its associated `tabpanel` element.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#tabpanel\n , Object.assign({\n \"aria-controls\": makeId(tabsId, \"panel\", index),\n \"aria-disabled\": disabled,\n \"aria-selected\": isSelected,\n // Each element that serves as a tab has role `tab` and is contained\n // within the element with role `tablist`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#tabpanel\n role: \"tab\",\n tabIndex: isSelected ? 0 : -1\n }, props, {\n ref: ref,\n \"data-reach-tab\": \"\",\n \"data-orientation\": orientation,\n \"data-selected\": isSelected ? \"\" : undefined,\n disabled: disabled,\n id: makeId(tabsId, \"tab\", index),\n onClick: onSelect,\n onFocus: handleFocus,\n onBlur: handleBlur,\n type: htmlType\n }), children);\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n Tab.displayName = \"Tab\";\n Tab.propTypes = {\n children: PropTypes.node,\n disabled: PropTypes.bool\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\r\n * TabPanels\r\n *\r\n * The parent component of the panels.\r\n *\r\n * @see Docs https://reach.tech/tabs#tabpanels\r\n */\n\n\nvar TabPanelsImpl = /*#__PURE__*/forwardRefWithAs(function TabPanels(_ref4, forwardedRef) {\n var children = _ref4.children,\n _ref4$as = _ref4.as,\n Comp = _ref4$as === void 0 ? \"div\" : _ref4$as,\n props = _objectWithoutPropertiesLoose(_ref4, [\"children\", \"as\"]);\n\n var ownRef = useRef();\n var ref = useForkedRef(ownRef, forwardedRef);\n\n var _useDescendantsInit2 = useDescendantsInit(),\n tabPanels = _useDescendantsInit2[0],\n setTabPanels = _useDescendantsInit2[1];\n\n return createElement(DescendantProvider, {\n context: TabPanelDescendantsContext,\n items: tabPanels,\n set: setTabPanels\n }, createElement(Comp, Object.assign({}, props, {\n ref: ref,\n \"data-reach-tab-panels\": \"\"\n }), children));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n TabPanelsImpl.displayName = \"TabPanels\";\n TabPanelsImpl.propTypes = {\n as: PropTypes.any,\n children: PropTypes.node\n };\n}\n\nvar TabPanels = /*#__PURE__*/memoWithAs(TabPanelsImpl);\n\nif (process.env.NODE_ENV !== \"production\") {\n TabPanels.displayName = \"TabPanels\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\r\n * TabPanel\r\n *\r\n * The panel that displays when it's corresponding tab is active.\r\n *\r\n * @see Docs https://reach.tech/tabs#tabpanel\r\n */\n\n\nvar TabPanel = /*#__PURE__*/forwardRefWithAs(function TabPanel(_ref5, forwardedRef) {\n var children = _ref5.children,\n ariaLabel = _ref5[\"aria-label\"],\n _ref5$as = _ref5.as,\n Comp = _ref5$as === void 0 ? \"div\" : _ref5$as,\n props = _objectWithoutPropertiesLoose(_ref5, [\"children\", \"aria-label\", \"as\"]);\n\n var _React$useContext3 = useContext(TabsContext),\n selectedPanelRef = _React$useContext3.selectedPanelRef,\n selectedIndex = _React$useContext3.selectedIndex,\n tabsId = _React$useContext3.id;\n\n var ownRef = useRef(null);\n var index = useDescendant({\n element: ownRef.current\n }, TabPanelDescendantsContext);\n var id = makeId(tabsId, \"panel\", index); // Because useDescendant will always return -1 on the first render,\n // `isSelected` will briefly be false for all tabs. We set a tab panel's\n // hidden attribute based `isSelected` being false, meaning that all tabs\n // are initially hidden. This makes it impossible for consumers to do\n // certain things, like focus an element inside the active tab panel when\n // the page loads. So what we can do is track that a panel is \"ready\" to be\n // hidden once effects are run (descendants work their magic in\n // useLayoutEffect, so we can set our ref in useEffecct to run later). We\n // can use a ref instead of state because we're always geting a re-render\n // anyway thanks to descendants. This is a little more coupled to the\n // implementation details of descendants than I'd like, but we'll add a test\n // to (hopefully) catch any regressions.\n\n var isSelected = index === selectedIndex;\n var readyToHide = useRef(false);\n var hidden = readyToHide.current ? !isSelected : false;\n useEffect(function () {\n readyToHide.current = true;\n }, []);\n var ref = useForkedRef(forwardedRef, ownRef, isSelected ? selectedPanelRef : null);\n return createElement(Comp // Each element with role `tabpanel` has the property `aria-labelledby`\n // referring to its associated tab element.\n , Object.assign({\n \"aria-labelledby\": makeId(tabsId, \"tab\", index),\n hidden: hidden,\n // Each element that contains the content panel for a tab has role\n // `tabpanel`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#tabpanel\n role: \"tabpanel\",\n tabIndex: isSelected ? 0 : -1\n }, props, {\n ref: ref,\n \"data-reach-tab-panel\": \"\",\n id: id\n }), children);\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n TabPanel.displayName = \"TabPanel\";\n TabPanel.propTypes = {\n as: PropTypes.any,\n children: PropTypes.node\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\r\n * A hook that exposes data for a given `Tabs` component to its descendants.\r\n *\r\n * @see Docs https://reach.tech/tabs#usetabscontext\r\n */\n\n\nfunction useTabsContext() {\n var _React$useContext4 = useContext(TabsContext),\n focusedIndex = _React$useContext4.focusedIndex,\n id = _React$useContext4.id,\n selectedIndex = _React$useContext4.selectedIndex;\n\n return useMemo(function () {\n return {\n focusedIndex: focusedIndex,\n id: id,\n selectedIndex: selectedIndex\n };\n }, [focusedIndex, id, selectedIndex]);\n}\n\nexport { Tab, TabList, TabPanel, TabPanels, Tabs, TabsKeyboardActivation, TabsOrientation, useTabsContext };\n//# sourceMappingURL=tabs.esm.js.map\n"],"names":[],"sourceRoot":""}