{"version":3,"file":"commons-app-useSelector.js.e2ab8bee75058ad6d260.js","mappings":"uNAIA,IAAIA,E,QAAmC,EAChC,MAAMC,EAAwBC,IACnCF,EAAmCE,CAAE,EAGjCC,EAAc,CAACC,EAAGC,IAAMD,IAAMC,EAS7B,SAASC,EAAmBC,EAAU,KAC3C,MAAMC,EAAkBD,IAAY,IAAoB,IAAyB,KAAM,IAAAE,YAAWF,GAClG,OAAO,SAAqBG,EAAUC,EAAaR,GAejD,MAAM,MACJS,EAAK,aACLC,EAAY,eACZC,GACEN,IACEO,EAAgBf,EAAiCa,EAAaG,aAAcJ,EAAMK,SAAUH,GAAkBF,EAAMK,SAAUP,EAAUC,GAE9I,OADA,IAAAO,eAAcH,GACPA,CACT,CACF,CAyBO,MAAMI,EAA2Bb,G","sources":["webpack://grfanclub-webview/./node_modules/react-redux/es/hooks/useSelector.js"],"sourcesContent":["import { useContext, useDebugValue } from 'react';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport { ReactReduxContext } from '../components/Context';\nimport { notInitialized } from '../utils/useSyncExternalStore';\nlet useSyncExternalStoreWithSelector = notInitialized;\nexport const initializeUseSelector = fn => {\n useSyncExternalStoreWithSelector = fn;\n};\n\nconst refEquality = (a, b) => a === b;\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context = ReactReduxContext) {\n const useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : () => useContext(context);\n return function useSelector(selector, equalityFn = refEquality) {\n if (process.env.NODE_ENV !== 'production') {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n\n if (typeof selector !== 'function') {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n\n if (typeof equalityFn !== 'function') {\n throw new Error(`You must pass a function as an equality function to useSelector`);\n }\n }\n\n const {\n store,\n subscription,\n getServerState\n } = useReduxContext();\n const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return
{counter}
\r\n * }\r\n */\n\nexport const useSelector = /*#__PURE__*/createSelectorHook();"],"names":["useSyncExternalStoreWithSelector","initializeUseSelector","fn","refEquality","a","b","createSelectorHook","context","useReduxContext","useContext","selector","equalityFn","store","subscription","getServerState","selectedState","addNestedSub","getState","useDebugValue","useSelector"],"sourceRoot":""}