{"version":3,"file":"index-D0BqwZqG.js","sources":["../../../node_modules/react-redux/es/components/connectAdvanced.js","../../../node_modules/react-redux/es/utils/shallowEqual.js","../../../node_modules/react-redux/es/connect/wrapMapToProps.js","../../../node_modules/react-redux/es/connect/mapDispatchToProps.js","../../../node_modules/react-redux/es/connect/mapStateToProps.js","../../../node_modules/react-redux/es/connect/mergeProps.js","../../../node_modules/react-redux/es/connect/selectorFactory.js","../../../node_modules/react-redux/es/connect/connect.js","../../../node_modules/@eppo/js-client-sdk-common/dist/lru-cache.js","../../../node_modules/crypt/crypt.js","../../../node_modules/charenc/charenc.js","../../../node_modules/is-buffer/index.js","../../../node_modules/md5/md5.js","../../../node_modules/universal-base64/dist/browser.js","../../../node_modules/@eppo/js-client-sdk-common/dist/obfuscation.js","../../../node_modules/@eppo/js-client-sdk-common/dist/assignment-cache.js","../../../node_modules/@eppo/js-client-sdk-common/dist/constants.js","../../../node_modules/@eppo/js-client-sdk-common/dist/interfaces.js","../../../node_modules/@eppo/js-client-sdk-common/dist/decoding.js","../../../node_modules/@eppo/js-client-sdk-common/dist/eppo_value.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/internal/constants.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/internal/debug.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/internal/re.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/internal/parse-options.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/internal/identifiers.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/classes/semver.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/parse.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/valid.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/clean.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/inc.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/diff.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/major.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/minor.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/patch.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/prerelease.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/compare.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/rcompare.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/compare-loose.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/compare-build.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/sort.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/rsort.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/gt.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/lt.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/eq.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/neq.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/gte.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/lte.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/cmp.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/coerce.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/internal/lrucache.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/classes/range.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/classes/comparator.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/functions/satisfies.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/to-comparators.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/max-satisfying.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/min-satisfying.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/min-version.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/valid.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/outside.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/gtr.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/ltr.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/intersects.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/simplify.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/ranges/subset.js","../../../node_modules/@eppo/js-client-sdk-common/node_modules/semver/index.js","../../../node_modules/@eppo/js-client-sdk-common/dist/rules.js","../../../node_modules/@eppo/js-client-sdk-common/dist/sharders.js","../../../node_modules/@eppo/js-client-sdk-common/dist/evaluator.js","../../../node_modules/@eppo/js-client-sdk-common/dist/flag-configuration-requestor.js","../../../node_modules/@eppo/js-client-sdk-common/dist/http-client.js","../../../node_modules/quick-format-unescaped/index.js","../../../node_modules/pino/browser.js","../../../node_modules/@eppo/js-client-sdk-common/dist/application-logger.js","../../../node_modules/@eppo/js-client-sdk-common/dist/poller.js","../../../node_modules/@eppo/js-client-sdk-common/dist/validation.js","../../../node_modules/@eppo/js-client-sdk-common/dist/version.js","../../../node_modules/@eppo/js-client-sdk-common/dist/client/eppo-client.js","../../../node_modules/@eppo/js-client-sdk-common/dist/index.js","../../../node_modules/@eppo/js-client-sdk/dist/local-storage.js","../../../node_modules/@eppo/js-client-sdk/dist/local-storage-assignment-cache.js","../../../node_modules/@eppo/js-client-sdk/dist/sdk-data.js","../../../node_modules/@eppo/js-client-sdk/dist/index.js","../../../app/javascript/src/explore/services/ahoy/index.js","../../../app/javascript/src/explore/services/analytics/index.ts","../../../node_modules/redux-form/es/ReduxFormContext.js","../../../node_modules/redux-form/es/defaultShouldAsyncValidate.js","../../../node_modules/redux-form/es/defaultShouldValidate.js","../../../node_modules/redux-form/es/defaultShouldError.js","../../../node_modules/redux-form/es/defaultShouldWarn.js","../../../node_modules/redux-form/es/util/prefixName.js","../../../node_modules/redux-form/es/util/validateComponentProp.js","../../../node_modules/es6-error/es6/index.js","../../../node_modules/redux-form/es/SubmissionError.js","../../../node_modules/redux-form/es/createFieldProps.js","../../../node_modules/redux-form/es/events/isEvent.js","../../../node_modules/redux-form/es/events/getValue.js","../../../node_modules/redux-form/es/isReactNative.js","../../../node_modules/redux-form/es/events/onChangeValue.js","../../../node_modules/redux-form/es/util/eventConsts.js","../../../node_modules/redux-form/es/ConnectedField.js","../../../node_modules/redux-form/es/util/shallowCompare.js","../../../node_modules/redux-form/es/createField.js","../../../node_modules/redux-form/es/Field.js","../../../node_modules/redux-form/es/hasError.js","../../../node_modules/redux-form/es/selectors/isValid.js","../../../node_modules/is-promise/index.js","../../../node_modules/redux-form/es/asyncValidation.js","../../../node_modules/redux-form/es/events/silenceEvent.js","../../../node_modules/redux-form/es/events/silenceEvents.js","../../../node_modules/redux-form/es/generateValidator.js","../../../node_modules/redux-form/es/handleSubmit.js","../../../node_modules/redux-form/es/util/getDisplayName.js","../../../node_modules/redux-form/es/util/isHotReloading.js","../../../node_modules/redux-form/es/createReduxForm.js","../../../node_modules/redux-form/es/reduxForm.js","../../../app/javascript/src/explore/services/mobile/index.ts","../../../node_modules/lodash-es/pickBy.js","../../../app/javascript/src/explore/data/cart/cart_items/actions.js","../../../app/javascript/src/explore/services/redirect/index.js","../../../app/javascript/src/explore/elements/Redirector/index.jsx","../../../app/javascript/src/explore/hocs/withRedirector/index.jsx","../../../app/javascript/src/explore/services/Eppo/index.ts","../../../app/javascript/src/explore/compositions/Cart/elements/Checkout/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/Comment/elements/Form/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/Comment/index.jsx","../../../app/javascript/src/explore/data/cart/gift_card_codes/actions.js","../../../app/javascript/src/explore/hocs/withShopConfig/index.jsx","../../../app/javascript/src/explore/elements/DollarsAndCents/index.tsx","../../../app/javascript/src/explore/compositions/Cart/elements/DiscountCodes/elements/DiscountCode/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/DiscountCodes/elements/Error/index.jsx","../../../app/javascript/src/explore/elements/Label/index.tsx","../../../app/javascript/src/explore/compositions/Cart/elements/DiscountCodes/elements/Form/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/DiscountCodes/elements/AuthRequiredMessage/index.tsx","../../../app/javascript/src/explore/compositions/Cart/elements/DiscountCodes/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/Extras/index.jsx","../../../app/javascript/src/explore/elements/TooltipV2/index.tsx","../../../app/javascript/src/explore/elements/CartLineItem/index.jsx","../../../app/javascript/src/explore/compositions/CartBill/elements/Total/index.tsx","../../../app/javascript/src/explore/compositions/CartBill/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/Footer/index.jsx","../../../app/javascript/src/explore/elements/bs4/ButtonWithIcon/index.tsx","../../../app/javascript/src/explore/services/NumberShortener/index.js","../../../app/javascript/src/explore/compositions/Cart/elements/Header/index.tsx","../../../app/javascript/src/shoppe/elements/KlarnaElement/index.tsx","../../../app/javascript/src/explore/compositions/Cart/elements/KlarnaMessaging/index.tsx","../../../app/javascript/src/explore/data/cart/gift_cards/actions.js","../../../app/javascript/src/shoppe/elements/ProductWarning/index.tsx","../../../app/javascript/src/explore/compositions/CartItems/compositions/GiftCards/elements/GiftCard/index.jsx","../../../app/javascript/src/explore/compositions/CartItems/compositions/GiftCards/index.jsx","../../../app/javascript/src/explore/elements/ToSentence/index.jsx","../../../app/javascript/src/explore/compositions/CartItems/compositions/Subcarts/elements/Subcart/elements/CartItem/elements/ImageWrap/index.tsx","../../../app/javascript/src/explore/compositions/CartItems/compositions/Subcarts/elements/Subcart/elements/CartItem/elements/Price/index.tsx","../../../app/javascript/src/explore/compositions/CartItems/compositions/Subcarts/elements/Subcart/elements/CartItem/index.jsx","../../../app/javascript/src/explore/compositions/CartItems/compositions/Subcarts/elements/Subcart/index.jsx","../../../app/javascript/src/explore/compositions/CartItems/compositions/Subcarts/index.jsx","../../../app/javascript/src/explore/compositions/CartItems/index.tsx","../../../app/javascript/src/explore/compositions/Cart/elements/Empty/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/ErrorBox/index.jsx","../../../app/assets/images/cash_hand-2x.png","../../../app/javascript/src/explore/compositions/Cart/elements/PromoRedemption/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/Main/elements/PurchaseRewards/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/Main/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/MobileCheckout/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/Modal/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/PaymentMethods/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/RewardsCoulda/index.jsx","../../../app/javascript/src/explore/compositions/Cart/elements/RewardsInfo/index.tsx","../../../app/javascript/src/explore/compositions/Cart/elements/TopBanner/index.jsx","../../../app/javascript/src/explore/compositions/Cart/scenes/PurchaseRewards/index.jsx","../../../app/javascript/src/explore/compositions/Cart/scenes/Rewards/elements/Options/index.jsx","../../../app/javascript/src/explore/compositions/Cart/scenes/Rewards/index.jsx","../../../app/javascript/src/explore/compositions/Cart/index.jsx"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport hoistStatics from 'hoist-non-react-statics';\nimport React, { useContext, useMemo, useRef, useReducer } from 'react';\nimport { isValidElementType, isContextConsumer } from 'react-is';\nimport Subscription from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from './Context'; // Define some constant arrays just to avoid re-creating these\n\nvar EMPTY_ARRAY = [];\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\n\nvar stringifyComponent = function stringifyComponent(Comp) {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\n\nfunction storeStateUpdatesReducer(state, action) {\n var updateCount = state[1];\n return [action.payload, updateCount + 1];\n}\n\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(function () {\n return effectFunc.apply(void 0, effectArgs);\n }, dependencies);\n}\n\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n // We want to capture the wrapper props and child props we used for later comparisons\n lastWrapperProps.current = wrapperProps;\n lastChildProps.current = actualChildProps;\n renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update\n\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\n\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {\n // If we're not subscribed to the store, nothing to do here\n if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts\n\n var didUnsubscribe = false;\n var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component\n\n var checkForUpdates = function checkForUpdates() {\n if (didUnsubscribe) {\n // Don't run stale listeners.\n // Redux doesn't guarantee unsubscriptions happen until next dispatch.\n return;\n }\n\n var latestStoreState = store.getState();\n var newChildProps, error;\n\n try {\n // Actually run the selector with the most recent store state and wrapper props\n // to determine what the child props should be\n newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n\n if (!error) {\n lastThrownError = null;\n } // If the child props haven't changed, nothing to do here - cascade the subscription update\n\n\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n // Save references to the new child props. Note that we track the \"child props from store update\"\n // as a ref instead of a useState/useReducer because we need a way to determine if that value has\n // been processed. If this went into useState/useReducer, we couldn't clear out the value without\n // forcing another re-render, which we don't want.\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render\n\n forceComponentUpdateDispatch({\n type: 'STORE_UPDATED',\n payload: {\n error: error\n }\n });\n }\n }; // Actually subscribe to the nearest connected ancestor (or store)\n\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe(); // Pull data from the store after first render in case the store has\n // changed since we began.\n\n checkForUpdates();\n\n var unsubscribeWrapper = function unsubscribeWrapper() {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n\n if (lastThrownError) {\n // It's possible that we caught an error due to a bad mapState function, but the\n // parent re-rendered without this component and we're about to unmount.\n // This shouldn't happen as long as we do top-down subscriptions correctly, but\n // if we ever do those wrong, this throw will surface the error in our tests.\n // In that case, throw the error from here so it doesn't get lost.\n throw lastThrownError;\n }\n };\n\n return unsubscribeWrapper;\n}\n\nvar initStateUpdates = function initStateUpdates() {\n return [null, 0];\n};\n\nexport default function connectAdvanced(\n/*\r\n selectorFactory is a func that is responsible for returning the selector function used to\r\n compute new props from state, props, and dispatch. For example:\r\n export default connectAdvanced((dispatch, options) => (state, props) => ({\r\n thing: state.things[props.thingId],\r\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\r\n }))(YourComponent)\r\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\r\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\r\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\r\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\r\n props. Do not use connectAdvanced directly without memoizing results between calls to your\r\n selector, otherwise the Connect component will re-render on every state or props change.\r\n*/\nselectorFactory, // options object:\n_ref) {\n if (_ref === void 0) {\n _ref = {};\n }\n\n var _ref2 = _ref,\n _ref2$getDisplayName = _ref2.getDisplayName,\n getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {\n return \"ConnectAdvanced(\" + name + \")\";\n } : _ref2$getDisplayName,\n _ref2$methodName = _ref2.methodName,\n methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,\n _ref2$renderCountProp = _ref2.renderCountProp,\n renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,\n _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,\n _ref2$storeKey = _ref2.storeKey,\n storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,\n _ref2$withRef = _ref2.withRef,\n withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,\n _ref2$forwardRef = _ref2.forwardRef,\n forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,\n _ref2$context = _ref2.context,\n context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,\n connectOptions = _objectWithoutPropertiesLoose(_ref2, [\"getDisplayName\", \"methodName\", \"renderCountProp\", \"shouldHandleStateChanges\", \"storeKey\", \"withRef\", \"forwardRef\", \"context\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (renderCountProp !== undefined) {\n throw new Error(\"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension\");\n }\n\n if (withRef) {\n throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');\n }\n\n var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + \"React.createContext(), and pass the context object to React Redux's Provider and specific components\" + ' like: . ' + 'You may also pass a {context : MyContext} option to connect';\n\n if (storeKey !== 'store') {\n throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);\n }\n }\n\n var Context = context;\n return function wrapWithConnect(WrappedComponent) {\n if (process.env.NODE_ENV !== 'production' && !isValidElementType(WrappedComponent)) {\n throw new Error(\"You must pass a component to the function returned by \" + (methodName + \". Instead received \" + stringifyComponent(WrappedComponent)));\n }\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var pure = connectOptions.pure;\n\n function createChildSelector(store) {\n return selectorFactory(store.dispatch, selectorFactoryOptions);\n } // If we aren't running in \"pure\" mode, we don't want to memoize values.\n // To avoid conditionally calling hooks, we fall back to a tiny wrapper\n // that just executes the given callback immediately.\n\n\n var usePureOnlyMemo = pure ? useMemo : function (callback) {\n return callback();\n };\n\n function ConnectFunction(props) {\n var _useMemo = useMemo(function () {\n // Distinguish between actual \"data\" props that were passed to the wrapper component,\n // and values needed to control behavior (forwarded refs, alternate context instances).\n // To maintain the wrapperProps object reference, memoize this destructuring.\n var forwardedRef = props.forwardedRef,\n wrapperProps = _objectWithoutPropertiesLoose(props, [\"forwardedRef\"]);\n\n return [props.context, forwardedRef, wrapperProps];\n }, [props]),\n propsContext = _useMemo[0],\n forwardedRef = _useMemo[1],\n wrapperProps = _useMemo[2];\n\n var ContextToUse = useMemo(function () {\n // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.\n // Memoize the check that determines which context instance we should use.\n return propsContext && propsContext.Consumer && isContextConsumer(React.createElement(propsContext.Consumer, null)) ? propsContext : Context;\n }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available\n\n var contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.\n // We'll check to see if it _looks_ like a Redux store first.\n // This allows us to pass through a `store` prop that is just a plain value.\n\n var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\n if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\"Could not find \\\"store\\\" in the context of \" + (\"\\\"\" + displayName + \"\\\". Either wrap the root component in a , \") + \"or pass a custom React context provider to and the corresponding \" + (\"React context consumer to \" + displayName + \" in connect options.\"));\n } // Based on the previous check, one of these must be true\n\n\n var store = didStoreComeFromProps ? props.store : contextValue.store;\n var childPropsSelector = useMemo(function () {\n // The child props selector needs the store reference as an input.\n // Re-create this selector whenever the store changes.\n return createChildSelector(store);\n }, [store]);\n\n var _useMemo2 = useMemo(function () {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n\n var subscription = new Subscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `subscription` will then be null. This can\n // probably be avoided if Subscription's listeners logic is changed to not call listeners\n // that have been unsubscribed in the middle of the notification loop.\n\n var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);\n return [subscription, notifyNestedSubs];\n }, [store, didStoreComeFromProps, contextValue]),\n subscription = _useMemo2[0],\n notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,\n // and memoize that value to avoid unnecessary context updates.\n\n\n var overriddenContextValue = useMemo(function () {\n if (didStoreComeFromProps) {\n // This component is directly subscribed to a store from props.\n // We don't want descendants reading from this store - pass down whatever\n // the existing context value is from the nearest connected ancestor.\n return contextValue;\n } // Otherwise, put this component's subscription instance into context, so that\n // connected descendants won't update until after this component is done\n\n\n return _extends({}, contextValue, {\n subscription: subscription\n });\n }, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update\n // causes a change to the calculated child component props (or we caught an error in mapState)\n\n var _useReducer = useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),\n _useReducer$ = _useReducer[0],\n previousStateUpdateResult = _useReducer$[0],\n forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards\n\n\n if (previousStateUpdateResult && previousStateUpdateResult.error) {\n throw previousStateUpdateResult.error;\n } // Set up refs to coordinate values between the subscription effect and the render logic\n\n\n var lastChildProps = useRef();\n var lastWrapperProps = useRef(wrapperProps);\n var childPropsFromStoreUpdate = useRef();\n var renderIsScheduled = useRef(false);\n var actualChildProps = usePureOnlyMemo(function () {\n // Tricky logic here:\n // - This render may have been triggered by a Redux store update that produced new child props\n // - However, we may have gotten new wrapper props after that\n // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.\n // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.\n // So, we'll use the child props from store update only if the wrapper props are the same as last time.\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n } // TODO We're reading the store directly in render() here. Bad idea?\n // This will likely cause Bad Things (TM) to happen in Concurrent Mode.\n // Note that we do this because on renders _not_ caused by store updates, we need the latest store state\n // to determine what the child props should be.\n\n\n return childPropsSelector(store.getState(), wrapperProps);\n }, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns\n // about useLayoutEffect in SSR, so we try to detect environment and fall back to\n // just useEffect instead to avoid the warning, since neither will run anyway.\n\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes\n\n useIsomorphicLayoutEffectWithArgs(subscribeUpdates, [shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch], [store, subscription, childPropsSelector]); // Now that all that's done, we can finally try to actually render the child component.\n // We memoize the elements for the rendered child component as an optimization.\n\n var renderedWrappedComponent = useMemo(function () {\n return React.createElement(WrappedComponent, _extends({}, actualChildProps, {\n ref: forwardedRef\n }));\n }, [forwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering\n // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.\n\n var renderedChild = useMemo(function () {\n if (shouldHandleStateChanges) {\n // If this component is subscribed to store updates, we need to pass its own\n // subscription instance down to our descendants. That means rendering the same\n // Context instance, and putting a different value into the context.\n return React.createElement(ContextToUse.Provider, {\n value: overriddenContextValue\n }, renderedWrappedComponent);\n }\n\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n } // If we're in \"pure\" mode, ensure our wrapper component only re-renders when incoming props have changed.\n\n\n var Connect = pure ? React.memo(ConnectFunction) : ConnectFunction;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n\n if (forwardRef) {\n var forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n return React.createElement(Connect, _extends({}, props, {\n forwardedRef: ref\n }));\n });\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return hoistStatics(forwarded, WrappedComponent);\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","function is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","import verifyPlainObject from '../utils/verifyPlainObject';\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n//\n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\n\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n//\n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n//\n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n//\n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n//\n\nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}","import { bindActionCreators } from 'redux';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return {\n dispatch: dispatch\n };\n }) : undefined;\n}\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport verifyPlainObject from '../utils/verifyPlainObject';\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, {}, stateProps, {}, dispatchProps);\n}\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n var hasRunOnce = false;\n var mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport verifySubselectors from './verifySubselectors';\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n var hasRunAtLeastOnce = false;\n var state;\n var ownProps;\n var stateProps;\n var dispatchProps;\n var mergedProps;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n} // TODO: Add more comments\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutPropertiesLoose(_ref2, [\"initMapStateToProps\", \"initMapDispatchToProps\", \"initMergeProps\"]);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n/*\r\n connect is a facade over connectAdvanced. It turns its args into a compatible\r\n selectorFactory, which has the signature:\r\n\r\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\r\n \r\n connect passes its args to connectAdvanced as options, which will in turn pass them to\r\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\r\n\r\n selectorFactory returns a final props selector from its mapStateToProps,\r\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\r\n mergePropsFactories, and pure args.\r\n\r\n The resulting final props selector is called by the Connect component instance whenever\r\n it receives new props or store state.\r\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error(\"Invalid value of type \" + typeof arg + \" for \" + name + \" argument when connecting component \" + options.wrappedComponentName + \".\");\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n} // createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\n\n\nexport function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}\nexport default\n/*#__PURE__*/\ncreateConnect();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUCache = void 0;\n/**\n * LRUCache is a cache that stores a maximum number of items.\n *\n * Items are removed from the cache when the cache is full.\n *\n * The cache is implemented as a Map, which is a built-in JavaScript object.\n * The Map object holds key-value pairs and remembers the order of key-value pairs as they were inserted.\n */\nclass LRUCache {\n constructor(capacity) {\n this.capacity = capacity;\n this.cache = new Map();\n }\n has(key) {\n return this.cache.has(key);\n }\n get(key) {\n if (!this.cache.has(key)) {\n return undefined;\n }\n const value = this.cache.get(key);\n if (value !== undefined) {\n // the delete and set operations are used together to ensure that the most recently accessed\n // or added item is always considered the \"newest\" in terms of access order.\n // This is crucial for maintaining the correct order of elements in the cache,\n // which directly impacts which item is considered the least recently used (LRU) and\n // thus eligible for eviction when the cache reaches its capacity.\n this.cache.delete(key);\n this.cache.set(key, value);\n }\n return value;\n }\n set(key, value) {\n if (this.capacity === 0) {\n return;\n }\n if (this.cache.has(key)) {\n this.cache.delete(key);\n }\n else if (this.cache.size >= this.capacity) {\n // To evict the least recently used (LRU) item, we retrieve the first key in the Map.\n // This is possible because the Map object in JavaScript maintains the insertion order of the keys.\n // Therefore, the first key represents the oldest entry, which is the least recently used item in our cache.\n // We use Map.prototype.keys().next().value to obtain this oldest key and then delete it from the cache.\n const oldestKey = this.cache.keys().next().value;\n this.cache.delete(oldestKey);\n }\n this.cache.set(key, value);\n }\n}\nexports.LRUCache = LRUCache;\n//# sourceMappingURL=lru-cache.js.map","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message) && message.constructor !== Uint8Array)\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction percentToByte(p) {\n return String.fromCharCode(parseInt(p.slice(1), 16));\n}\nfunction encode(str) {\n return btoa(encodeURIComponent(str).replace(/%[0-9A-F]{2}/g, percentToByte));\n}\nexports.encode = encode;\nfunction byteToPercent(b) {\n return `%${`00${b.charCodeAt(0).toString(16)}`.slice(-2)}`;\n}\nfunction decode(str) {\n return decodeURIComponent(Array.from(atob(str), byteToPercent).join(\"\"));\n}\nexports.decode = decode;\n//# sourceMappingURL=browser.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeBase64 = exports.encodeBase64 = exports.getMD5Hash = void 0;\nconst md5 = require(\"md5\");\nconst universal_base64_1 = require(\"universal-base64\");\nfunction getMD5Hash(input) {\n return md5(input);\n}\nexports.getMD5Hash = getMD5Hash;\nfunction encodeBase64(input) {\n return (0, universal_base64_1.encode)(input);\n}\nexports.encodeBase64 = encodeBase64;\nfunction decodeBase64(input) {\n return (0, universal_base64_1.decode)(input);\n}\nexports.decodeBase64 = decodeBase64;\n//# sourceMappingURL=obfuscation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUInMemoryAssignmentCache = exports.NonExpiringInMemoryAssignmentCache = exports.AssignmentCache = void 0;\nconst lru_cache_1 = require(\"./lru-cache\");\nconst obfuscation_1 = require(\"./obfuscation\");\nclass AssignmentCache {\n constructor(cacheInstance) {\n this.cache = cacheInstance;\n }\n hasLoggedAssignment(key) {\n // no cache key present\n if (!this.cache.has(this.getCacheKey(key))) {\n return false;\n }\n // the subject has been assigned to a different variation\n // than was previously logged.\n // in this case we need to log the assignment again.\n if (this.cache.get(this.getCacheKey(key)) !== (0, obfuscation_1.getMD5Hash)(key.variationKey)) {\n return false;\n }\n return true;\n }\n setLastLoggedAssignment(key) {\n this.cache.set(this.getCacheKey(key), (0, obfuscation_1.getMD5Hash)(key.variationKey));\n }\n getCacheKey({ subjectKey, flagKey, allocationKey }) {\n return [`subject:${subjectKey}`, `flag:${flagKey}`, `allocation:${allocationKey}`].join(';');\n }\n}\nexports.AssignmentCache = AssignmentCache;\n/**\n * A cache that never expires.\n *\n * The primary use case is for client-side SDKs, where the cache is only used\n * for a single user.\n */\nclass NonExpiringInMemoryAssignmentCache extends AssignmentCache {\n constructor() {\n super(new Map());\n }\n}\nexports.NonExpiringInMemoryAssignmentCache = NonExpiringInMemoryAssignmentCache;\n/**\n * A cache that uses the LRU algorithm to evict the least recently used items.\n *\n * It is used to limit the size of the cache.\n *\n * The primary use case is for server-side SDKs, where the cache is shared across\n * multiple users. In this case, the cache size should be set to the maximum number\n * of users that can be active at the same time.\n */\nclass LRUInMemoryAssignmentCache extends AssignmentCache {\n constructor(maxSize) {\n super(new lru_cache_1.LRUCache(maxSize));\n }\n}\nexports.LRUInMemoryAssignmentCache = LRUInMemoryAssignmentCache;\n//# sourceMappingURL=assignment-cache.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MAX_EVENT_QUEUE_SIZE = exports.NULL_SENTINEL = exports.SESSION_ASSIGNMENT_CONFIG_LOADED = exports.BASE_URL = exports.DEFAULT_POLL_CONFIG_REQUEST_RETRIES = exports.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES = exports.POLL_JITTER_PCT = exports.POLL_INTERVAL_MS = exports.REQUEST_TIMEOUT_MILLIS = exports.DEFAULT_REQUEST_TIMEOUT_MS = void 0;\nexports.DEFAULT_REQUEST_TIMEOUT_MS = 5000;\nexports.REQUEST_TIMEOUT_MILLIS = exports.DEFAULT_REQUEST_TIMEOUT_MS; // for backwards compatibility\nexports.POLL_INTERVAL_MS = 30000;\nexports.POLL_JITTER_PCT = 0.1;\nexports.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES = 1;\nexports.DEFAULT_POLL_CONFIG_REQUEST_RETRIES = 7;\nexports.BASE_URL = 'https://fscdn.eppo.cloud/api';\nexports.SESSION_ASSIGNMENT_CONFIG_LOADED = 'eppo-session-assignment-config-loaded';\nexports.NULL_SENTINEL = 'EPPO_NULL';\n// number of logging events that may be queued while waiting for initialization\nexports.MAX_EVENT_QUEUE_SIZE = 100;\n//# sourceMappingURL=constants.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VariationType = void 0;\nvar VariationType;\n(function (VariationType) {\n VariationType[\"STRING\"] = \"STRING\";\n VariationType[\"INTEGER\"] = \"INTEGER\";\n VariationType[\"NUMERIC\"] = \"NUMERIC\";\n VariationType[\"BOOLEAN\"] = \"BOOLEAN\";\n VariationType[\"JSON\"] = \"JSON\";\n})(VariationType = exports.VariationType || (exports.VariationType = {}));\n//# sourceMappingURL=interfaces.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeObject = exports.decodeShard = exports.decodeSplit = exports.decodeAllocation = exports.decodeValue = exports.decodeVariations = exports.decodeFlag = void 0;\nconst interfaces_1 = require(\"./interfaces\");\nconst obfuscation_1 = require(\"./obfuscation\");\nfunction decodeFlag(flag) {\n return Object.assign(Object.assign({}, flag), { variations: decodeVariations(flag.variations, flag.variationType), allocations: flag.allocations.map(decodeAllocation) });\n}\nexports.decodeFlag = decodeFlag;\nfunction decodeVariations(variations, variationType) {\n return Object.fromEntries(Object.entries(variations).map(([, variation]) => {\n const decodedKey = (0, obfuscation_1.decodeBase64)(variation.key);\n return [decodedKey, { key: decodedKey, value: decodeValue(variation.value, variationType) }];\n }));\n}\nexports.decodeVariations = decodeVariations;\nfunction decodeValue(encodedValue, type) {\n switch (type) {\n case interfaces_1.VariationType.INTEGER:\n case interfaces_1.VariationType.NUMERIC:\n return Number((0, obfuscation_1.decodeBase64)(encodedValue));\n case interfaces_1.VariationType.BOOLEAN:\n return (0, obfuscation_1.decodeBase64)(encodedValue) === 'true';\n default:\n return (0, obfuscation_1.decodeBase64)(encodedValue);\n }\n}\nexports.decodeValue = decodeValue;\nfunction decodeAllocation(allocation) {\n return Object.assign(Object.assign({}, allocation), { key: (0, obfuscation_1.decodeBase64)(allocation.key), splits: allocation.splits.map(decodeSplit), startAt: allocation.startAt\n ? new Date((0, obfuscation_1.decodeBase64)(allocation.startAt)).toISOString()\n : undefined, endAt: allocation.endAt ? new Date((0, obfuscation_1.decodeBase64)(allocation.endAt)).toISOString() : undefined });\n}\nexports.decodeAllocation = decodeAllocation;\nfunction decodeSplit(split) {\n return {\n extraLogging: split.extraLogging ? decodeObject(split.extraLogging) : undefined,\n variationKey: (0, obfuscation_1.decodeBase64)(split.variationKey),\n shards: split.shards.map(decodeShard),\n };\n}\nexports.decodeSplit = decodeSplit;\nfunction decodeShard(shard) {\n return Object.assign(Object.assign({}, shard), { salt: (0, obfuscation_1.decodeBase64)(shard.salt) });\n}\nexports.decodeShard = decodeShard;\nfunction decodeObject(obj) {\n return Object.fromEntries(Object.entries(obj).map(([key, value]) => [(0, obfuscation_1.decodeBase64)(key), (0, obfuscation_1.decodeBase64)(value)]));\n}\nexports.decodeObject = decodeObject;\n//# sourceMappingURL=decoding.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EppoValue = exports.EppoValueType = void 0;\nconst interfaces_1 = require(\"./interfaces\");\nconst obfuscation_1 = require(\"./obfuscation\");\nvar EppoValueType;\n(function (EppoValueType) {\n EppoValueType[EppoValueType[\"NullType\"] = 0] = \"NullType\";\n EppoValueType[EppoValueType[\"BoolType\"] = 1] = \"BoolType\";\n EppoValueType[EppoValueType[\"NumericType\"] = 2] = \"NumericType\";\n EppoValueType[EppoValueType[\"StringType\"] = 3] = \"StringType\";\n EppoValueType[EppoValueType[\"JSONType\"] = 4] = \"JSONType\";\n})(EppoValueType = exports.EppoValueType || (exports.EppoValueType = {}));\nclass EppoValue {\n constructor(valueType, boolValue, numericValue, stringValue, objectValue) {\n this.valueType = valueType;\n this.boolValue = boolValue;\n this.numericValue = numericValue;\n this.stringValue = stringValue;\n this.objectValue = objectValue;\n }\n static valueOf(value, valueType) {\n if (value == null) {\n return EppoValue.Null();\n }\n switch (valueType) {\n case interfaces_1.VariationType.BOOLEAN:\n return EppoValue.Bool(value);\n case interfaces_1.VariationType.NUMERIC:\n return EppoValue.Numeric(value);\n case interfaces_1.VariationType.INTEGER:\n return EppoValue.Numeric(value);\n case interfaces_1.VariationType.STRING:\n return EppoValue.String(value);\n case interfaces_1.VariationType.JSON:\n return EppoValue.JSON(value);\n default:\n return EppoValue.String(value);\n }\n }\n toString() {\n var _a, _b, _c;\n switch (this.valueType) {\n case EppoValueType.NullType:\n return 'null';\n case EppoValueType.BoolType:\n return this.boolValue ? 'true' : 'false';\n case EppoValueType.NumericType:\n return this.numericValue ? this.numericValue.toString() : '0';\n case EppoValueType.StringType:\n return (_a = this.stringValue) !== null && _a !== void 0 ? _a : '';\n case EppoValueType.JSONType:\n try {\n return (_b = JSON.stringify(this.objectValue)) !== null && _b !== void 0 ? _b : '';\n }\n catch (_d) {\n return (_c = this.stringValue) !== null && _c !== void 0 ? _c : '';\n }\n }\n }\n /**\n * Useful when storing or transmitting the entire value,\n * in particular the JsonType, is not desired.\n *\n * @returns MD5 hashed string of the value\n */\n toHashedString() {\n const value = this.toString();\n return (0, obfuscation_1.getMD5Hash)(value);\n }\n static Bool(value) {\n return new EppoValue(EppoValueType.BoolType, value, undefined, undefined, undefined);\n }\n static Numeric(value) {\n return new EppoValue(EppoValueType.NumericType, undefined, value, undefined, undefined);\n }\n static String(value) {\n return new EppoValue(EppoValueType.StringType, undefined, undefined, value, undefined);\n }\n static JSON(value) {\n return new EppoValue(EppoValueType.JSONType, undefined, undefined, undefined, typeof value === 'string' ? JSON.parse(value) : value);\n }\n static Null() {\n return new EppoValue(EppoValueType.NullType, undefined, undefined, undefined, undefined);\n }\n}\nexports.EppoValue = EppoValue;\n//# sourceMappingURL=eppo_value.js.map","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier, identifierBase) => {\n if (typeof (options) === 'string') {\n identifierBase = identifier\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(\n version instanceof SemVer ? version.version : version,\n options\n ).inc(release, identifier, identifierBase).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const parse = require('./parse.js')\n\nconst diff = (version1, version2) => {\n const v1 = parse(version1, null, true)\n const v2 = parse(version2, null, true)\n const comparison = v1.compare(v2)\n\n if (comparison === 0) {\n return null\n }\n\n const v1Higher = comparison > 0\n const highVersion = v1Higher ? v1 : v2\n const lowVersion = v1Higher ? v2 : v1\n const highHasPre = !!highVersion.prerelease.length\n const lowHasPre = !!lowVersion.prerelease.length\n\n if (lowHasPre && !highHasPre) {\n // Going from prerelease -> no prerelease requires some special casing\n\n // If the low version has only a major, then it will always be a major\n // Some examples:\n // 1.0.0-1 -> 1.0.0\n // 1.0.0-1 -> 1.1.1\n // 1.0.0-1 -> 2.0.0\n if (!lowVersion.patch && !lowVersion.minor) {\n return 'major'\n }\n\n // Otherwise it can be determined by checking the high version\n\n if (highVersion.patch) {\n // anything higher than a patch bump would result in the wrong version\n return 'patch'\n }\n\n if (highVersion.minor) {\n // anything higher than a minor bump would result in the wrong version\n return 'minor'\n }\n\n // bumping major/minor/patch all have same result\n return 'major'\n }\n\n // add the `pre` prefix if we are going to a prerelease version\n const prefix = highHasPre ? 'pre' : ''\n\n if (v1.major !== v2.major) {\n return prefix + 'major'\n }\n\n if (v1.minor !== v2.minor) {\n return prefix + 'minor'\n }\n\n if (v1.patch !== v2.patch) {\n return prefix + 'patch'\n }\n\n // high and low are preleases\n return 'prerelease'\n}\n\nmodule.exports = diff\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]\n let next\n while ((next = coerceRtlRegex.exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n coerceRtlRegex.lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n const major = match[2]\n const minor = match[3] || '0'\n const patch = match[4] || '0'\n const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''\n const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''\n\n return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)\n}\nmodule.exports = coerce\n","class LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n","const SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin))) {\n minver = setMin\n }\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst { ANY } = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2, options)\n}\nmodule.exports = intersects\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let first = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!first) {\n first = version\n }\n } else {\n if (prev) {\n set.push([first, prev])\n }\n prev = null\n first = null\n }\n }\n if (first) {\n set.push([first, null])\n }\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max) {\n ranges.push(min)\n } else if (!max && min === v[0]) {\n ranges.push('*')\n } else if (!max) {\n ranges.push(`>=${min}`)\n } else if (min === v[0]) {\n ranges.push(`<=${max}`)\n } else {\n ranges.push(`${min} - ${max}`)\n }\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom) {\n return true\n }\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub) {\n continue OUTER\n }\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull) {\n return false\n }\n }\n return true\n}\n\nconst minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]\nconst minimumVersion = [new Comparator('>=0.0.0')]\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom) {\n return true\n }\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY) {\n return true\n } else if (options.includePrerelease) {\n sub = minimumVersionWithPreRelease\n } else {\n sub = minimumVersion\n }\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease) {\n return true\n } else {\n dom = minimumVersion\n }\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=') {\n gt = higherGT(gt, c, options)\n } else if (c.operator === '<' || c.operator === '<=') {\n lt = lowerLT(lt, c, options)\n } else {\n eqSet.add(c.semver)\n }\n }\n\n if (eqSet.size > 1) {\n return null\n }\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0) {\n return null\n } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {\n return null\n }\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options)) {\n return null\n }\n\n if (lt && !satisfies(eq, String(lt), options)) {\n return null\n }\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options)) {\n return false\n }\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt) {\n return false\n }\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {\n return false\n }\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt) {\n return false\n }\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {\n return false\n }\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0) {\n return false\n }\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0) {\n return false\n }\n\n if (lt && hasDomGT && !gt && gtltComp !== 0) {\n return false\n }\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre) {\n return false\n }\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nconst constants = require('./internal/constants')\nconst SemVer = require('./classes/semver')\nconst identifiers = require('./internal/identifiers')\nconst parse = require('./functions/parse')\nconst valid = require('./functions/valid')\nconst clean = require('./functions/clean')\nconst inc = require('./functions/inc')\nconst diff = require('./functions/diff')\nconst major = require('./functions/major')\nconst minor = require('./functions/minor')\nconst patch = require('./functions/patch')\nconst prerelease = require('./functions/prerelease')\nconst compare = require('./functions/compare')\nconst rcompare = require('./functions/rcompare')\nconst compareLoose = require('./functions/compare-loose')\nconst compareBuild = require('./functions/compare-build')\nconst sort = require('./functions/sort')\nconst rsort = require('./functions/rsort')\nconst gt = require('./functions/gt')\nconst lt = require('./functions/lt')\nconst eq = require('./functions/eq')\nconst neq = require('./functions/neq')\nconst gte = require('./functions/gte')\nconst lte = require('./functions/lte')\nconst cmp = require('./functions/cmp')\nconst coerce = require('./functions/coerce')\nconst Comparator = require('./classes/comparator')\nconst Range = require('./classes/range')\nconst satisfies = require('./functions/satisfies')\nconst toComparators = require('./ranges/to-comparators')\nconst maxSatisfying = require('./ranges/max-satisfying')\nconst minSatisfying = require('./ranges/min-satisfying')\nconst minVersion = require('./ranges/min-version')\nconst validRange = require('./ranges/valid')\nconst outside = require('./ranges/outside')\nconst gtr = require('./ranges/gtr')\nconst ltr = require('./ranges/ltr')\nconst intersects = require('./ranges/intersects')\nconst simplifyRange = require('./ranges/simplify')\nconst subset = require('./ranges/subset')\nmodule.exports = {\n parse,\n valid,\n clean,\n inc,\n diff,\n major,\n minor,\n patch,\n prerelease,\n compare,\n rcompare,\n compareLoose,\n compareBuild,\n sort,\n rsort,\n gt,\n lt,\n eq,\n neq,\n gte,\n lte,\n cmp,\n coerce,\n Comparator,\n Range,\n satisfies,\n toComparators,\n maxSatisfying,\n minSatisfying,\n minVersion,\n validRange,\n outside,\n gtr,\n ltr,\n intersects,\n simplifyRange,\n subset,\n SemVer,\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,\n RELEASE_TYPES: constants.RELEASE_TYPES,\n compareIdentifiers: identifiers.compareIdentifiers,\n rcompareIdentifiers: identifiers.rcompareIdentifiers,\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.matchesRule = exports.ObfuscatedOperatorType = exports.OperatorType = void 0;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst semver_1 = require(\"semver\");\nconst obfuscation_1 = require(\"./obfuscation\");\nvar OperatorType;\n(function (OperatorType) {\n OperatorType[\"MATCHES\"] = \"MATCHES\";\n OperatorType[\"NOT_MATCHES\"] = \"NOT_MATCHES\";\n OperatorType[\"GTE\"] = \"GTE\";\n OperatorType[\"GT\"] = \"GT\";\n OperatorType[\"LTE\"] = \"LTE\";\n OperatorType[\"LT\"] = \"LT\";\n OperatorType[\"ONE_OF\"] = \"ONE_OF\";\n OperatorType[\"NOT_ONE_OF\"] = \"NOT_ONE_OF\";\n OperatorType[\"IS_NULL\"] = \"IS_NULL\";\n})(OperatorType = exports.OperatorType || (exports.OperatorType = {}));\nvar ObfuscatedOperatorType;\n(function (ObfuscatedOperatorType) {\n ObfuscatedOperatorType[\"MATCHES\"] = \"05015086bdd8402218f6aad6528bef08\";\n ObfuscatedOperatorType[\"NOT_MATCHES\"] = \"8323761667755378c3a78e0a6ed37a78\";\n ObfuscatedOperatorType[\"GTE\"] = \"32d35312e8f24bc1669bd2b45c00d47c\";\n ObfuscatedOperatorType[\"GT\"] = \"cd6a9bd2a175104eed40f0d33a8b4020\";\n ObfuscatedOperatorType[\"LTE\"] = \"cc981ecc65ecf63ad1673cbec9c64198\";\n ObfuscatedOperatorType[\"LT\"] = \"c562607189d77eb9dfb707464c1e7b0b\";\n ObfuscatedOperatorType[\"ONE_OF\"] = \"27457ce369f2a74203396a35ef537c0b\";\n ObfuscatedOperatorType[\"NOT_ONE_OF\"] = \"602f5ee0b6e84fe29f43ab48b9e1addf\";\n ObfuscatedOperatorType[\"IS_NULL\"] = \"dbd9c38e0339e6c34bd48cafc59be388\";\n})(ObfuscatedOperatorType = exports.ObfuscatedOperatorType || (exports.ObfuscatedOperatorType = {}));\nvar OperatorValueType;\n(function (OperatorValueType) {\n OperatorValueType[\"PLAIN_STRING\"] = \"PLAIN_STRING\";\n OperatorValueType[\"STRING_ARRAY\"] = \"STRING_ARRAY\";\n OperatorValueType[\"SEM_VER\"] = \"SEM_VER\";\n OperatorValueType[\"NUMERIC\"] = \"NUMERIC\";\n})(OperatorValueType || (OperatorValueType = {}));\nfunction matchesRule(rule, subjectAttributes, obfuscated) {\n const conditionEvaluations = evaluateRuleConditions(subjectAttributes, rule.conditions, obfuscated);\n return !conditionEvaluations.includes(false);\n}\nexports.matchesRule = matchesRule;\nfunction evaluateRuleConditions(subjectAttributes, conditions, obfuscated) {\n return conditions.map((condition) => obfuscated\n ? evaluateObfuscatedCondition(Object.entries(subjectAttributes).reduce((accum, [key, val]) => (Object.assign({ [(0, obfuscation_1.getMD5Hash)(key)]: val }, accum)), {}), condition)\n : evaluateCondition(subjectAttributes, condition));\n}\nfunction evaluateCondition(subjectAttributes, condition) {\n const value = subjectAttributes[condition.attribute];\n const conditionValueType = targetingRuleConditionValuesTypesFromValues(condition.value);\n if (condition.operator === OperatorType.IS_NULL) {\n if (condition.value) {\n return value === null || value === undefined;\n }\n return value !== null && value !== undefined;\n }\n if (value != null) {\n switch (condition.operator) {\n case OperatorType.GTE:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, condition.value, semver_1.gte);\n }\n return compareNumber(value, condition.value, (a, b) => a >= b);\n case OperatorType.GT:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, condition.value, semver_1.gt);\n }\n return compareNumber(value, condition.value, (a, b) => a > b);\n case OperatorType.LTE:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, condition.value, semver_1.lte);\n }\n return compareNumber(value, condition.value, (a, b) => a <= b);\n case OperatorType.LT:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, condition.value, semver_1.lt);\n }\n return compareNumber(value, condition.value, (a, b) => a < b);\n case OperatorType.MATCHES:\n return new RegExp(condition.value).test(value);\n case OperatorType.ONE_OF:\n return isOneOf(value.toString(), condition.value);\n case OperatorType.NOT_ONE_OF:\n return isNotOneOf(value.toString(), condition.value);\n }\n }\n return false;\n}\nfunction evaluateObfuscatedCondition(hashedSubjectAttributes, condition) {\n const value = hashedSubjectAttributes[condition.attribute];\n const conditionValueType = targetingRuleConditionValuesTypesFromValues(value);\n if (condition.operator === ObfuscatedOperatorType.IS_NULL) {\n if (condition.value === (0, obfuscation_1.getMD5Hash)('true')) {\n return value === null || value === undefined;\n }\n return value !== null && value !== undefined;\n }\n if (value != null) {\n switch (condition.operator) {\n case ObfuscatedOperatorType.GTE:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, (0, obfuscation_1.decodeBase64)(condition.value), semver_1.gte);\n }\n return compareNumber(value, Number((0, obfuscation_1.decodeBase64)(condition.value)), (a, b) => a >= b);\n case ObfuscatedOperatorType.GT:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, (0, obfuscation_1.decodeBase64)(condition.value), semver_1.gt);\n }\n return compareNumber(value, Number((0, obfuscation_1.decodeBase64)(condition.value)), (a, b) => a > b);\n case ObfuscatedOperatorType.LTE:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, (0, obfuscation_1.decodeBase64)(condition.value), semver_1.lte);\n }\n return compareNumber(value, Number((0, obfuscation_1.decodeBase64)(condition.value)), (a, b) => a <= b);\n case ObfuscatedOperatorType.LT:\n if (conditionValueType === OperatorValueType.SEM_VER) {\n return compareSemVer(value, (0, obfuscation_1.decodeBase64)(condition.value), semver_1.lt);\n }\n return compareNumber(value, Number((0, obfuscation_1.decodeBase64)(condition.value)), (a, b) => a < b);\n case ObfuscatedOperatorType.MATCHES:\n return new RegExp((0, obfuscation_1.decodeBase64)(condition.value)).test(value);\n case ObfuscatedOperatorType.NOT_MATCHES:\n return !new RegExp((0, obfuscation_1.decodeBase64)(condition.value)).test(value);\n case ObfuscatedOperatorType.ONE_OF:\n return isOneOf((0, obfuscation_1.getMD5Hash)(value.toString()), condition.value);\n case ObfuscatedOperatorType.NOT_ONE_OF:\n return isNotOneOf((0, obfuscation_1.getMD5Hash)(value.toString()), condition.value);\n }\n }\n return false;\n}\nfunction isOneOf(attributeValue, conditionValue) {\n return getMatchingStringValues(attributeValue, conditionValue).length > 0;\n}\nfunction isNotOneOf(attributeValue, conditionValue) {\n return getMatchingStringValues(attributeValue, conditionValue).length === 0;\n}\nfunction getMatchingStringValues(attributeValue, conditionValues) {\n return conditionValues.filter((value) => value === attributeValue);\n}\nfunction compareNumber(attributeValue, conditionValue, compareFn) {\n return compareFn(Number(attributeValue), Number(conditionValue));\n}\nfunction compareSemVer(attributeValue, conditionValue, compareFn) {\n return (!!(0, semver_1.valid)(attributeValue) &&\n !!(0, semver_1.valid)(conditionValue) &&\n compareFn(attributeValue, conditionValue));\n}\nfunction targetingRuleConditionValuesTypesFromValues(value) {\n // Check if input is a number\n if (typeof value === 'number') {\n return OperatorValueType.NUMERIC;\n }\n if (Array.isArray(value)) {\n return OperatorValueType.STRING_ARRAY;\n }\n // Check if input is a string that represents a SemVer\n if (typeof value === 'string' && (0, semver_1.valid)(value)) {\n return OperatorValueType.SEM_VER;\n }\n // Check if input is a string that represents a number\n if (!isNaN(Number(value))) {\n return OperatorValueType.NUMERIC;\n }\n // If none of the above, it's a general string\n return OperatorValueType.PLAIN_STRING;\n}\n//# sourceMappingURL=rules.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DeterministicSharder = exports.MD5Sharder = exports.Sharder = void 0;\nconst obfuscation_1 = require(\"./obfuscation\");\nclass Sharder {\n}\nexports.Sharder = Sharder;\nclass MD5Sharder extends Sharder {\n getShard(input, totalShards) {\n const hashOutput = (0, obfuscation_1.getMD5Hash)(input);\n // get the first 4 bytes of the md5 hex string and parse it using base 16\n // (8 hex characters represent 4 bytes, e.g. 0xffffffff represents the max 4-byte integer)\n const intFromHash = parseInt(hashOutput.slice(0, 8), 16);\n return intFromHash % totalShards;\n }\n}\nexports.MD5Sharder = MD5Sharder;\nclass DeterministicSharder extends Sharder {\n constructor(lookup) {\n super();\n this.lookup = lookup;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getShard(input, _totalShards) {\n var _a;\n return (_a = this.lookup[input]) !== null && _a !== void 0 ? _a : 0;\n }\n}\nexports.DeterministicSharder = DeterministicSharder;\n//# sourceMappingURL=sharders.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.matchesRules = exports.noneResult = exports.hashKey = exports.isInShardRange = exports.Evaluator = void 0;\nconst rules_1 = require(\"./rules\");\nconst sharders_1 = require(\"./sharders\");\nclass Evaluator {\n constructor(sharder) {\n this.sharder = sharder !== null && sharder !== void 0 ? sharder : new sharders_1.MD5Sharder();\n }\n evaluateFlag(flag, subjectKey, subjectAttributes, obfuscated) {\n var _a, _b;\n if (!flag.enabled) {\n return noneResult(flag.key, subjectKey, subjectAttributes);\n }\n const now = new Date();\n for (const allocation of flag.allocations) {\n if (allocation.startAt && now < new Date(allocation.startAt))\n continue;\n if (allocation.endAt && now > new Date(allocation.endAt))\n continue;\n if (matchesRules((_a = allocation === null || allocation === void 0 ? void 0 : allocation.rules) !== null && _a !== void 0 ? _a : [], Object.assign({ id: subjectKey }, subjectAttributes), obfuscated)) {\n for (const split of allocation.splits) {\n if (split.shards.every((shard) => this.matchesShard(shard, subjectKey, flag.totalShards))) {\n return {\n flagKey: flag.key,\n subjectKey,\n subjectAttributes,\n allocationKey: allocation.key,\n variation: flag.variations[split.variationKey],\n extraLogging: (_b = split.extraLogging) !== null && _b !== void 0 ? _b : {},\n doLog: allocation.doLog,\n };\n }\n }\n }\n }\n return noneResult(flag.key, subjectKey, subjectAttributes);\n }\n matchesShard(shard, subjectKey, totalShards) {\n const assignedShard = this.sharder.getShard(hashKey(shard.salt, subjectKey), totalShards);\n return shard.ranges.some((range) => isInShardRange(assignedShard, range));\n }\n}\nexports.Evaluator = Evaluator;\nfunction isInShardRange(shard, range) {\n return range.start <= shard && shard < range.end;\n}\nexports.isInShardRange = isInShardRange;\nfunction hashKey(salt, subjectKey) {\n return `${salt}-${subjectKey}`;\n}\nexports.hashKey = hashKey;\nfunction noneResult(flagKey, subjectKey, subjectAttributes) {\n return {\n flagKey,\n subjectKey,\n subjectAttributes,\n allocationKey: null,\n variation: null,\n extraLogging: {},\n doLog: false,\n };\n}\nexports.noneResult = noneResult;\nfunction matchesRules(rules, subjectAttributes, obfuscated) {\n return !rules.length || rules.some((rule) => (0, rules_1.matchesRule)(rule, subjectAttributes, obfuscated));\n}\nexports.matchesRules = matchesRules;\n//# sourceMappingURL=evaluator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst UFC_ENDPOINT = '/flag-config/v1/config';\nclass FlagConfigurationRequestor {\n constructor(configurationStore, httpClient) {\n this.configurationStore = configurationStore;\n this.httpClient = httpClient;\n }\n async fetchAndStoreConfigurations() {\n const responseData = await this.httpClient.get(UFC_ENDPOINT);\n if (!responseData) {\n return {};\n }\n this.configurationStore.setEntries(responseData.flags);\n return responseData.flags;\n }\n}\nexports.default = FlagConfigurationRequestor;\n//# sourceMappingURL=flag-configuration-requestor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpRequestError = void 0;\nclass HttpRequestError extends Error {\n constructor(message, status, cause) {\n super(message);\n this.message = message;\n this.status = status;\n this.cause = cause;\n if (cause) {\n this.cause = cause;\n }\n }\n}\nexports.HttpRequestError = HttpRequestError;\nclass FetchHttpClient {\n constructor(baseUrl, sdkParams, timeout) {\n this.baseUrl = baseUrl;\n this.sdkParams = sdkParams;\n this.timeout = timeout;\n }\n async get(resource) {\n const url = new URL(this.baseUrl + resource);\n Object.entries(this.sdkParams).forEach(([key, value]) => url.searchParams.append(key, value));\n try {\n // Canonical implementation of abortable fetch for interrupting when request takes longer than desired.\n // https://developer.chrome.com/blog/abortable-fetch/#reacting_to_an_aborted_fetch\n const controller = new AbortController();\n const signal = controller.signal;\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n const response = await fetch(url.toString(), { signal: signal });\n // Clear timeout when response is received within the budget.\n clearTimeout(timeoutId);\n if (!response.ok) {\n throw new HttpRequestError('Failed to fetch data', response.status);\n }\n return response.json();\n }\n catch (error) {\n if (error.name === 'AbortError') {\n throw new HttpRequestError('Request timed out', 408, error);\n }\n else if (error instanceof HttpRequestError) {\n throw error;\n }\n throw new HttpRequestError('Network error', 0, error);\n }\n }\n}\nexports.default = FetchHttpClient;\n//# sourceMappingURL=http-client.js.map","'use strict'\nfunction tryStringify (o) {\n try { return JSON.stringify(o) } catch(e) { return '\"[Circular]\"' }\n}\n\nmodule.exports = format\n\nfunction format(f, args, opts) {\n var ss = (opts && opts.stringify) || tryStringify\n var offset = 1\n if (typeof f === 'object' && f !== null) {\n var len = args.length + offset\n if (len === 1) return f\n var objects = new Array(len)\n objects[0] = ss(f)\n for (var index = 1; index < len; index++) {\n objects[index] = ss(args[index])\n }\n return objects.join(' ')\n }\n if (typeof f !== 'string') {\n return f\n }\n var argLen = args.length\n if (argLen === 0) return f\n var str = ''\n var a = 1 - offset\n var lastPos = -1\n var flen = (f && f.length) || 0\n for (var i = 0; i < flen;) {\n if (f.charCodeAt(i) === 37 && i + 1 < flen) {\n lastPos = lastPos > -1 ? lastPos : 0\n switch (f.charCodeAt(i + 1)) {\n case 100: // 'd'\n case 102: // 'f'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Number(args[a])\n lastPos = i + 2\n i++\n break\n case 105: // 'i'\n if (a >= argLen)\n break\n if (args[a] == null) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += Math.floor(Number(args[a]))\n lastPos = i + 2\n i++\n break\n case 79: // 'O'\n case 111: // 'o'\n case 106: // 'j'\n if (a >= argLen)\n break\n if (args[a] === undefined) break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n var type = typeof args[a]\n if (type === 'string') {\n str += '\\'' + args[a] + '\\''\n lastPos = i + 2\n i++\n break\n }\n if (type === 'function') {\n str += args[a].name || ''\n lastPos = i + 2\n i++\n break\n }\n str += ss(args[a])\n lastPos = i + 2\n i++\n break\n case 115: // 's'\n if (a >= argLen)\n break\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += String(args[a])\n lastPos = i + 2\n i++\n break\n case 37: // '%'\n if (lastPos < i)\n str += f.slice(lastPos, i)\n str += '%'\n lastPos = i + 2\n i++\n a--\n break\n }\n ++a\n }\n ++i\n }\n if (lastPos === -1)\n return f\n else if (lastPos < flen) {\n str += f.slice(lastPos)\n }\n\n return str\n}\n","'use strict'\n\nconst format = require('quick-format-unescaped')\n\nmodule.exports = pino\n\nconst _console = pfGlobalThisOrFallback().console || {}\nconst stdSerializers = {\n mapHttpRequest: mock,\n mapHttpResponse: mock,\n wrapRequestSerializer: passthrough,\n wrapResponseSerializer: passthrough,\n wrapErrorSerializer: passthrough,\n req: mock,\n res: mock,\n err: asErrValue,\n errWithCause: asErrValue\n}\nfunction levelToValue (level, logger) {\n return level === 'silent'\n ? Infinity\n : logger.levels.values[level]\n}\nconst baseLogFunctionSymbol = Symbol('pino.logFuncs')\nconst hierarchySymbol = Symbol('pino.hierarchy')\n\nconst logFallbackMap = {\n error: 'log',\n fatal: 'error',\n warn: 'error',\n info: 'log',\n debug: 'log',\n trace: 'log'\n}\n\nfunction appendChildLogger (parentLogger, childLogger) {\n const newEntry = {\n logger: childLogger,\n parent: parentLogger[hierarchySymbol]\n }\n childLogger[hierarchySymbol] = newEntry\n}\n\nfunction setupBaseLogFunctions (logger, levels, proto) {\n const logFunctions = {}\n levels.forEach(level => {\n logFunctions[level] = proto[level] ? proto[level] : (_console[level] || _console[logFallbackMap[level] || 'log'] || noop)\n })\n logger[baseLogFunctionSymbol] = logFunctions\n}\n\nfunction shouldSerialize (serialize, serializers) {\n if (Array.isArray(serialize)) {\n const hasToFilter = serialize.filter(function (k) {\n return k !== '!stdSerializers.err'\n })\n return hasToFilter\n } else if (serialize === true) {\n return Object.keys(serializers)\n }\n\n return false\n}\n\nfunction pino (opts) {\n opts = opts || {}\n opts.browser = opts.browser || {}\n\n const transmit = opts.browser.transmit\n if (transmit && typeof transmit.send !== 'function') { throw Error('pino: transmit option must have a send function') }\n\n const proto = opts.browser.write || _console\n if (opts.browser.write) opts.browser.asObject = true\n const serializers = opts.serializers || {}\n const serialize = shouldSerialize(opts.browser.serialize, serializers)\n let stdErrSerialize = opts.browser.serialize\n\n if (\n Array.isArray(opts.browser.serialize) &&\n opts.browser.serialize.indexOf('!stdSerializers.err') > -1\n ) stdErrSerialize = false\n\n const customLevels = Object.keys(opts.customLevels || {})\n const levels = ['error', 'fatal', 'warn', 'info', 'debug', 'trace'].concat(customLevels)\n\n if (typeof proto === 'function') {\n levels.forEach(function (level) {\n proto[level] = proto\n })\n }\n if (opts.enabled === false || opts.browser.disabled) opts.level = 'silent'\n const level = opts.level || 'info'\n const logger = Object.create(proto)\n if (!logger.log) logger.log = noop\n\n setupBaseLogFunctions(logger, levels, proto)\n // setup root hierarchy entry\n appendChildLogger({}, logger)\n\n Object.defineProperty(logger, 'levelVal', {\n get: getLevelVal\n })\n Object.defineProperty(logger, 'level', {\n get: getLevel,\n set: setLevel\n })\n\n const setOpts = {\n transmit,\n serialize,\n asObject: opts.browser.asObject,\n formatters: opts.browser.formatters,\n levels,\n timestamp: getTimeFunction(opts)\n }\n logger.levels = getLevels(opts)\n logger.level = level\n\n logger.setMaxListeners = logger.getMaxListeners =\n logger.emit = logger.addListener = logger.on =\n logger.prependListener = logger.once =\n logger.prependOnceListener = logger.removeListener =\n logger.removeAllListeners = logger.listeners =\n logger.listenerCount = logger.eventNames =\n logger.write = logger.flush = noop\n logger.serializers = serializers\n logger._serialize = serialize\n logger._stdErrSerialize = stdErrSerialize\n logger.child = child\n\n if (transmit) logger._logEvent = createLogEventShape()\n\n function getLevelVal () {\n return levelToValue(this.level, this)\n }\n\n function getLevel () {\n return this._level\n }\n function setLevel (level) {\n if (level !== 'silent' && !this.levels.values[level]) {\n throw Error('unknown level ' + level)\n }\n this._level = level\n\n set(this, setOpts, logger, 'error') // <-- must stay first\n set(this, setOpts, logger, 'fatal')\n set(this, setOpts, logger, 'warn')\n set(this, setOpts, logger, 'info')\n set(this, setOpts, logger, 'debug')\n set(this, setOpts, logger, 'trace')\n\n customLevels.forEach((level) => {\n set(this, setOpts, logger, level)\n })\n }\n\n function child (bindings, childOptions) {\n if (!bindings) {\n throw new Error('missing bindings for child Pino')\n }\n childOptions = childOptions || {}\n if (serialize && bindings.serializers) {\n childOptions.serializers = bindings.serializers\n }\n const childOptionsSerializers = childOptions.serializers\n if (serialize && childOptionsSerializers) {\n var childSerializers = Object.assign({}, serializers, childOptionsSerializers)\n var childSerialize = opts.browser.serialize === true\n ? Object.keys(childSerializers)\n : serialize\n delete bindings.serializers\n applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize)\n }\n function Child (parent) {\n this._childLevel = (parent._childLevel | 0) + 1\n\n // make sure bindings are available in the `set` function\n this.bindings = bindings\n\n if (childSerializers) {\n this.serializers = childSerializers\n this._serialize = childSerialize\n }\n if (transmit) {\n this._logEvent = createLogEventShape(\n [].concat(parent._logEvent.bindings, bindings)\n )\n }\n }\n Child.prototype = this\n const newLogger = new Child(this)\n\n // must happen before the level is assigned\n appendChildLogger(this, newLogger)\n // required to actually initialize the logger functions for any given child\n newLogger.level = this.level\n\n return newLogger\n }\n return logger\n}\n\nfunction getLevels (opts) {\n const customLevels = opts.customLevels || {}\n\n const values = Object.assign({}, pino.levels.values, customLevels)\n const labels = Object.assign({}, pino.levels.labels, invertObject(customLevels))\n\n return {\n values,\n labels\n }\n}\n\nfunction invertObject (obj) {\n const inverted = {}\n Object.keys(obj).forEach(function (key) {\n inverted[obj[key]] = key\n })\n return inverted\n}\n\npino.levels = {\n values: {\n fatal: 60,\n error: 50,\n warn: 40,\n info: 30,\n debug: 20,\n trace: 10\n },\n labels: {\n 10: 'trace',\n 20: 'debug',\n 30: 'info',\n 40: 'warn',\n 50: 'error',\n 60: 'fatal'\n }\n}\n\npino.stdSerializers = stdSerializers\npino.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime })\n\nfunction getBindingChain (logger) {\n const bindings = []\n if (logger.bindings) {\n bindings.push(logger.bindings)\n }\n\n // traverse up the tree to get all bindings\n let hierarchy = logger[hierarchySymbol]\n while (hierarchy.parent) {\n hierarchy = hierarchy.parent\n if (hierarchy.logger.bindings) {\n bindings.push(hierarchy.logger.bindings)\n }\n }\n\n return bindings.reverse()\n}\n\nfunction set (self, opts, rootLogger, level) {\n // override the current log functions with either `noop` or the base log function\n Object.defineProperty(self, level, {\n value: (levelToValue(self.level, rootLogger) > levelToValue(level, rootLogger)\n ? noop\n : rootLogger[baseLogFunctionSymbol][level]),\n writable: true,\n enumerable: true,\n configurable: true\n })\n\n if (!opts.transmit && self[level] === noop) {\n return\n }\n\n // make sure the log format is correct\n self[level] = createWrap(self, opts, rootLogger, level)\n\n // prepend bindings if it is not the root logger\n const bindings = getBindingChain(self)\n if (bindings.length === 0) {\n // early exit in case for rootLogger\n return\n }\n self[level] = prependBindingsInArguments(bindings, self[level])\n}\n\nfunction prependBindingsInArguments (bindings, logFunc) {\n return function () {\n return logFunc.apply(this, [...bindings, ...arguments])\n }\n}\n\nfunction createWrap (self, opts, rootLogger, level) {\n return (function (write) {\n return function LOG () {\n const ts = opts.timestamp()\n const args = new Array(arguments.length)\n const proto = (Object.getPrototypeOf && Object.getPrototypeOf(this) === _console) ? _console : this\n for (var i = 0; i < args.length; i++) args[i] = arguments[i]\n\n if (opts.serialize && !opts.asObject) {\n applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize)\n }\n if (opts.asObject || opts.formatters) {\n write.call(proto, asObject(this, level, args, ts, opts.formatters))\n } else write.apply(proto, args)\n\n if (opts.transmit) {\n const transmitLevel = opts.transmit.level || self._level\n const transmitValue = rootLogger.levels.values[transmitLevel]\n const methodValue = rootLogger.levels.values[level]\n if (methodValue < transmitValue) return\n transmit(this, {\n ts,\n methodLevel: level,\n methodValue,\n transmitLevel,\n transmitValue: rootLogger.levels.values[opts.transmit.level || self._level],\n send: opts.transmit.send,\n val: levelToValue(self._level, rootLogger)\n }, args)\n }\n }\n })(self[baseLogFunctionSymbol][level])\n}\n\nfunction asObject (logger, level, args, ts, formatters = {}) {\n const {\n level: levelFormatter = () => logger.levels.values[level],\n log: logObjectFormatter = (obj) => obj\n } = formatters\n if (logger._serialize) applySerializers(args, logger._serialize, logger.serializers, logger._stdErrSerialize)\n const argsCloned = args.slice()\n let msg = argsCloned[0]\n const logObject = {}\n if (ts) {\n logObject.time = ts\n }\n logObject.level = levelFormatter(level, logger.levels.values[level])\n\n let lvl = (logger._childLevel | 0) + 1\n if (lvl < 1) lvl = 1\n // deliberate, catching objects, arrays\n if (msg !== null && typeof msg === 'object') {\n while (lvl-- && typeof argsCloned[0] === 'object') {\n Object.assign(logObject, argsCloned.shift())\n }\n msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : undefined\n } else if (typeof msg === 'string') msg = format(argsCloned.shift(), argsCloned)\n if (msg !== undefined) logObject.msg = msg\n\n const formattedLogObject = logObjectFormatter(logObject)\n return formattedLogObject\n}\n\nfunction applySerializers (args, serialize, serializers, stdErrSerialize) {\n for (const i in args) {\n if (stdErrSerialize && args[i] instanceof Error) {\n args[i] = pino.stdSerializers.err(args[i])\n } else if (typeof args[i] === 'object' && !Array.isArray(args[i])) {\n for (const k in args[i]) {\n if (serialize && serialize.indexOf(k) > -1 && k in serializers) {\n args[i][k] = serializers[k](args[i][k])\n }\n }\n }\n }\n}\n\nfunction transmit (logger, opts, args) {\n const send = opts.send\n const ts = opts.ts\n const methodLevel = opts.methodLevel\n const methodValue = opts.methodValue\n const val = opts.val\n const bindings = logger._logEvent.bindings\n\n applySerializers(\n args,\n logger._serialize || Object.keys(logger.serializers),\n logger.serializers,\n logger._stdErrSerialize === undefined ? true : logger._stdErrSerialize\n )\n logger._logEvent.ts = ts\n logger._logEvent.messages = args.filter(function (arg) {\n // bindings can only be objects, so reference equality check via indexOf is fine\n return bindings.indexOf(arg) === -1\n })\n\n logger._logEvent.level.label = methodLevel\n logger._logEvent.level.value = methodValue\n\n send(methodLevel, logger._logEvent, val)\n\n logger._logEvent = createLogEventShape(bindings)\n}\n\nfunction createLogEventShape (bindings) {\n return {\n ts: 0,\n messages: [],\n bindings: bindings || [],\n level: { label: '', value: 0 }\n }\n}\n\nfunction asErrValue (err) {\n const obj = {\n type: err.constructor.name,\n msg: err.message,\n stack: err.stack\n }\n for (const key in err) {\n if (obj[key] === undefined) {\n obj[key] = err[key]\n }\n }\n return obj\n}\n\nfunction getTimeFunction (opts) {\n if (typeof opts.timestamp === 'function') {\n return opts.timestamp\n }\n if (opts.timestamp === false) {\n return nullTime\n }\n return epochTime\n}\n\nfunction mock () { return {} }\nfunction passthrough (a) { return a }\nfunction noop () {}\n\nfunction nullTime () { return false }\nfunction epochTime () { return Date.now() }\nfunction unixTime () { return Math.round(Date.now() / 1000.0) }\nfunction isoTime () { return new Date(Date.now()).toISOString() } // using Date.now() for testability\n\n/* eslint-disable */\n/* istanbul ignore next */\nfunction pfGlobalThisOrFallback () {\n function defd (o) { return typeof o !== 'undefined' && o }\n try {\n if (typeof globalThis !== 'undefined') return globalThis\n Object.defineProperty(Object.prototype, 'globalThis', {\n get: function () {\n delete Object.prototype.globalThis\n return (this.globalThis = this)\n },\n configurable: true\n })\n return globalThis\n } catch (e) {\n return defd(self) || defd(window) || defd(this) || {}\n }\n}\n/* eslint-enable */\n\nmodule.exports.default = pino\nmodule.exports.pino = pino\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.logger = void 0;\nconst pino_1 = require(\"pino\");\n// Create a Pino logger instance\nexports.logger = (0, pino_1.default)({\n level: process.env.NODE_ENV === 'production' ? 'warn' : 'info',\n // https://getpino.io/#/docs/browser\n browser: { disabled: true },\n});\n//# sourceMappingURL=application-logger.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst application_logger_1 = require(\"./application-logger\");\nconst constants_1 = require(\"./constants\");\n// TODO: change this to a class with methods instead of something that returns a function\nfunction initPoller(intervalMs, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ncallback, options) {\n let stopped = false;\n let failedAttempts = 0;\n let nextPollMs = intervalMs;\n let previousPollFailed = false;\n let nextTimer = undefined;\n const start = async () => {\n var _a;\n stopped = false;\n let startRequestSuccess = false;\n let startAttemptsRemaining = 1 + ((_a = options === null || options === void 0 ? void 0 : options.maxStartRetries) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES);\n let startErrorToThrow = null;\n while (!startRequestSuccess && startAttemptsRemaining > 0) {\n try {\n await callback();\n startRequestSuccess = true;\n previousPollFailed = false;\n application_logger_1.logger.info('Eppo SDK successfully requested initial configuration');\n }\n catch (pollingError) {\n previousPollFailed = true;\n application_logger_1.logger.warn(`Eppo SDK encountered an error with initial poll of configurations: ${pollingError.message}`);\n if (--startAttemptsRemaining > 0) {\n const jitterMs = randomJitterMs(intervalMs);\n application_logger_1.logger.warn(`Eppo SDK will retry the initial poll again in ${jitterMs} ms (${startAttemptsRemaining} attempts remaining)`);\n await new Promise((resolve) => setTimeout(resolve, jitterMs));\n }\n else {\n if (options === null || options === void 0 ? void 0 : options.pollAfterFailedStart) {\n application_logger_1.logger.warn('Eppo SDK initial poll failed; will attempt regular polling');\n }\n else {\n application_logger_1.logger.error('Eppo SDK initial poll failed. Aborting polling');\n stop();\n }\n if (options === null || options === void 0 ? void 0 : options.errorOnFailedStart) {\n startErrorToThrow = pollingError;\n }\n }\n }\n }\n const startRegularPolling = !stopped &&\n ((startRequestSuccess && (options === null || options === void 0 ? void 0 : options.pollAfterSuccessfulStart)) ||\n (!startRequestSuccess && (options === null || options === void 0 ? void 0 : options.pollAfterFailedStart)));\n if (startRegularPolling) {\n application_logger_1.logger.info(`Eppo SDK starting regularly polling every ${intervalMs} ms`);\n nextTimer = setTimeout(poll, intervalMs);\n }\n else {\n application_logger_1.logger.info(`Eppo SDK will not poll for configuration updates`);\n }\n if (startErrorToThrow) {\n application_logger_1.logger.info('Eppo SDK rethrowing start error');\n throw startErrorToThrow;\n }\n };\n const stop = () => {\n if (!stopped) {\n stopped = true;\n if (nextTimer) {\n clearTimeout(nextTimer);\n }\n application_logger_1.logger.info('Eppo SDK polling stopped');\n }\n };\n async function poll() {\n var _a;\n if (stopped) {\n return;\n }\n try {\n await callback();\n // If no error, reset any retrying\n failedAttempts = 0;\n nextPollMs = intervalMs;\n if (previousPollFailed) {\n previousPollFailed = false;\n application_logger_1.logger.info('Eppo SDK poll successful; resuming normal polling');\n }\n }\n catch (error) {\n previousPollFailed = true;\n application_logger_1.logger.warn(`Eppo SDK encountered an error polling configurations: ${error.message}`);\n const maxTries = 1 + ((_a = options === null || options === void 0 ? void 0 : options.maxPollRetries) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_POLL_CONFIG_REQUEST_RETRIES);\n if (++failedAttempts < maxTries) {\n const failureWaitMultiplier = Math.pow(2, failedAttempts);\n const jitterMs = randomJitterMs(intervalMs);\n nextPollMs = failureWaitMultiplier * intervalMs + jitterMs;\n application_logger_1.logger.warn(`Eppo SDK will try polling again in ${nextPollMs} ms (${maxTries - failedAttempts} attempts remaining)`);\n }\n else {\n application_logger_1.logger.error(`Eppo SDK reached maximum of ${failedAttempts} failed polling attempts. Stopping polling`);\n stop();\n }\n }\n setTimeout(poll, nextPollMs);\n }\n return {\n start,\n stop,\n };\n}\nexports.default = initPoller;\n/**\n * Compute a random jitter as a percentage of the polling interval.\n * Will be (5%,10%) of the interval assuming POLL_JITTER_PCT = 0.1\n */\nfunction randomJitterMs(intervalMs) {\n const halfPossibleJitter = (intervalMs * constants_1.POLL_JITTER_PCT) / 2;\n // We want the randomly chosen jitter to be at least 1ms so total jitter is slightly more than half the max possible.\n // This makes things easy for automated tests as two polls cannot execute within the maximum possible time waiting for one.\n const randomOtherHalfJitter = Math.max(Math.floor((Math.random() * intervalMs * constants_1.POLL_JITTER_PCT) / 2), 1);\n return halfPossibleJitter + randomOtherHalfJitter;\n}\n//# sourceMappingURL=poller.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateNotBlank = exports.InvalidArgumentError = void 0;\nclass InvalidArgumentError extends Error {\n}\nexports.InvalidArgumentError = InvalidArgumentError;\nfunction validateNotBlank(value, errorMessage) {\n if (value == null || value.length === 0) {\n throw new InvalidArgumentError(errorMessage);\n }\n}\nexports.validateNotBlank = validateNotBlank;\n//# sourceMappingURL=validation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LIB_VERSION = void 0;\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst packageJson = require('../package.json');\nexports.LIB_VERSION = packageJson.version;\n//# sourceMappingURL=version.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkValueTypeMatch = exports.checkTypeMatch = void 0;\nconst assignment_cache_1 = require(\"../assignment-cache\");\nconst constants_1 = require(\"../constants\");\nconst decoding_1 = require(\"../decoding\");\nconst eppo_value_1 = require(\"../eppo_value\");\nconst evaluator_1 = require(\"../evaluator\");\nconst flag_configuration_requestor_1 = require(\"../flag-configuration-requestor\");\nconst http_client_1 = require(\"../http-client\");\nconst interfaces_1 = require(\"../interfaces\");\nconst obfuscation_1 = require(\"../obfuscation\");\nconst poller_1 = require(\"../poller\");\nconst validation_1 = require(\"../validation\");\nconst version_1 = require(\"../version\");\nclass EppoClient {\n constructor(configurationStore, configurationRequestParameters, obfuscated = false) {\n this.queuedEvents = [];\n this.isGracefulFailureMode = true;\n this.isObfuscated = false;\n this.evaluator = new evaluator_1.Evaluator();\n this.configurationStore = configurationStore;\n this.configurationRequestParameters = configurationRequestParameters;\n this.isObfuscated = obfuscated;\n }\n setConfigurationRequestParameters(configurationRequestParameters) {\n this.configurationRequestParameters = configurationRequestParameters;\n }\n async fetchFlagConfigurations() {\n var _a, _b, _c, _d, _e;\n if (!this.configurationRequestParameters) {\n throw new Error('Eppo SDK unable to fetch flag configurations without configuration request parameters');\n }\n if (this.requestPoller) {\n // if fetchFlagConfigurations() was previously called, stop any polling process from that call\n this.requestPoller.stop();\n }\n // todo: consider injecting the IHttpClient interface\n const httpClient = new http_client_1.default(this.configurationRequestParameters.baseUrl || constants_1.BASE_URL, {\n apiKey: this.configurationRequestParameters.apiKey,\n sdkName: this.configurationRequestParameters.sdkName,\n sdkVersion: this.configurationRequestParameters.sdkVersion,\n }, this.configurationRequestParameters.requestTimeoutMs || constants_1.DEFAULT_REQUEST_TIMEOUT_MS);\n const configurationRequestor = new flag_configuration_requestor_1.default(this.configurationStore, httpClient);\n this.requestPoller = (0, poller_1.default)(constants_1.POLL_INTERVAL_MS, configurationRequestor.fetchAndStoreConfigurations.bind(configurationRequestor), {\n maxStartRetries: (_a = this.configurationRequestParameters.numInitialRequestRetries) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES,\n maxPollRetries: (_b = this.configurationRequestParameters.numPollRequestRetries) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_POLL_CONFIG_REQUEST_RETRIES,\n pollAfterSuccessfulStart: (_c = this.configurationRequestParameters.pollAfterSuccessfulInitialization) !== null && _c !== void 0 ? _c : false,\n pollAfterFailedStart: (_d = this.configurationRequestParameters.pollAfterFailedInitialization) !== null && _d !== void 0 ? _d : false,\n errorOnFailedStart: (_e = this.configurationRequestParameters.throwOnFailedInitialization) !== null && _e !== void 0 ? _e : false,\n });\n await this.requestPoller.start();\n }\n stopPolling() {\n if (this.requestPoller) {\n this.requestPoller.stop();\n }\n }\n getStringAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n var _a;\n return ((_a = this.getAssignmentVariation(flagKey, subjectKey, subjectAttributes, eppo_value_1.EppoValue.String(defaultValue), interfaces_1.VariationType.STRING).stringValue) !== null && _a !== void 0 ? _a : defaultValue);\n }\n getBoolAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n var _a;\n return ((_a = this.getAssignmentVariation(flagKey, subjectKey, subjectAttributes, eppo_value_1.EppoValue.Bool(defaultValue), interfaces_1.VariationType.BOOLEAN).boolValue) !== null && _a !== void 0 ? _a : defaultValue);\n }\n getIntegerAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n var _a;\n return ((_a = this.getAssignmentVariation(flagKey, subjectKey, subjectAttributes, eppo_value_1.EppoValue.Numeric(defaultValue), interfaces_1.VariationType.INTEGER).numericValue) !== null && _a !== void 0 ? _a : defaultValue);\n }\n getNumericAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n var _a;\n return ((_a = this.getAssignmentVariation(flagKey, subjectKey, subjectAttributes, eppo_value_1.EppoValue.Numeric(defaultValue), interfaces_1.VariationType.NUMERIC).numericValue) !== null && _a !== void 0 ? _a : defaultValue);\n }\n getJSONAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n var _a;\n return ((_a = this.getAssignmentVariation(flagKey, subjectKey, subjectAttributes, eppo_value_1.EppoValue.JSON(defaultValue), interfaces_1.VariationType.JSON).objectValue) !== null && _a !== void 0 ? _a : defaultValue);\n }\n getAssignmentVariation(flagKey, subjectKey, subjectAttributes, defaultValue, expectedVariationType) {\n try {\n const result = this.getAssignmentDetail(flagKey, subjectKey, subjectAttributes, expectedVariationType);\n if (!result.variation) {\n return defaultValue;\n }\n return eppo_value_1.EppoValue.valueOf(result.variation.value, expectedVariationType);\n }\n catch (error) {\n return this.rethrowIfNotGraceful(error, defaultValue);\n }\n }\n rethrowIfNotGraceful(err, defaultValue) {\n if (this.isGracefulFailureMode) {\n console.error(`[Eppo SDK] Error getting assignment: ${err.message}`);\n return defaultValue !== null && defaultValue !== void 0 ? defaultValue : eppo_value_1.EppoValue.Null();\n }\n throw err;\n }\n /**\n * [Experimental] Get a detailed return of assignment for a particular subject and flag.\n *\n * Note: This method is experimental and may change in future versions.\n * Please only use for debugging purposes, and not in production.\n *\n * @param subjectKey The subject key\n * @param flagKey The flag key\n * @param subjectAttributes The subject attributes\n * @param expectedVariationType The expected variation type\n * @param obfuscated Whether the flag key is obfuscated\n * @returns A detailed return of assignment for a particular subject and flag\n */\n getAssignmentDetail(flagKey, subjectKey, subjectAttributes = {}, expectedVariationType) {\n (0, validation_1.validateNotBlank)(subjectKey, 'Invalid argument: subjectKey cannot be blank');\n (0, validation_1.validateNotBlank)(flagKey, 'Invalid argument: flagKey cannot be blank');\n const flag = this.getFlag(flagKey);\n if (flag === null) {\n console.warn(`[Eppo SDK] No assigned variation. Flag not found: ${flagKey}`);\n // note: this is different from the Python SDK, which returns None instead\n return (0, evaluator_1.noneResult)(flagKey, subjectKey, subjectAttributes);\n }\n if (!checkTypeMatch(expectedVariationType, flag.variationType)) {\n throw new TypeError(`Variation value does not have the correct type. Found: ${flag.variationType} != ${expectedVariationType} for flag ${flagKey}`);\n }\n if (!flag.enabled) {\n console.info(`[Eppo SDK] No assigned variation. Flag is disabled: ${flagKey}`);\n // note: this is different from the Python SDK, which returns None instead\n return (0, evaluator_1.noneResult)(flagKey, subjectKey, subjectAttributes);\n }\n const result = this.evaluator.evaluateFlag(flag, subjectKey, subjectAttributes, this.isObfuscated);\n if (this.isObfuscated) {\n // flag.key is obfuscated, replace with requested flag key\n result.flagKey = flagKey;\n }\n if ((result === null || result === void 0 ? void 0 : result.variation) && !checkValueTypeMatch(expectedVariationType, result.variation.value)) {\n return (0, evaluator_1.noneResult)(flagKey, subjectKey, subjectAttributes);\n }\n try {\n if (result === null || result === void 0 ? void 0 : result.doLog) {\n this.logAssignment(result);\n }\n }\n catch (error) {\n console.error(`[Eppo SDK] Error logging assignment event: ${error}`);\n }\n return result;\n }\n getFlag(flagKey) {\n if (this.isObfuscated) {\n return this.getObfuscatedFlag(flagKey);\n }\n return this.configurationStore.get(flagKey);\n }\n getObfuscatedFlag(flagKey) {\n const flag = this.configurationStore.get((0, obfuscation_1.getMD5Hash)(flagKey));\n return flag ? (0, decoding_1.decodeFlag)(flag) : null;\n }\n getFlagKeys() {\n /**\n * Returns a list of all flag keys that have been initialized.\n * This can be useful to debug the initialization process.\n *\n * Note that it is generally not a good idea to pre-load all flag configurations.\n */\n return this.configurationStore.getKeys();\n }\n isInitialized() {\n return this.configurationStore.isInitialized();\n }\n setLogger(logger) {\n this.assignmentLogger = logger;\n this.flushQueuedEvents(); // log any events that may have been queued while initializing\n }\n /**\n * Assignment cache methods.\n */\n disableAssignmentCache() {\n this.assignmentCache = undefined;\n }\n useNonExpiringInMemoryAssignmentCache() {\n this.assignmentCache = new assignment_cache_1.NonExpiringInMemoryAssignmentCache();\n }\n useLRUInMemoryAssignmentCache(maxSize) {\n this.assignmentCache = new assignment_cache_1.LRUInMemoryAssignmentCache(maxSize);\n }\n useCustomAssignmentCache(cache) {\n this.assignmentCache = cache;\n }\n setIsGracefulFailureMode(gracefulFailureMode) {\n this.isGracefulFailureMode = gracefulFailureMode;\n }\n flushQueuedEvents() {\n var _a;\n const eventsToFlush = this.queuedEvents;\n this.queuedEvents = [];\n try {\n for (const event of eventsToFlush) {\n (_a = this.assignmentLogger) === null || _a === void 0 ? void 0 : _a.logAssignment(event);\n }\n }\n catch (error) {\n console.error(`[Eppo SDK] Error flushing assignment events: ${error.message}`);\n }\n }\n logAssignment(result) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n const event = Object.assign(Object.assign({}, ((_a = result.extraLogging) !== null && _a !== void 0 ? _a : {})), { allocation: (_b = result.allocationKey) !== null && _b !== void 0 ? _b : null, experiment: result.allocationKey ? `${result.flagKey}-${result.allocationKey}` : null, featureFlag: result.flagKey, variation: (_d = (_c = result.variation) === null || _c === void 0 ? void 0 : _c.key) !== null && _d !== void 0 ? _d : null, subject: result.subjectKey, timestamp: new Date().toISOString(), subjectAttributes: result.subjectAttributes, metaData: {\n obfuscated: this.isObfuscated,\n sdkLanguage: 'javascript',\n sdkLibVersion: version_1.LIB_VERSION,\n } });\n if (result.variation &&\n result.allocationKey &&\n ((_e = this.assignmentCache) === null || _e === void 0 ? void 0 : _e.hasLoggedAssignment({\n flagKey: result.flagKey,\n subjectKey: result.subjectKey,\n allocationKey: result.allocationKey,\n variationKey: result.variation.key,\n }))) {\n return;\n }\n // assignment logger may be null while waiting for initialization\n if (this.assignmentLogger == null) {\n this.queuedEvents.length < constants_1.MAX_EVENT_QUEUE_SIZE && this.queuedEvents.push(event);\n return;\n }\n try {\n this.assignmentLogger.logAssignment(event);\n (_f = this.assignmentCache) === null || _f === void 0 ? void 0 : _f.setLastLoggedAssignment({\n flagKey: result.flagKey,\n subjectKey: result.subjectKey,\n allocationKey: (_g = result.allocationKey) !== null && _g !== void 0 ? _g : '__eppo_no_allocation',\n variationKey: (_j = (_h = result.variation) === null || _h === void 0 ? void 0 : _h.key) !== null && _j !== void 0 ? _j : '__eppo_no_variation',\n });\n }\n catch (error) {\n console.error(`[Eppo SDK] Error logging assignment event: ${error.message}`);\n }\n }\n}\nexports.default = EppoClient;\nfunction checkTypeMatch(expectedType, actualType) {\n return expectedType === undefined || actualType === expectedType;\n}\nexports.checkTypeMatch = checkTypeMatch;\nfunction checkValueTypeMatch(expectedType, value) {\n if (expectedType == undefined) {\n return true;\n }\n switch (expectedType) {\n case interfaces_1.VariationType.STRING:\n return typeof value === 'string';\n case interfaces_1.VariationType.BOOLEAN:\n return typeof value === 'boolean';\n case interfaces_1.VariationType.INTEGER:\n return typeof value === 'number' && Number.isInteger(value);\n case interfaces_1.VariationType.NUMERIC:\n return typeof value === 'number';\n case interfaces_1.VariationType.JSON:\n // note: converting to object downstream\n return typeof value === 'string';\n default:\n return false;\n }\n}\nexports.checkValueTypeMatch = checkValueTypeMatch;\n//# sourceMappingURL=eppo-client.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VariationType = exports.AssignmentCache = exports.validation = exports.HttpClient = exports.FlagConfigRequestor = exports.constants = exports.EppoClient = void 0;\nconst assignment_cache_1 = require(\"./assignment-cache\");\nObject.defineProperty(exports, \"AssignmentCache\", { enumerable: true, get: function () { return assignment_cache_1.AssignmentCache; } });\nconst eppo_client_1 = require(\"./client/eppo-client\");\nexports.EppoClient = eppo_client_1.default;\nconst constants = require(\"./constants\");\nexports.constants = constants;\nconst flag_configuration_requestor_1 = require(\"./flag-configuration-requestor\");\nexports.FlagConfigRequestor = flag_configuration_requestor_1.default;\nconst http_client_1 = require(\"./http-client\");\nexports.HttpClient = http_client_1.default;\nconst interfaces_1 = require(\"./interfaces\");\nObject.defineProperty(exports, \"VariationType\", { enumerable: true, get: function () { return interfaces_1.VariationType; } });\nconst validation = require(\"./validation\");\nexports.validation = validation;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasWindowLocalStorage = exports.EppoLocalStorage = void 0;\nclass EppoLocalStorage {\n constructor() {\n if (!hasWindowLocalStorage()) {\n console.warn('EppoSDK cannot store experiment configurations as window.localStorage is not available');\n }\n }\n isInitialized() {\n return hasWindowLocalStorage();\n }\n get(key) {\n if (hasWindowLocalStorage()) {\n const serializedEntry = window.localStorage.getItem(key);\n if (serializedEntry) {\n return JSON.parse(serializedEntry);\n }\n }\n return null;\n }\n getKeys() {\n if (hasWindowLocalStorage()) {\n return Object.keys(window.localStorage);\n }\n return null;\n }\n setEntries(entries) {\n if (hasWindowLocalStorage()) {\n Object.entries(entries).forEach(([key, val]) => {\n window.localStorage.setItem(key, JSON.stringify(val));\n });\n }\n }\n}\nexports.EppoLocalStorage = EppoLocalStorage;\n// Checks whether local storage is enabled in the browser (the user might have disabled it).\nfunction hasWindowLocalStorage() {\n try {\n return typeof window !== 'undefined' && !!window.localStorage;\n }\n catch (_a) {\n // Chrome throws an error if local storage is disabled and you try to access it\n return false;\n }\n}\nexports.hasWindowLocalStorage = hasWindowLocalStorage;\n//# sourceMappingURL=local-storage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LocalStorageAssignmentCache = void 0;\nconst js_client_sdk_common_1 = require(\"@eppo/js-client-sdk-common\");\nconst local_storage_1 = require(\"./local-storage\");\nclass LocalStorageAssignmentShim {\n constructor() {\n this.LOCAL_STORAGE_KEY = 'EPPO_LOCAL_STORAGE_ASSIGNMENT_CACHE';\n }\n has(key) {\n if (!(0, local_storage_1.hasWindowLocalStorage)()) {\n return false;\n }\n return this.getCache().has(key);\n }\n get(key) {\n if (!(0, local_storage_1.hasWindowLocalStorage)()) {\n return null;\n }\n return this.getCache().get(key);\n }\n set(key, value) {\n if (!(0, local_storage_1.hasWindowLocalStorage)()) {\n return;\n }\n const cache = this.getCache();\n cache.set(key, value);\n this.setCache(cache);\n }\n getCache() {\n const cache = window.localStorage.getItem(this.LOCAL_STORAGE_KEY);\n return cache ? new Map(JSON.parse(cache)) : new Map();\n }\n setCache(cache) {\n window.localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(Array.from(cache.entries())));\n }\n}\nclass LocalStorageAssignmentCache extends js_client_sdk_common_1.AssignmentCache {\n constructor() {\n super(new LocalStorageAssignmentShim());\n }\n}\nexports.LocalStorageAssignmentCache = LocalStorageAssignmentCache;\n//# sourceMappingURL=local-storage-assignment-cache.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sdkName = exports.sdkVersion = void 0;\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst packageJson = require('../package.json');\nexports.sdkVersion = packageJson.version;\nexports.sdkName = 'js-client-sdk';\n//# sourceMappingURL=sdk-data.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getInstance = exports.init = exports.EppoJSClient = void 0;\nconst js_client_sdk_common_1 = require(\"@eppo/js-client-sdk-common\");\nconst local_storage_1 = require(\"./local-storage\");\nconst local_storage_assignment_cache_1 = require(\"./local-storage-assignment-cache\");\nconst sdk_data_1 = require(\"./sdk-data\");\nconst localStorage = new local_storage_1.EppoLocalStorage();\n/**\n * Client for assigning experiment variations.\n * @public\n */\nclass EppoJSClient extends js_client_sdk_common_1.EppoClient {\n getStringAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n EppoJSClient.getAssignmentInitializationCheck();\n return super.getStringAssignment(flagKey, subjectKey, subjectAttributes, defaultValue);\n }\n getBoolAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n EppoJSClient.getAssignmentInitializationCheck();\n return super.getBoolAssignment(flagKey, subjectKey, subjectAttributes, defaultValue);\n }\n getIntegerAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n EppoJSClient.getAssignmentInitializationCheck();\n return super.getIntegerAssignment(flagKey, subjectKey, subjectAttributes, defaultValue);\n }\n getNumericAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n EppoJSClient.getAssignmentInitializationCheck();\n return super.getNumericAssignment(flagKey, subjectKey, subjectAttributes, defaultValue);\n }\n getJSONAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) {\n EppoJSClient.getAssignmentInitializationCheck();\n return super.getJSONAssignment(flagKey, subjectKey, subjectAttributes, defaultValue);\n }\n static getAssignmentInitializationCheck() {\n if (!EppoJSClient.initialized) {\n console.warn('Eppo SDK assignment requested before init() completed');\n }\n }\n}\nexports.EppoJSClient = EppoJSClient;\nEppoJSClient.instance = new EppoJSClient(localStorage, undefined, true);\nEppoJSClient.initialized = false;\n/**\n * Initializes the Eppo client with configuration parameters.\n * This method should be called once on application startup.\n * @param config - client configuration\n * @public\n */\nasync function init(config) {\n var _a, _b, _c, _d, _e, _f, _g;\n js_client_sdk_common_1.validation.validateNotBlank(config.apiKey, 'API key required');\n try {\n // If any existing instances; ensure they are not polling\n if (EppoJSClient.instance) {\n EppoJSClient.instance.stopPolling();\n }\n const requestConfiguration = {\n apiKey: config.apiKey,\n sdkName: sdk_data_1.sdkName,\n sdkVersion: sdk_data_1.sdkVersion,\n baseUrl: (_a = config.baseUrl) !== null && _a !== void 0 ? _a : undefined,\n requestTimeoutMs: (_b = config.requestTimeoutMs) !== null && _b !== void 0 ? _b : undefined,\n numInitialRequestRetries: (_c = config.numInitialRequestRetries) !== null && _c !== void 0 ? _c : undefined,\n numPollRequestRetries: (_d = config.numPollRequestRetries) !== null && _d !== void 0 ? _d : undefined,\n pollAfterSuccessfulInitialization: (_e = config.pollAfterSuccessfulInitialization) !== null && _e !== void 0 ? _e : false,\n pollAfterFailedInitialization: (_f = config.pollAfterFailedInitialization) !== null && _f !== void 0 ? _f : false,\n throwOnFailedInitialization: true, // always use true here as underlying instance fetch is surrounded by try/catch\n };\n EppoJSClient.instance.setLogger(config.assignmentLogger);\n // default behavior is to use a LocalStorage-based assignment cache.\n // this can be overridden after initialization.\n EppoJSClient.instance.useCustomAssignmentCache(new local_storage_assignment_cache_1.LocalStorageAssignmentCache());\n EppoJSClient.instance.setConfigurationRequestParameters(requestConfiguration);\n await EppoJSClient.instance.fetchFlagConfigurations();\n }\n catch (error) {\n console.warn('Eppo SDK encountered an error initializing, assignment calls will return the default value and not be logged' +\n (config.pollAfterFailedInitialization\n ? ' until an experiment configuration is successfully retrieved'\n : ''));\n if ((_g = config.throwOnFailedInitialization) !== null && _g !== void 0 ? _g : true) {\n throw error;\n }\n }\n EppoJSClient.initialized = true;\n return EppoJSClient.instance;\n}\nexports.init = init;\n/**\n * Used to access a singleton SDK client instance.\n * Use the method after calling init() to initialize the client.\n * @returns a singleton client instance\n * @public\n */\nfunction getInstance() {\n return EppoJSClient.instance;\n}\nexports.getInstance = getInstance;\n//# sourceMappingURL=index.js.map","// Overloading ahoy track so that it populates the URL for every call\n\nlet configured = false;\n\nexport default ( name, properties = {}) => {\n if ( configured === false && window.ahoy ) {\n window.ahoy.configure({\n visitDuration: 30\n });\n configured = true;\n }\n if ( window.ahoy ) {\n const propertiesForEvent = Object.assign( properties, { url: window.location.href });\n window.ahoy.track( name, propertiesForEvent );\n }\n};\n","import ahoyTrack from 'src/explore/services/ahoy';\n\nconst existingProperties = ( object: Object ) => {\n const found = {};\n\n Object.keys( object ).forEach(( key: string ) => {\n if ( object[key as keyof object] != null ) {\n found[key as keyof object] = object[key as keyof object];\n }\n });\n\n return found;\n};\n\nconst trackEvent = (\n event: string,\n properties: Record,\n removeEmptyProperties: boolean = true\n) => {\n const propertiesForEvent = Object.assign( properties, { page: window.location.pathname });\n ahoyTrack(\n event,\n removeEmptyProperties ? existingProperties( propertiesForEvent ) : propertiesForEvent\n );\n};\n\nconst trackClick = ( properties: Record ) => {\n trackEvent( '$click', properties );\n};\n\nconst trackClicks = ( selector: string ) => {\n // properties can be added or overridden using data-analytics attributes\n // on $click targets with semicolon separated `key: value` data\n // e.g. \"position: 1; text: donut\"\n const specialProperties = ( data: string ) => {\n const cast = ( value: string ) => {\n if ( /^true$/i.test( value )) {\n return true;\n }\n if ( /^false$/i.test( value )) {\n return false;\n }\n if ( /^-?\\d*\\.?\\d+$/.test( value )) {\n return Number( value );\n }\n return value;\n };\n\n const entries: {\n [key: string]: boolean | number | string;\n } = {};\n\n if ( data ) {\n data.split( ';' ).forEach(( datum ) => {\n const entry = datum.split( ':' );\n if ( entry[1]) {\n entries[entry[0].trim()] = cast( entry[1].trim());\n }\n });\n }\n\n return entries;\n };\n\n document.addEventListener( 'click', ( event: any ) => {\n const tracked = event.target.closest( selector );\n\n if ( tracked && tracked.className.indexOf( 'no-track' ) === -1 ) {\n trackClick({\n class: tracked.className || null,\n href: tracked.href,\n id: tracked.id || null,\n section: tracked.closest( '[data-section]' )?.getAttribute( 'data-section' ),\n tag: tracked.tagName.toLowerCase(),\n text:\n tracked instanceof HTMLInputElement\n ? tracked.value\n : ( tracked.textContent || tracked.innerText || tracked.innerHTML )\n .replace( /[\\s\\r\\n]+/g, ' ' )\n .trim(),\n ...specialProperties( tracked.dataset.analytics ),\n });\n }\n });\n};\n\nexport default {\n trackClick,\n trackClicks,\n trackEvent,\n};\n","import _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nimport * as React from 'react';\nexport var ReduxFormContext = React.createContext(null);\nexport var renderChildren = function renderChildren(Component, _ref) {\n var forwardedRef = _ref.forwardedRef,\n rest = _objectWithoutPropertiesLoose(_ref, [\"forwardedRef\"]);\n\n return function (_reduxForm) {\n return React.createElement(Component, _extends({}, rest, {\n _reduxForm: _reduxForm,\n ref: forwardedRef\n }));\n };\n};\nexport var withReduxForm = function withReduxForm(Component) {\n var Hoc = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Hoc, _React$Component);\n\n function Hoc() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Hoc.prototype;\n\n _proto.render = function render() {\n return React.createElement(ReduxFormContext.Consumer, {\n children: renderChildren(Component, this.props)\n });\n };\n\n return Hoc;\n }(React.Component);\n\n var ref = React.forwardRef(function (props, ref) {\n return React.createElement(Hoc, _extends({}, props, {\n forwardedRef: ref\n }));\n });\n ref.displayName = Component.displayName || Component.name || 'Component';\n return ref;\n};","var defaultShouldAsyncValidate = function defaultShouldAsyncValidate(_ref) {\n var initialized = _ref.initialized,\n trigger = _ref.trigger,\n pristine = _ref.pristine,\n syncValidationPasses = _ref.syncValidationPasses;\n\n if (!syncValidationPasses) {\n return false;\n }\n\n switch (trigger) {\n case 'blur':\n case 'change':\n // blurring\n return true;\n\n case 'submit':\n // submitting, so only async validate if form is dirty or was never initialized\n // conversely, DON'T async validate if the form is pristine just as it was initialized\n return !pristine || !initialized;\n\n default:\n return false;\n }\n};\n\nexport default defaultShouldAsyncValidate;","var defaultShouldValidate = function defaultShouldValidate(_ref) {\n var values = _ref.values,\n nextProps = _ref.nextProps,\n initialRender = _ref.initialRender,\n lastFieldValidatorKeys = _ref.lastFieldValidatorKeys,\n fieldValidatorKeys = _ref.fieldValidatorKeys,\n structure = _ref.structure;\n\n if (initialRender) {\n return true;\n }\n\n return !structure.deepEqual(values, nextProps && nextProps.values) || !structure.deepEqual(lastFieldValidatorKeys, fieldValidatorKeys);\n};\n\nexport default defaultShouldValidate;","var defaultShouldError = function defaultShouldError(_ref) {\n var values = _ref.values,\n nextProps = _ref.nextProps,\n initialRender = _ref.initialRender,\n lastFieldValidatorKeys = _ref.lastFieldValidatorKeys,\n fieldValidatorKeys = _ref.fieldValidatorKeys,\n structure = _ref.structure;\n\n if (initialRender) {\n return true;\n }\n\n return !structure.deepEqual(values, nextProps && nextProps.values) || !structure.deepEqual(lastFieldValidatorKeys, fieldValidatorKeys);\n};\n\nexport default defaultShouldError;","var defaultShouldWarn = function defaultShouldWarn(_ref) {\n var values = _ref.values,\n nextProps = _ref.nextProps,\n initialRender = _ref.initialRender,\n lastFieldValidatorKeys = _ref.lastFieldValidatorKeys,\n fieldValidatorKeys = _ref.fieldValidatorKeys,\n structure = _ref.structure;\n\n if (initialRender) {\n return true;\n }\n\n return !structure.deepEqual(values, nextProps && nextProps.values) || !structure.deepEqual(lastFieldValidatorKeys, fieldValidatorKeys);\n};\n\nexport default defaultShouldWarn;","var formatName = function formatName(_ref, name) {\n var sectionPrefix = _ref._reduxForm.sectionPrefix;\n return sectionPrefix ? sectionPrefix + \".\" + name : name;\n};\n\nexport default formatName;","import { isValidElementType } from 'react-is';\n\nvar validateComponentProp = function validateComponentProp(props, propName, componentName) {\n if (!isValidElementType(props[propName])) {\n return new Error('Invalid prop `' + propName + '` supplied to' + ' `' + componentName + '`.');\n }\n\n return null;\n};\n\nexport default validateComponentProp;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _extendableBuiltin(cls) {\n function ExtendableBuiltin() {\n cls.apply(this, arguments);\n }\n\n ExtendableBuiltin.prototype = Object.create(cls.prototype, {\n constructor: {\n value: cls,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ExtendableBuiltin, cls);\n } else {\n ExtendableBuiltin.__proto__ = cls;\n }\n\n return ExtendableBuiltin;\n}\n\nvar ExtendableError = function (_extendableBuiltin2) {\n _inherits(ExtendableError, _extendableBuiltin2);\n\n function ExtendableError() {\n var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n _classCallCheck(this, ExtendableError);\n\n // extending Error is weird and does not propagate `message`\n var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message));\n\n Object.defineProperty(_this, 'message', {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true\n });\n\n Object.defineProperty(_this, 'name', {\n configurable: true,\n enumerable: false,\n value: _this.constructor.name,\n writable: true\n });\n\n if (Error.hasOwnProperty('captureStackTrace')) {\n Error.captureStackTrace(_this, _this.constructor);\n return _possibleConstructorReturn(_this);\n }\n\n Object.defineProperty(_this, 'stack', {\n configurable: true,\n enumerable: false,\n value: new Error(message).stack,\n writable: true\n });\n return _this;\n }\n\n return ExtendableError;\n}(_extendableBuiltin(Error));\n\nexport default ExtendableError;\n","import _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport ExtendableError from 'es6-error';\nvar __FLAG__ = '@@redux-form/submission-error-flag';\nexport var SubmissionError = /*#__PURE__*/function (_ExtendableError) {\n _inheritsLoose(SubmissionError, _ExtendableError);\n\n /** @private */\n function SubmissionError(errors) {\n var _this;\n\n _this = _ExtendableError.call(this, 'Submit Validation Failed') || this;\n _this.errors = errors;\n return _this;\n }\n\n return SubmissionError;\n}(ExtendableError);\nSubmissionError.__FLAG__ = __FLAG__;\nexport function isSubmissionError(error) {\n return (error && error.constructor && error.constructor.__FLAG__ === __FLAG__) === true;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar processProps = function processProps(type, props, _value, deepEqual) {\n var value = props.value;\n\n if (type === 'checkbox') {\n return _extends({}, props, {\n checked: !!value\n });\n }\n\n if (type === 'radio') {\n return _extends({}, props, {\n checked: deepEqual(value, _value),\n value: _value\n });\n }\n\n if (type === 'select-multiple') {\n return _extends({}, props, {\n value: value || []\n });\n }\n\n if (type === 'file') {\n return _extends({}, props, {\n value: value || undefined\n });\n }\n\n return props;\n};\n\nexport default function createFieldProps(_ref, name, _ref2) {\n var getIn = _ref.getIn,\n toJS = _ref.toJS,\n deepEqual = _ref.deepEqual;\n\n var asyncError = _ref2.asyncError,\n asyncValidating = _ref2.asyncValidating,\n onBlur = _ref2.onBlur,\n onChange = _ref2.onChange,\n onDrop = _ref2.onDrop,\n onDragStart = _ref2.onDragStart,\n dirty = _ref2.dirty,\n dispatch = _ref2.dispatch,\n onFocus = _ref2.onFocus,\n form = _ref2.form,\n format = _ref2.format,\n initial = _ref2.initial,\n parse = _ref2.parse,\n pristine = _ref2.pristine,\n props = _ref2.props,\n state = _ref2.state,\n submitError = _ref2.submitError,\n submitFailed = _ref2.submitFailed,\n submitting = _ref2.submitting,\n syncError = _ref2.syncError,\n syncWarning = _ref2.syncWarning,\n validate = _ref2.validate,\n value = _ref2.value,\n _value = _ref2._value,\n warn = _ref2.warn,\n custom = _objectWithoutPropertiesLoose(_ref2, [\"asyncError\", \"asyncValidating\", \"onBlur\", \"onChange\", \"onDrop\", \"onDragStart\", \"dirty\", \"dispatch\", \"onFocus\", \"form\", \"format\", \"initial\", \"parse\", \"pristine\", \"props\", \"state\", \"submitError\", \"submitFailed\", \"submitting\", \"syncError\", \"syncWarning\", \"validate\", \"value\", \"_value\", \"warn\"]);\n\n var error = syncError || asyncError || submitError;\n var warning = syncWarning;\n\n var formatFieldValue = function formatFieldValue(value, format) {\n if (format === null) {\n return value;\n }\n\n var defaultFormattedValue = value == null ? '' : value;\n return format ? format(value, name) : defaultFormattedValue;\n };\n\n var formattedFieldValue = formatFieldValue(value, format);\n return {\n input: processProps(custom.type, {\n name: name,\n onBlur: onBlur,\n onChange: onChange,\n onDragStart: onDragStart,\n onDrop: onDrop,\n onFocus: onFocus,\n value: formattedFieldValue\n }, _value, deepEqual),\n meta: _extends({}, toJS(state), {\n active: !!(state && getIn(state, 'active')),\n asyncValidating: asyncValidating,\n autofilled: !!(state && getIn(state, 'autofilled')),\n dirty: dirty,\n dispatch: dispatch,\n error: error,\n form: form,\n initial: initial,\n warning: warning,\n invalid: !!error,\n pristine: pristine,\n submitting: !!submitting,\n submitFailed: !!submitFailed,\n touched: !!(state && getIn(state, 'touched')),\n valid: !error,\n visited: !!(state && getIn(state, 'visited'))\n }),\n custom: _extends({}, custom, {}, props)\n };\n}","var isEvent = function isEvent(candidate) {\n return !!(candidate && candidate.stopPropagation && candidate.preventDefault);\n};\n\nexport default isEvent;","import isEvent from './isEvent';\n\nvar getSelectedValues = function getSelectedValues(options) {\n var result = [];\n\n if (options) {\n for (var index = 0; index < options.length; index++) {\n var option = options[index];\n\n if (option.selected) {\n result.push(option.value);\n }\n }\n }\n\n return result;\n};\n\nvar getValue = function getValue(event, isReactNative) {\n if (isEvent(event)) {\n if (!isReactNative && event.nativeEvent && event.nativeEvent.text !== undefined) {\n return event.nativeEvent.text;\n }\n\n if (isReactNative && event.nativeEvent !== undefined) {\n return event.nativeEvent.text;\n }\n\n var detypedEvent = event;\n var _detypedEvent$target = detypedEvent.target,\n type = _detypedEvent$target.type,\n value = _detypedEvent$target.value,\n checked = _detypedEvent$target.checked,\n files = _detypedEvent$target.files,\n dataTransfer = detypedEvent.dataTransfer;\n\n if (type === 'checkbox') {\n return !!checked;\n }\n\n if (type === 'file') {\n return files || dataTransfer && dataTransfer.files;\n }\n\n if (type === 'select-multiple') {\n return getSelectedValues(event.target.options);\n }\n\n return value;\n }\n\n return event;\n};\n\nexport default getValue;","var isReactNative = typeof window !== 'undefined' && window.navigator && window.navigator.product && window.navigator.product === 'ReactNative';\nexport default isReactNative;","import getValue from './getValue';\nimport isReactNative from '../isReactNative';\n\nvar onChangeValue = function onChangeValue(event, _ref) {\n var name = _ref.name,\n parse = _ref.parse,\n normalize = _ref.normalize;\n // read value from input\n var value = getValue(event, isReactNative); // parse value if we have a parser\n\n if (parse) {\n value = parse(value, name);\n } // normalize value\n\n\n if (normalize) {\n value = normalize(name, value);\n }\n\n return value;\n};\n\nexport default onChangeValue;","export var dataKey = 'text';","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport React, { Component, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport createFieldProps from './createFieldProps';\nimport onChangeValue from './events/onChangeValue';\nimport { dataKey } from './util/eventConsts';\nimport plain from './structure/plain';\nimport isReactNative from './isReactNative';\nimport validateComponentProp from './util/validateComponentProp';\nimport isEvent from './events/isEvent';\nvar propsToNotUpdateFor = ['_reduxForm'];\n\nvar isObject = function isObject(entity) {\n return entity && typeof entity === 'object';\n};\n\nvar isFunction = function isFunction(entity) {\n return entity && typeof entity === 'function';\n};\n\nvar eventPreventDefault = function eventPreventDefault(event) {\n if (isObject(event) && isFunction(event.preventDefault)) {\n event.preventDefault();\n }\n};\n\nvar eventDataTransferGetData = function eventDataTransferGetData(event, key) {\n if (isObject(event) && isObject(event.dataTransfer) && isFunction(event.dataTransfer.getData)) {\n return event.dataTransfer.getData(key);\n }\n};\n\nvar eventDataTransferSetData = function eventDataTransferSetData(event, key, value) {\n if (isObject(event) && isObject(event.dataTransfer) && isFunction(event.dataTransfer.setData)) {\n event.dataTransfer.setData(key, value);\n }\n};\n\nfunction createConnectedField(structure) {\n var deepEqual = structure.deepEqual,\n getIn = structure.getIn;\n\n var getSyncError = function getSyncError(syncErrors, name) {\n var error = plain.getIn(syncErrors, name); // Because the error for this field might not be at a level in the error structure where\n // it can be set directly, it might need to be unwrapped from the _error property\n\n return error && error._error ? error._error : error;\n };\n\n var getSyncWarning = function getSyncWarning(syncWarnings, name) {\n var warning = getIn(syncWarnings, name); // Because the warning for this field might not be at a level in the warning structure where\n // it can be set directly, it might need to be unwrapped from the _warning property\n\n return warning && warning._warning ? warning._warning : warning;\n };\n\n var ConnectedField = /*#__PURE__*/function (_Component) {\n _inheritsLoose(ConnectedField, _Component);\n\n function ConnectedField() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _Component.call.apply(_Component, [this].concat(args)) || this;\n _this.ref = React.createRef();\n\n _this.isPristine = function () {\n return _this.props.pristine;\n };\n\n _this.getValue = function () {\n return _this.props.value;\n };\n\n _this.handleChange = function (event) {\n var _this$props = _this.props,\n name = _this$props.name,\n dispatch = _this$props.dispatch,\n parse = _this$props.parse,\n normalize = _this$props.normalize,\n onChange = _this$props.onChange,\n _reduxForm = _this$props._reduxForm,\n previousValue = _this$props.value;\n var newValue = onChangeValue(event, {\n name: name,\n parse: parse,\n normalize: normalize\n });\n var defaultPrevented = false;\n\n if (onChange) {\n // Can't seem to find a way to extend Event in React Native,\n // thus I simply avoid adding preventDefault() in a RN environment\n // to prevent the following error:\n // `One of the sources for assign has an enumerable key on the prototype chain`\n // Reference: https://github.com/facebook/react-native/issues/5507\n if (!isReactNative && isEvent(event)) {\n onChange(_extends({}, event, {\n preventDefault: function preventDefault() {\n defaultPrevented = true;\n return eventPreventDefault(event);\n }\n }), newValue, previousValue, name);\n } else {\n var onChangeResult = onChange(event, newValue, previousValue, name); // Return value of change handler affecting preventDefault is RN\n // specific behavior.\n\n if (isReactNative) {\n defaultPrevented = onChangeResult;\n }\n }\n }\n\n if (!defaultPrevented) {\n // dispatch change action\n dispatch(_reduxForm.change(name, newValue)); // call post-change callback\n\n if (_reduxForm.asyncValidate) {\n _reduxForm.asyncValidate(name, newValue, 'change');\n }\n }\n };\n\n _this.handleFocus = function (event) {\n var _this$props2 = _this.props,\n name = _this$props2.name,\n dispatch = _this$props2.dispatch,\n onFocus = _this$props2.onFocus,\n _reduxForm = _this$props2._reduxForm;\n var defaultPrevented = false;\n\n if (onFocus) {\n if (!isReactNative) {\n onFocus(_extends({}, event, {\n preventDefault: function preventDefault() {\n defaultPrevented = true;\n return eventPreventDefault(event);\n }\n }), name);\n } else {\n defaultPrevented = onFocus(event, name);\n }\n }\n\n if (!defaultPrevented) {\n dispatch(_reduxForm.focus(name));\n }\n };\n\n _this.handleBlur = function (event) {\n var _this$props3 = _this.props,\n name = _this$props3.name,\n dispatch = _this$props3.dispatch,\n parse = _this$props3.parse,\n normalize = _this$props3.normalize,\n onBlur = _this$props3.onBlur,\n _reduxForm = _this$props3._reduxForm,\n _value = _this$props3._value,\n previousValue = _this$props3.value;\n var newValue = onChangeValue(event, {\n name: name,\n parse: parse,\n normalize: normalize\n }); // for checkbox and radio, if the value property of checkbox or radio equals\n // the value passed by blur event, then fire blur action with previousValue.\n\n if (newValue === _value && _value !== undefined) {\n newValue = previousValue;\n }\n\n var defaultPrevented = false;\n\n if (onBlur) {\n if (!isReactNative) {\n onBlur(_extends({}, event, {\n preventDefault: function preventDefault() {\n defaultPrevented = true;\n return eventPreventDefault(event);\n }\n }), newValue, previousValue, name);\n } else {\n defaultPrevented = onBlur(event, newValue, previousValue, name);\n }\n }\n\n if (!defaultPrevented) {\n // dispatch blur action\n dispatch(_reduxForm.blur(name, newValue)); // call post-blur callback\n\n if (_reduxForm.asyncValidate) {\n _reduxForm.asyncValidate(name, newValue, 'blur');\n }\n }\n };\n\n _this.handleDragStart = function (event) {\n var _this$props4 = _this.props,\n name = _this$props4.name,\n onDragStart = _this$props4.onDragStart,\n value = _this$props4.value;\n eventDataTransferSetData(event, dataKey, value == null ? '' : value);\n\n if (onDragStart) {\n onDragStart(event, name);\n }\n };\n\n _this.handleDrop = function (event) {\n var _this$props5 = _this.props,\n name = _this$props5.name,\n dispatch = _this$props5.dispatch,\n onDrop = _this$props5.onDrop,\n _reduxForm = _this$props5._reduxForm,\n previousValue = _this$props5.value;\n var newValue = eventDataTransferGetData(event, dataKey);\n var defaultPrevented = false;\n\n if (onDrop) {\n onDrop(_extends({}, event, {\n preventDefault: function preventDefault() {\n defaultPrevented = true;\n return eventPreventDefault(event);\n }\n }), newValue, previousValue, name);\n }\n\n if (!defaultPrevented) {\n // dispatch change action\n dispatch(_reduxForm.change(name, newValue));\n eventPreventDefault(event);\n }\n };\n\n return _this;\n }\n\n var _proto = ConnectedField.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n var _this2 = this;\n\n var nextPropsKeys = Object.keys(nextProps);\n var thisPropsKeys = Object.keys(this.props); // if we have children, we MUST update in React 16\n // https://twitter.com/erikras/status/915866544558788608\n\n return !!(this.props.children || nextProps.children || nextPropsKeys.length !== thisPropsKeys.length || nextPropsKeys.some(function (prop) {\n if (~(nextProps.immutableProps || []).indexOf(prop)) {\n return _this2.props[prop] !== nextProps[prop];\n }\n\n return !~propsToNotUpdateFor.indexOf(prop) && !deepEqual(_this2.props[prop], nextProps[prop]);\n }));\n };\n\n _proto.getRenderedComponent = function getRenderedComponent() {\n return this.ref.current;\n };\n\n _proto.render = function render() {\n var _this$props6 = this.props,\n component = _this$props6.component,\n forwardRef = _this$props6.forwardRef,\n name = _this$props6.name,\n _reduxForm = _this$props6._reduxForm,\n normalize = _this$props6.normalize,\n onBlur = _this$props6.onBlur,\n onChange = _this$props6.onChange,\n onFocus = _this$props6.onFocus,\n onDragStart = _this$props6.onDragStart,\n onDrop = _this$props6.onDrop,\n immutableProps = _this$props6.immutableProps,\n rest = _objectWithoutPropertiesLoose(_this$props6, [\"component\", \"forwardRef\", \"name\", \"_reduxForm\", \"normalize\", \"onBlur\", \"onChange\", \"onFocus\", \"onDragStart\", \"onDrop\", \"immutableProps\"]);\n\n var _createFieldProps = createFieldProps(structure, name, _extends({}, rest, {\n form: _reduxForm.form,\n onBlur: this.handleBlur,\n onChange: this.handleChange,\n onDrop: this.handleDrop,\n onDragStart: this.handleDragStart,\n onFocus: this.handleFocus\n })),\n custom = _createFieldProps.custom,\n props = _objectWithoutPropertiesLoose(_createFieldProps, [\"custom\"]);\n\n if (forwardRef) {\n custom.ref = this.ref;\n }\n\n if (typeof component === 'string') {\n var input = props.input,\n meta = props.meta; // eslint-disable-line no-unused-vars\n // flatten input into other props\n\n return createElement(component, _extends({}, input, {}, custom));\n } else {\n return createElement(component, _extends({}, props, {}, custom));\n }\n };\n\n return ConnectedField;\n }(Component);\n\n ConnectedField.propTypes = {\n component: validateComponentProp,\n props: PropTypes.object\n };\n var connector = connect(function (state, ownProps) {\n var name = ownProps.name,\n _ownProps$_reduxForm = ownProps._reduxForm,\n initialValues = _ownProps$_reduxForm.initialValues,\n getFormState = _ownProps$_reduxForm.getFormState;\n var formState = getFormState(state);\n var initialState = getIn(formState, \"initial.\" + name);\n var initial = initialState !== undefined ? initialState : initialValues && getIn(initialValues, name);\n var value = getIn(formState, \"values.\" + name);\n var submitting = getIn(formState, 'submitting');\n var syncError = getSyncError(getIn(formState, 'syncErrors'), name);\n var syncWarning = getSyncWarning(getIn(formState, 'syncWarnings'), name);\n var pristine = deepEqual(value, initial);\n return {\n asyncError: getIn(formState, \"asyncErrors.\" + name),\n asyncValidating: getIn(formState, 'asyncValidating') === name,\n dirty: !pristine,\n pristine: pristine,\n state: getIn(formState, \"fields.\" + name),\n submitError: getIn(formState, \"submitErrors.\" + name),\n submitFailed: getIn(formState, 'submitFailed'),\n submitting: submitting,\n syncError: syncError,\n syncWarning: syncWarning,\n initial: initial,\n value: value,\n _value: ownProps.value // save value passed in (for radios)\n\n };\n }, undefined, undefined, {\n forwardRef: true\n });\n return connector(ConnectedField);\n}\n\nexport default createConnectedField;","import _isEqualWith from \"lodash/isEqualWith\";\n\nvar customizer = function customizer(objectValue, otherValue, indexOrkey, object, other, stack) {\n // https://lodash.com/docs/4.17.4#isEqualWith\n if (stack) {\n // Shallow compares\n // For 1st level, stack === undefined.\n // -> Do nothing (and implicitly return undefined so that it goes to compare 2nd level)\n // For 2nd level and up, stack !== undefined.\n // -> Compare by === operator\n return objectValue === otherValue;\n }\n};\n\nvar shallowCompare = function shallowCompare(instance, nextProps, nextState) {\n var propsEqual = _isEqualWith(instance.props, nextProps, customizer);\n\n var stateEqual = _isEqualWith(instance.state, nextState, customizer);\n\n return !propsEqual || !stateEqual;\n};\n\nexport default shallowCompare;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport React, { Component, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\nimport createConnectedField from './ConnectedField';\nimport shallowCompare from './util/shallowCompare';\nimport prefixName from './util/prefixName';\nimport plain from './structure/plain';\nimport { withReduxForm } from './ReduxFormContext';\nimport validateComponentProp from './util/validateComponentProp';\n\nfunction createField(structure) {\n var ConnectedField = createConnectedField(structure);\n var setIn = structure.setIn;\n\n var Field = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Field, _Component);\n\n function Field(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.ref = React.createRef();\n\n _this.normalize = function (name, value) {\n var normalize = _this.props.normalize;\n\n if (!normalize) {\n return value;\n }\n\n var previousValues = _this.props._reduxForm.getValues();\n\n var previousValue = _this.value;\n var nextValues = setIn(previousValues, name, value);\n return normalize(value, previousValue, nextValues, previousValues, name);\n };\n\n if (!props._reduxForm) {\n throw new Error('Field must be inside a component decorated with reduxForm()');\n }\n\n return _this;\n }\n\n var _proto = Field.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var _this2 = this;\n\n this.props._reduxForm.register(this.name, 'Field', function () {\n return _this2.props.validate;\n }, function () {\n return _this2.props.warn;\n });\n };\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {\n return shallowCompare(this, nextProps, nextState);\n };\n\n _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {\n var oldName = prefixName(this.props, this.props.name);\n var newName = prefixName(nextProps, nextProps.name);\n\n if (oldName !== newName || // use deepEqual here because they could be a function or an array of functions\n !plain.deepEqual(this.props.validate, nextProps.validate) || !plain.deepEqual(this.props.warn, nextProps.warn)) {\n // unregister old name\n this.props._reduxForm.unregister(oldName); // register new name\n\n\n this.props._reduxForm.register(newName, 'Field', function () {\n return nextProps.validate;\n }, function () {\n return nextProps.warn;\n });\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.props._reduxForm.unregister(this.name);\n };\n\n _proto.getRenderedComponent = function getRenderedComponent() {\n invariant(this.props.forwardRef, 'If you want to access getRenderedComponent(), ' + 'you must specify a forwardRef prop to Field');\n return this.ref.current ? this.ref.current.getRenderedComponent() : undefined;\n };\n\n _proto.render = function render() {\n return createElement(ConnectedField, _extends({}, this.props, {\n name: this.name,\n normalize: this.normalize,\n ref: this.ref\n }));\n };\n\n _createClass(Field, [{\n key: \"name\",\n get: function get() {\n return prefixName(this.props, this.props.name);\n }\n }, {\n key: \"dirty\",\n get: function get() {\n return !this.pristine;\n }\n }, {\n key: \"pristine\",\n get: function get() {\n return !!(this.ref.current && this.ref.current.isPristine());\n }\n }, {\n key: \"value\",\n get: function get() {\n return this.ref.current && this.ref.current.getValue();\n }\n }]);\n\n return Field;\n }(Component);\n\n Field.propTypes = {\n name: PropTypes.string.isRequired,\n component: validateComponentProp,\n format: PropTypes.func,\n normalize: PropTypes.func,\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onDragStart: PropTypes.func,\n onDrop: PropTypes.func,\n parse: PropTypes.func,\n props: PropTypes.object,\n validate: PropTypes.oneOfType([PropTypes.func, PropTypes.arrayOf(PropTypes.func)]),\n warn: PropTypes.oneOfType([PropTypes.func, PropTypes.arrayOf(PropTypes.func)]),\n forwardRef: PropTypes.bool,\n immutableProps: PropTypes.arrayOf(PropTypes.string),\n _reduxForm: PropTypes.object\n };\n return withReduxForm(Field);\n}\n\nexport default createField;","import createField from './createField';\nimport plain from './structure/plain';\nexport default createField(plain);","var getErrorKeys = function getErrorKeys(name, type) {\n switch (type) {\n case 'Field':\n return [name, name + \"._error\"];\n\n case 'FieldArray':\n return [name + \"._error\"];\n\n default:\n throw new Error('Unknown field type');\n }\n};\n\nexport default function createHasError(_ref) {\n var getIn = _ref.getIn;\n return function (field, syncErrors, asyncErrors, submitErrors) {\n if (!syncErrors && !asyncErrors && !submitErrors) {\n return false;\n }\n\n var name = getIn(field, 'name');\n var type = getIn(field, 'type');\n return getErrorKeys(name, type).some(function (key) {\n return getIn(syncErrors, key) || getIn(asyncErrors, key) || getIn(submitErrors, key);\n });\n };\n}","import createHasError from '../hasError';\nexport default function createIsValid(structure) {\n var getIn = structure.getIn,\n keys = structure.keys;\n var hasError = createHasError(structure);\n return function (form, getFormState, ignoreSubmitErrors) {\n if (ignoreSubmitErrors === void 0) {\n ignoreSubmitErrors = false;\n }\n\n return function (state) {\n var nonNullGetFormState = getFormState || function (state) {\n return getIn(state, 'form');\n };\n\n var formState = nonNullGetFormState(state);\n var syncError = getIn(formState, form + \".syncError\");\n\n if (syncError) {\n return false;\n }\n\n if (!ignoreSubmitErrors) {\n var error = getIn(formState, form + \".error\");\n\n if (error) {\n return false;\n }\n }\n\n var syncErrors = getIn(formState, form + \".syncErrors\");\n var asyncErrors = getIn(formState, form + \".asyncErrors\");\n var submitErrors = ignoreSubmitErrors ? undefined : getIn(formState, form + \".submitErrors\");\n\n if (!syncErrors && !asyncErrors && !submitErrors) {\n return true;\n }\n\n var registeredFields = getIn(formState, form + \".registeredFields\");\n\n if (!registeredFields) {\n return true;\n }\n\n return !keys(registeredFields).filter(function (name) {\n return getIn(registeredFields, \"['\" + name + \"'].count\") > 0;\n }).some(function (name) {\n return hasError(getIn(registeredFields, \"['\" + name + \"']\"), syncErrors, asyncErrors, submitErrors);\n });\n };\n };\n}","module.exports = isPromise;\nmodule.exports.default = isPromise;\n\nfunction isPromise(obj) {\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n}\n","import isPromise from 'is-promise';\n\nvar asyncValidation = function asyncValidation(fn, start, stop, field) {\n start(field);\n var promise = fn();\n\n if (!isPromise(promise)) {\n throw new Error('asyncValidate function passed to reduxForm must return a promise');\n }\n\n var handleErrors = function handleErrors(rejected) {\n return function (errors) {\n if (rejected) {\n if (errors && Object.keys(errors).length) {\n stop(errors);\n return errors;\n } else {\n stop();\n throw new Error('Asynchronous validation promise was rejected without errors.');\n }\n }\n\n stop();\n return Promise.resolve();\n };\n };\n\n return promise.then(handleErrors(false), handleErrors(true));\n};\n\nexport default asyncValidation;","import isEvent from './isEvent';\n\nvar silenceEvent = function silenceEvent(event) {\n var is = isEvent(event);\n\n if (is) {\n event.preventDefault();\n }\n\n return is;\n};\n\nexport default silenceEvent;","import silenceEvent from './silenceEvent';\n\nvar silenceEvents = function silenceEvents(fn) {\n return function (event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return silenceEvent(event) ? fn.apply(void 0, args) : fn.apply(void 0, [event].concat(args));\n };\n};\n\nexport default silenceEvents;","import plain from './structure/plain';\n\nvar toArray = function toArray(value) {\n return Array.isArray(value) ? value : [value];\n};\n\nvar getError = function getError(value, values, props, validators, name) {\n var array = toArray(validators);\n\n for (var i = 0; i < array.length; i++) {\n var error = array[i](value, values, props, name);\n\n if (error) {\n return error;\n }\n }\n};\n\nexport default function generateValidator(validators, _ref) {\n var getIn = _ref.getIn;\n return function (values, props) {\n var errors = {};\n Object.keys(validators).forEach(function (name) {\n var value = getIn(values, name);\n var error = getError(value, values, props, validators[name], name);\n\n if (error) {\n errors = plain.setIn(errors, name, error);\n }\n });\n return errors;\n };\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport isPromise from 'is-promise';\nimport { isSubmissionError } from './SubmissionError';\n\nvar mergeErrors = function mergeErrors(_ref) {\n var asyncErrors = _ref.asyncErrors,\n syncErrors = _ref.syncErrors;\n return asyncErrors && typeof asyncErrors.merge === 'function' ? asyncErrors.merge(syncErrors).toJS() : _extends({}, asyncErrors, {}, syncErrors);\n};\n\nvar executeSubmit = function executeSubmit(submit, fields, props) {\n var dispatch = props.dispatch,\n submitAsSideEffect = props.submitAsSideEffect,\n onSubmitFail = props.onSubmitFail,\n onSubmitSuccess = props.onSubmitSuccess,\n startSubmit = props.startSubmit,\n stopSubmit = props.stopSubmit,\n setSubmitFailed = props.setSubmitFailed,\n setSubmitSucceeded = props.setSubmitSucceeded,\n values = props.values;\n var result;\n\n try {\n result = submit(values, dispatch, props);\n } catch (submitError) {\n var error = isSubmissionError(submitError) ? submitError.errors : undefined;\n stopSubmit(error);\n setSubmitFailed.apply(void 0, fields);\n\n if (onSubmitFail) {\n onSubmitFail(error, dispatch, submitError, props);\n }\n\n if (error || onSubmitFail) {\n // if you've provided an onSubmitFail callback, don't re-throw the error\n return error;\n } else {\n throw submitError;\n }\n }\n\n if (submitAsSideEffect) {\n if (result) {\n dispatch(result);\n }\n } else {\n if (isPromise(result)) {\n startSubmit();\n return result.then(function (submitResult) {\n stopSubmit();\n setSubmitSucceeded();\n\n if (onSubmitSuccess) {\n onSubmitSuccess(submitResult, dispatch, props);\n }\n\n return submitResult;\n }, function (submitError) {\n var error = isSubmissionError(submitError) ? submitError.errors : undefined;\n stopSubmit(error);\n setSubmitFailed.apply(void 0, fields);\n\n if (onSubmitFail) {\n onSubmitFail(error, dispatch, submitError, props);\n }\n\n if (error || onSubmitFail) {\n // if you've provided an onSubmitFail callback, don't re-throw the error\n return error;\n } else {\n throw submitError;\n }\n });\n } else {\n setSubmitSucceeded();\n\n if (onSubmitSuccess) {\n onSubmitSuccess(result, dispatch, props);\n }\n }\n }\n\n return result;\n};\n\nvar handleSubmit = function handleSubmit(submit, props, valid, asyncValidate, fields) {\n var dispatch = props.dispatch,\n onSubmitFail = props.onSubmitFail,\n setSubmitFailed = props.setSubmitFailed,\n syncErrors = props.syncErrors,\n asyncErrors = props.asyncErrors,\n touch = props.touch,\n persistentSubmitErrors = props.persistentSubmitErrors;\n touch.apply(void 0, fields);\n\n if (valid || persistentSubmitErrors) {\n var asyncValidateResult = asyncValidate && asyncValidate();\n\n if (asyncValidateResult) {\n return asyncValidateResult.then(function (asyncErrors) {\n if (asyncErrors) {\n throw asyncErrors;\n }\n\n return executeSubmit(submit, fields, props);\n })[\"catch\"](function (asyncErrors) {\n setSubmitFailed.apply(void 0, fields);\n\n if (onSubmitFail) {\n onSubmitFail(asyncErrors, dispatch, null, props);\n }\n\n return Promise.reject(asyncErrors);\n });\n } else {\n return executeSubmit(submit, fields, props);\n }\n } else {\n setSubmitFailed.apply(void 0, fields);\n var errors = mergeErrors({\n asyncErrors: asyncErrors,\n syncErrors: syncErrors\n });\n\n if (onSubmitFail) {\n onSubmitFail(errors, dispatch, null, props);\n }\n\n return errors;\n }\n};\n\nexport default handleSubmit;","var getDisplayName = function getDisplayName(Comp) {\n return Comp.displayName || Comp.name || 'Component';\n};\n\nexport default getDisplayName;","var isHotReloading = function isHotReloading() {\n var castModule = module;\n return !!(typeof castModule !== 'undefined' && castModule.hot && typeof castModule.hot.status === 'function' && castModule.hot.status() === 'apply');\n};\n\nexport default isHotReloading;","import _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nimport _merge from \"lodash/merge\";\nimport _mapValues from \"lodash/mapValues\";\nimport hoistStatics from 'hoist-non-react-statics';\nimport invariant from 'invariant';\nimport isPromise from 'is-promise';\nimport PropTypes from 'prop-types';\nimport React, { createElement } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport importedActions from './actions';\nimport asyncValidation from './asyncValidation';\nimport defaultShouldAsyncValidate from './defaultShouldAsyncValidate';\nimport defaultShouldValidate from './defaultShouldValidate';\nimport defaultShouldError from './defaultShouldError';\nimport defaultShouldWarn from './defaultShouldWarn';\nimport silenceEvent from './events/silenceEvent';\nimport silenceEvents from './events/silenceEvents';\nimport generateValidator from './generateValidator';\nimport handleSubmit from './handleSubmit';\nimport createIsValid from './selectors/isValid';\nimport plain from './structure/plain';\nimport getDisplayName from './util/getDisplayName';\nimport isHotReloading from './util/isHotReloading';\nimport { withReduxForm, ReduxFormContext } from './ReduxFormContext';\n\nvar isClassComponent = function isClassComponent(Component) {\n return Boolean(Component && Component.prototype && typeof Component.prototype.isReactComponent === 'object');\n}; // extract field-specific actions\n\n\nvar arrayInsert = importedActions.arrayInsert,\n arrayMove = importedActions.arrayMove,\n arrayPop = importedActions.arrayPop,\n arrayPush = importedActions.arrayPush,\n arrayRemove = importedActions.arrayRemove,\n arrayRemoveAll = importedActions.arrayRemoveAll,\n arrayShift = importedActions.arrayShift,\n arraySplice = importedActions.arraySplice,\n arraySwap = importedActions.arraySwap,\n arrayUnshift = importedActions.arrayUnshift,\n blur = importedActions.blur,\n change = importedActions.change,\n focus = importedActions.focus,\n formActions = _objectWithoutPropertiesLoose(importedActions, [\"arrayInsert\", \"arrayMove\", \"arrayPop\", \"arrayPush\", \"arrayRemove\", \"arrayRemoveAll\", \"arrayShift\", \"arraySplice\", \"arraySwap\", \"arrayUnshift\", \"blur\", \"change\", \"focus\"]);\n\nvar arrayActions = {\n arrayInsert: arrayInsert,\n arrayMove: arrayMove,\n arrayPop: arrayPop,\n arrayPush: arrayPush,\n arrayRemove: arrayRemove,\n arrayRemoveAll: arrayRemoveAll,\n arrayShift: arrayShift,\n arraySplice: arraySplice,\n arraySwap: arraySwap,\n arrayUnshift: arrayUnshift\n};\nvar propsToNotUpdateFor = [].concat(Object.keys(importedActions), ['array', 'asyncErrors', 'initialValues', 'syncErrors', 'syncWarnings', 'values', 'registeredFields']);\n\nvar checkSubmit = function checkSubmit(submit) {\n if (!submit || typeof submit !== 'function') {\n throw new Error('You must either pass handleSubmit() an onSubmit function or pass onSubmit as a prop');\n }\n\n return submit;\n};\n\n/**\n * The decorator that is the main API to redux-form\n */\nexport default function createReduxForm(structure) {\n var deepEqual = structure.deepEqual,\n empty = structure.empty,\n getIn = structure.getIn,\n setIn = structure.setIn,\n keys = structure.keys,\n fromJS = structure.fromJS,\n toJS = structure.toJS;\n var isValid = createIsValid(structure);\n return function (initialConfig) {\n var config = _extends({\n touchOnBlur: true,\n touchOnChange: false,\n persistentSubmitErrors: false,\n destroyOnUnmount: true,\n shouldAsyncValidate: defaultShouldAsyncValidate,\n shouldValidate: defaultShouldValidate,\n shouldError: defaultShouldError,\n shouldWarn: defaultShouldWarn,\n enableReinitialize: false,\n keepDirtyOnReinitialize: false,\n updateUnregisteredFields: false,\n getFormState: function getFormState(state) {\n return getIn(state, 'form');\n },\n pure: true,\n forceUnregisterOnUnmount: false,\n submitAsSideEffect: false\n }, initialConfig);\n\n return function (WrappedComponent) {\n var Form = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Form, _React$Component);\n\n function Form() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.wrapped = React.createRef();\n _this.destroyed = false;\n _this.fieldCounts = {};\n _this.fieldValidators = {};\n _this.lastFieldValidatorKeys = [];\n _this.fieldWarners = {};\n _this.lastFieldWarnerKeys = [];\n _this.innerOnSubmit = undefined;\n _this.submitPromise = undefined;\n\n _this.initIfNeeded = function (nextProps) {\n var enableReinitialize = _this.props.enableReinitialize;\n\n if (nextProps) {\n if ((enableReinitialize || !nextProps.initialized) && !deepEqual(_this.props.initialValues, nextProps.initialValues)) {\n var _keepDirty = nextProps.initialized && _this.props.keepDirtyOnReinitialize;\n\n _this.props.initialize(nextProps.initialValues, _keepDirty, {\n keepValues: nextProps.keepValues,\n lastInitialValues: _this.props.initialValues,\n updateUnregisteredFields: nextProps.updateUnregisteredFields\n });\n }\n } else if (_this.props.initialValues && (!_this.props.initialized || enableReinitialize)) {\n _this.props.initialize(_this.props.initialValues, _this.props.keepDirtyOnReinitialize, {\n keepValues: _this.props.keepValues,\n updateUnregisteredFields: _this.props.updateUnregisteredFields\n });\n }\n };\n\n _this.updateSyncErrorsIfNeeded = function (nextSyncErrors, nextError, lastSyncErrors) {\n var _this$props = _this.props,\n error = _this$props.error,\n updateSyncErrors = _this$props.updateSyncErrors;\n var noErrors = (!lastSyncErrors || !Object.keys(lastSyncErrors).length) && !error;\n var nextNoErrors = (!nextSyncErrors || !Object.keys(nextSyncErrors).length) && !nextError;\n\n if (!(noErrors && nextNoErrors) && (!plain.deepEqual(lastSyncErrors, nextSyncErrors) || !plain.deepEqual(error, nextError))) {\n updateSyncErrors(nextSyncErrors, nextError);\n }\n };\n\n _this.clearSubmitPromiseIfNeeded = function (nextProps) {\n var submitting = _this.props.submitting;\n\n if (_this.submitPromise && submitting && !nextProps.submitting) {\n delete _this.submitPromise;\n }\n };\n\n _this.submitIfNeeded = function (nextProps) {\n var _this$props2 = _this.props,\n clearSubmit = _this$props2.clearSubmit,\n triggerSubmit = _this$props2.triggerSubmit;\n\n if (!triggerSubmit && nextProps.triggerSubmit) {\n clearSubmit();\n\n _this.submit();\n }\n };\n\n _this.shouldErrorFunction = function () {\n var _this$props3 = _this.props,\n shouldValidate = _this$props3.shouldValidate,\n shouldError = _this$props3.shouldError;\n var shouldValidateOverridden = shouldValidate !== defaultShouldValidate;\n var shouldErrorOverridden = shouldError !== defaultShouldError;\n return shouldValidateOverridden && !shouldErrorOverridden ? shouldValidate : shouldError;\n };\n\n _this.validateIfNeeded = function (nextProps) {\n var _this$props4 = _this.props,\n validate = _this$props4.validate,\n values = _this$props4.values;\n\n var shouldError = _this.shouldErrorFunction();\n\n var fieldLevelValidate = _this.generateValidator();\n\n if (validate || fieldLevelValidate) {\n var initialRender = nextProps === undefined;\n var fieldValidatorKeys = Object.keys(_this.getValidators());\n var validateParams = {\n values: values,\n nextProps: nextProps,\n props: _this.props,\n initialRender: initialRender,\n lastFieldValidatorKeys: _this.lastFieldValidatorKeys,\n fieldValidatorKeys: fieldValidatorKeys,\n structure: structure\n };\n\n if (shouldError(validateParams)) {\n var propsToValidate = initialRender || !nextProps ? _this.props : nextProps;\n\n var _merge2 = _merge(validate ? validate(propsToValidate.values, propsToValidate) || {} : {}, fieldLevelValidate ? fieldLevelValidate(propsToValidate.values, propsToValidate) || {} : {}),\n _error = _merge2._error,\n nextSyncErrors = _objectWithoutPropertiesLoose(_merge2, [\"_error\"]);\n\n _this.lastFieldValidatorKeys = fieldValidatorKeys;\n\n _this.updateSyncErrorsIfNeeded(nextSyncErrors, _error, propsToValidate.syncErrors);\n }\n } else {\n _this.lastFieldValidatorKeys = [];\n }\n };\n\n _this.updateSyncWarningsIfNeeded = function (nextSyncWarnings, nextWarning, lastSyncWarnings) {\n var _this$props5 = _this.props,\n warning = _this$props5.warning,\n updateSyncWarnings = _this$props5.updateSyncWarnings;\n var noWarnings = (!lastSyncWarnings || !Object.keys(lastSyncWarnings).length) && !warning;\n var nextNoWarnings = (!nextSyncWarnings || !Object.keys(nextSyncWarnings).length) && !nextWarning;\n\n if (!(noWarnings && nextNoWarnings) && (!plain.deepEqual(lastSyncWarnings, nextSyncWarnings) || !plain.deepEqual(warning, nextWarning))) {\n updateSyncWarnings(nextSyncWarnings, nextWarning);\n }\n };\n\n _this.shouldWarnFunction = function () {\n var _this$props6 = _this.props,\n shouldValidate = _this$props6.shouldValidate,\n shouldWarn = _this$props6.shouldWarn;\n var shouldValidateOverridden = shouldValidate !== defaultShouldValidate;\n var shouldWarnOverridden = shouldWarn !== defaultShouldWarn;\n return shouldValidateOverridden && !shouldWarnOverridden ? shouldValidate : shouldWarn;\n };\n\n _this.warnIfNeeded = function (nextProps) {\n var _this$props7 = _this.props,\n warn = _this$props7.warn,\n values = _this$props7.values;\n\n var shouldWarn = _this.shouldWarnFunction();\n\n var fieldLevelWarn = _this.generateWarner();\n\n if (warn || fieldLevelWarn) {\n var initialRender = nextProps === undefined;\n var fieldWarnerKeys = Object.keys(_this.getWarners());\n var validateParams = {\n values: values,\n nextProps: nextProps,\n props: _this.props,\n initialRender: initialRender,\n lastFieldValidatorKeys: _this.lastFieldWarnerKeys,\n fieldValidatorKeys: fieldWarnerKeys,\n structure: structure\n };\n\n if (shouldWarn(validateParams)) {\n var propsToWarn = initialRender || !nextProps ? _this.props : nextProps;\n\n var _merge3 = _merge(warn ? warn(propsToWarn.values, propsToWarn) : {}, fieldLevelWarn ? fieldLevelWarn(propsToWarn.values, propsToWarn) : {}),\n _warning = _merge3._warning,\n nextSyncWarnings = _objectWithoutPropertiesLoose(_merge3, [\"_warning\"]);\n\n _this.lastFieldWarnerKeys = fieldWarnerKeys;\n\n _this.updateSyncWarningsIfNeeded(nextSyncWarnings, _warning, propsToWarn.syncWarnings);\n }\n }\n };\n\n _this.getValues = function () {\n return _this.props.values;\n };\n\n _this.isValid = function () {\n return _this.props.valid;\n };\n\n _this.isPristine = function () {\n return _this.props.pristine;\n };\n\n _this.register = function (name, type, getValidator, getWarner) {\n var lastCount = _this.fieldCounts[name];\n var nextCount = (lastCount || 0) + 1;\n _this.fieldCounts[name] = nextCount;\n\n _this.props.registerField(name, type);\n\n if (getValidator) {\n _this.fieldValidators[name] = getValidator;\n }\n\n if (getWarner) {\n _this.fieldWarners[name] = getWarner;\n }\n };\n\n _this.unregister = function (name) {\n var lastCount = _this.fieldCounts[name];\n if (lastCount === 1) delete _this.fieldCounts[name];else if (lastCount != null) _this.fieldCounts[name] = lastCount - 1;\n\n if (!_this.destroyed) {\n var _this$props8 = _this.props,\n _destroyOnUnmount = _this$props8.destroyOnUnmount,\n forceUnregisterOnUnmount = _this$props8.forceUnregisterOnUnmount,\n unregisterField = _this$props8.unregisterField;\n\n if (_destroyOnUnmount || forceUnregisterOnUnmount) {\n unregisterField(name, _destroyOnUnmount);\n\n if (!_this.fieldCounts[name]) {\n delete _this.fieldValidators[name];\n delete _this.fieldWarners[name];\n _this.lastFieldValidatorKeys = _this.lastFieldValidatorKeys.filter(function (key) {\n return key !== name;\n });\n }\n } else {\n unregisterField(name, false);\n }\n }\n };\n\n _this.getFieldList = function (options) {\n var registeredFields = _this.props.registeredFields;\n\n if (!registeredFields) {\n return [];\n }\n\n var keySeq = keys(registeredFields);\n\n if (options) {\n if (options.excludeFieldArray) {\n keySeq = keySeq.filter(function (name) {\n return getIn(registeredFields, \"['\" + name + \"'].type\") !== 'FieldArray';\n });\n }\n\n if (options.excludeUnregistered) {\n keySeq = keySeq.filter(function (name) {\n return getIn(registeredFields, \"['\" + name + \"'].count\") !== 0;\n });\n }\n }\n\n return toJS(keySeq);\n };\n\n _this.getValidators = function () {\n var validators = {};\n Object.keys(_this.fieldValidators).forEach(function (name) {\n var validator = _this.fieldValidators[name]();\n\n if (validator) {\n validators[name] = validator;\n }\n });\n return validators;\n };\n\n _this.generateValidator = function () {\n var validators = _this.getValidators();\n\n return Object.keys(validators).length ? generateValidator(validators, structure) : undefined;\n };\n\n _this.getWarners = function () {\n var warners = {};\n Object.keys(_this.fieldWarners).forEach(function (name) {\n var warner = _this.fieldWarners[name]();\n\n if (warner) {\n warners[name] = warner;\n }\n });\n return warners;\n };\n\n _this.generateWarner = function () {\n var warners = _this.getWarners();\n\n return Object.keys(warners).length ? generateValidator(warners, structure) : undefined;\n };\n\n _this.asyncValidate = function (name, value, trigger) {\n var _this$props9 = _this.props,\n asyncBlurFields = _this$props9.asyncBlurFields,\n asyncChangeFields = _this$props9.asyncChangeFields,\n asyncErrors = _this$props9.asyncErrors,\n asyncValidate = _this$props9.asyncValidate,\n dispatch = _this$props9.dispatch,\n initialized = _this$props9.initialized,\n pristine = _this$props9.pristine,\n shouldAsyncValidate = _this$props9.shouldAsyncValidate,\n startAsyncValidation = _this$props9.startAsyncValidation,\n stopAsyncValidation = _this$props9.stopAsyncValidation,\n syncErrors = _this$props9.syncErrors,\n values = _this$props9.values;\n var submitting = !name;\n\n var fieldNeedsValidation = function fieldNeedsValidation() {\n var fieldNeedsValidationForBlur = asyncBlurFields && name && ~asyncBlurFields.indexOf(name.replace(/\\[[0-9]+]/g, '[]'));\n var fieldNeedsValidationForChange = asyncChangeFields && name && ~asyncChangeFields.indexOf(name.replace(/\\[[0-9]+]/g, '[]'));\n var asyncValidateByDefault = !(asyncBlurFields || asyncChangeFields);\n return submitting || asyncValidateByDefault || (trigger === 'blur' ? fieldNeedsValidationForBlur : fieldNeedsValidationForChange);\n };\n\n if (asyncValidate) {\n var valuesToValidate = submitting ? values : setIn(values, name, value);\n var syncValidationPasses = submitting || !getIn(syncErrors, name);\n\n if (fieldNeedsValidation() && shouldAsyncValidate({\n asyncErrors: asyncErrors,\n initialized: initialized,\n trigger: submitting ? 'submit' : trigger,\n blurredField: name,\n pristine: pristine,\n syncValidationPasses: syncValidationPasses\n })) {\n return asyncValidation(function () {\n return asyncValidate(valuesToValidate, dispatch, _this.props, name);\n }, startAsyncValidation, stopAsyncValidation, name);\n }\n }\n };\n\n _this.submitCompleted = function (result) {\n delete _this.submitPromise;\n return result;\n };\n\n _this.submitFailed = function (error) {\n delete _this.submitPromise;\n throw error;\n };\n\n _this.listenToSubmit = function (promise) {\n if (!isPromise(promise)) {\n return promise;\n }\n\n _this.submitPromise = promise;\n return promise.then(_this.submitCompleted, _this.submitFailed);\n };\n\n _this.submit = function (submitOrEvent) {\n var _this$props10 = _this.props,\n onSubmit = _this$props10.onSubmit,\n blur = _this$props10.blur,\n change = _this$props10.change,\n dispatch = _this$props10.dispatch;\n\n if (!submitOrEvent || silenceEvent(submitOrEvent)) {\n // submitOrEvent is an event: fire submit if not already submitting\n if (!_this.submitPromise) {\n // avoid recursive stack trace if use Form with onSubmit as handleSubmit\n if (_this.innerOnSubmit && _this.innerOnSubmit !== _this.submit) {\n // will call \"submitOrEvent is the submit function\" block below\n return _this.innerOnSubmit();\n } else {\n return _this.listenToSubmit(handleSubmit(checkSubmit(onSubmit), _extends({}, _this.props, {}, bindActionCreators({\n blur: blur,\n change: change\n }, dispatch)), // TODO: fix type, should be `Props`\n _this.props.validExceptSubmit, _this.asyncValidate, _this.getFieldList({\n excludeFieldArray: true,\n excludeUnregistered: true\n })));\n }\n }\n } else {\n // submitOrEvent is the submit function: return deferred submit thunk\n return silenceEvents(function () {\n return !_this.submitPromise && _this.listenToSubmit(handleSubmit(checkSubmit(submitOrEvent), _extends({}, _this.props, {}, bindActionCreators({\n blur: blur,\n change: change\n }, dispatch)), // TODO: fix type, should be `Props`\n _this.props.validExceptSubmit, _this.asyncValidate, _this.getFieldList({\n excludeFieldArray: true,\n excludeUnregistered: true\n })));\n });\n }\n };\n\n _this.reset = function () {\n return _this.props.reset();\n };\n\n return _this;\n }\n\n var _proto = Form.prototype;\n\n _proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() {\n if (!isHotReloading()) {\n this.initIfNeeded();\n this.validateIfNeeded();\n this.warnIfNeeded();\n }\n\n invariant(this.props.shouldValidate, 'shouldValidate() is deprecated and will be removed in v9.0.0. Use shouldWarn() or shouldError() instead.');\n };\n\n _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {\n this.initIfNeeded(nextProps);\n this.validateIfNeeded(nextProps);\n this.warnIfNeeded(nextProps);\n this.clearSubmitPromiseIfNeeded(nextProps);\n this.submitIfNeeded(nextProps);\n var onChange = nextProps.onChange,\n values = nextProps.values,\n dispatch = nextProps.dispatch;\n\n if (onChange && !deepEqual(values, this.props.values)) {\n onChange(values, dispatch, nextProps, this.props.values);\n }\n };\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n var _this2 = this;\n\n if (!this.props.pure) return true;\n var _config$immutableProp = config.immutableProps,\n immutableProps = _config$immutableProp === void 0 ? [] : _config$immutableProp; // if we have children, we MUST update in React 16\n // https://twitter.com/erikras/status/915866544558788608\n\n return !!(this.props.children || nextProps.children || Object.keys(nextProps).some(function (prop) {\n // useful to debug rerenders\n // if (!plain.deepEqual(this.props[ prop ], nextProps[ prop ])) {\n // console.info(prop, 'changed', this.props[ prop ], '==>', nextProps[ prop ])\n // }\n if (~immutableProps.indexOf(prop)) {\n return _this2.props[prop] !== nextProps[prop];\n }\n\n return !~propsToNotUpdateFor.indexOf(prop) && !deepEqual(_this2.props[prop], nextProps[prop]);\n }));\n };\n\n _proto.componentDidMount = function componentDidMount() {\n if (!isHotReloading()) {\n this.initIfNeeded(this.props);\n this.validateIfNeeded();\n this.warnIfNeeded();\n }\n\n invariant(this.props.shouldValidate, 'shouldValidate() is deprecated and will be removed in v9.0.0. Use shouldWarn() or shouldError() instead.');\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n var _this$props11 = this.props,\n destroyOnUnmount = _this$props11.destroyOnUnmount,\n destroy = _this$props11.destroy;\n\n if (destroyOnUnmount && !isHotReloading()) {\n this.destroyed = true;\n destroy();\n }\n };\n\n _proto.render = function render() {\n var _ref,\n _this3 = this;\n\n // remove some redux-form config-only props\n\n /* eslint-disable no-unused-vars */\n var _this$props12 = this.props,\n anyTouched = _this$props12.anyTouched,\n array = _this$props12.array,\n arrayInsert = _this$props12.arrayInsert,\n arrayMove = _this$props12.arrayMove,\n arrayPop = _this$props12.arrayPop,\n arrayPush = _this$props12.arrayPush,\n arrayRemove = _this$props12.arrayRemove,\n arrayRemoveAll = _this$props12.arrayRemoveAll,\n arrayShift = _this$props12.arrayShift,\n arraySplice = _this$props12.arraySplice,\n arraySwap = _this$props12.arraySwap,\n arrayUnshift = _this$props12.arrayUnshift,\n asyncErrors = _this$props12.asyncErrors,\n asyncValidate = _this$props12.asyncValidate,\n asyncValidating = _this$props12.asyncValidating,\n blur = _this$props12.blur,\n change = _this$props12.change,\n clearSubmit = _this$props12.clearSubmit,\n destroy = _this$props12.destroy,\n destroyOnUnmount = _this$props12.destroyOnUnmount,\n forceUnregisterOnUnmount = _this$props12.forceUnregisterOnUnmount,\n dirty = _this$props12.dirty,\n dispatch = _this$props12.dispatch,\n enableReinitialize = _this$props12.enableReinitialize,\n error = _this$props12.error,\n focus = _this$props12.focus,\n form = _this$props12.form,\n getFormState = _this$props12.getFormState,\n immutableProps = _this$props12.immutableProps,\n initialize = _this$props12.initialize,\n initialized = _this$props12.initialized,\n initialValues = _this$props12.initialValues,\n invalid = _this$props12.invalid,\n keepDirtyOnReinitialize = _this$props12.keepDirtyOnReinitialize,\n keepValues = _this$props12.keepValues,\n updateUnregisteredFields = _this$props12.updateUnregisteredFields,\n pristine = _this$props12.pristine,\n propNamespace = _this$props12.propNamespace,\n registeredFields = _this$props12.registeredFields,\n registerField = _this$props12.registerField,\n reset = _this$props12.reset,\n resetSection = _this$props12.resetSection,\n setSubmitFailed = _this$props12.setSubmitFailed,\n setSubmitSucceeded = _this$props12.setSubmitSucceeded,\n shouldAsyncValidate = _this$props12.shouldAsyncValidate,\n shouldValidate = _this$props12.shouldValidate,\n shouldError = _this$props12.shouldError,\n shouldWarn = _this$props12.shouldWarn,\n startAsyncValidation = _this$props12.startAsyncValidation,\n startSubmit = _this$props12.startSubmit,\n stopAsyncValidation = _this$props12.stopAsyncValidation,\n stopSubmit = _this$props12.stopSubmit,\n submitAsSideEffect = _this$props12.submitAsSideEffect,\n submitting = _this$props12.submitting,\n submitFailed = _this$props12.submitFailed,\n submitSucceeded = _this$props12.submitSucceeded,\n touch = _this$props12.touch,\n touchOnBlur = _this$props12.touchOnBlur,\n touchOnChange = _this$props12.touchOnChange,\n persistentSubmitErrors = _this$props12.persistentSubmitErrors,\n syncErrors = _this$props12.syncErrors,\n syncWarnings = _this$props12.syncWarnings,\n unregisterField = _this$props12.unregisterField,\n untouch = _this$props12.untouch,\n updateSyncErrors = _this$props12.updateSyncErrors,\n updateSyncWarnings = _this$props12.updateSyncWarnings,\n valid = _this$props12.valid,\n validExceptSubmit = _this$props12.validExceptSubmit,\n values = _this$props12.values,\n warning = _this$props12.warning,\n rest = _objectWithoutPropertiesLoose(_this$props12, [\"anyTouched\", \"array\", \"arrayInsert\", \"arrayMove\", \"arrayPop\", \"arrayPush\", \"arrayRemove\", \"arrayRemoveAll\", \"arrayShift\", \"arraySplice\", \"arraySwap\", \"arrayUnshift\", \"asyncErrors\", \"asyncValidate\", \"asyncValidating\", \"blur\", \"change\", \"clearSubmit\", \"destroy\", \"destroyOnUnmount\", \"forceUnregisterOnUnmount\", \"dirty\", \"dispatch\", \"enableReinitialize\", \"error\", \"focus\", \"form\", \"getFormState\", \"immutableProps\", \"initialize\", \"initialized\", \"initialValues\", \"invalid\", \"keepDirtyOnReinitialize\", \"keepValues\", \"updateUnregisteredFields\", \"pristine\", \"propNamespace\", \"registeredFields\", \"registerField\", \"reset\", \"resetSection\", \"setSubmitFailed\", \"setSubmitSucceeded\", \"shouldAsyncValidate\", \"shouldValidate\", \"shouldError\", \"shouldWarn\", \"startAsyncValidation\", \"startSubmit\", \"stopAsyncValidation\", \"stopSubmit\", \"submitAsSideEffect\", \"submitting\", \"submitFailed\", \"submitSucceeded\", \"touch\", \"touchOnBlur\", \"touchOnChange\", \"persistentSubmitErrors\", \"syncErrors\", \"syncWarnings\", \"unregisterField\", \"untouch\", \"updateSyncErrors\", \"updateSyncWarnings\", \"valid\", \"validExceptSubmit\", \"values\", \"warning\"]);\n /* eslint-enable no-unused-vars */\n\n\n var reduxFormProps = _extends({\n array: array,\n anyTouched: anyTouched,\n asyncValidate: this.asyncValidate,\n asyncValidating: asyncValidating\n }, bindActionCreators({\n blur: blur,\n change: change\n }, dispatch), {\n clearSubmit: clearSubmit,\n destroy: destroy,\n dirty: dirty,\n dispatch: dispatch,\n error: error,\n form: form,\n handleSubmit: this.submit,\n initialize: initialize,\n initialized: initialized,\n initialValues: initialValues,\n invalid: invalid,\n pristine: pristine,\n reset: reset,\n resetSection: resetSection,\n submitting: submitting,\n submitAsSideEffect: submitAsSideEffect,\n submitFailed: submitFailed,\n submitSucceeded: submitSucceeded,\n touch: touch,\n untouch: untouch,\n valid: valid,\n warning: warning\n });\n\n var propsToPass = _extends({}, propNamespace ? (_ref = {}, _ref[propNamespace] = reduxFormProps, _ref) : reduxFormProps, {}, rest);\n\n if (isClassComponent(WrappedComponent)) {\n ;\n propsToPass.ref = this.wrapped;\n }\n\n var _reduxForm = _extends({}, this.props, {\n getFormState: function getFormState(state) {\n return getIn(_this3.props.getFormState(state), _this3.props.form);\n },\n asyncValidate: this.asyncValidate,\n getValues: this.getValues,\n sectionPrefix: undefined,\n register: this.register,\n unregister: this.unregister,\n registerInnerOnSubmit: function registerInnerOnSubmit(innerOnSubmit) {\n return _this3.innerOnSubmit = innerOnSubmit;\n }\n });\n\n return createElement(ReduxFormContext.Provider, {\n value: _reduxForm,\n children: createElement(WrappedComponent, propsToPass)\n });\n };\n\n return Form;\n }(React.Component);\n\n Form.displayName = \"Form(\" + getDisplayName(WrappedComponent) + \")\";\n Form.WrappedComponent = WrappedComponent;\n Form.propTypes = {\n destroyOnUnmount: PropTypes.bool,\n forceUnregisterOnUnmount: PropTypes.bool,\n form: PropTypes.string.isRequired,\n immutableProps: PropTypes.arrayOf(PropTypes.string),\n initialValues: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n getFormState: PropTypes.func,\n onSubmitFail: PropTypes.func,\n onSubmitSuccess: PropTypes.func,\n propNamespace: PropTypes.string,\n validate: PropTypes.func,\n warn: PropTypes.func,\n touchOnBlur: PropTypes.bool,\n touchOnChange: PropTypes.bool,\n triggerSubmit: PropTypes.bool,\n persistentSubmitErrors: PropTypes.bool,\n registeredFields: PropTypes.any\n };\n var connector = connect(function (state, props) {\n var form = props.form,\n getFormState = props.getFormState,\n initialValues = props.initialValues,\n enableReinitialize = props.enableReinitialize,\n keepDirtyOnReinitialize = props.keepDirtyOnReinitialize;\n var formState = getIn(getFormState(state) || empty, form) || empty;\n var stateInitial = getIn(formState, 'initial');\n var initialized = !!stateInitial;\n var shouldUpdateInitialValues = enableReinitialize && initialized && !deepEqual(initialValues, stateInitial);\n var shouldResetValues = shouldUpdateInitialValues && !keepDirtyOnReinitialize;\n var initial = initialValues || stateInitial || empty;\n\n if (!shouldUpdateInitialValues) {\n initial = stateInitial || empty;\n }\n\n var values = getIn(formState, 'values') || initial;\n\n if (shouldResetValues) {\n values = initial;\n }\n\n var pristine = shouldResetValues || deepEqual(initial, values);\n var asyncErrors = getIn(formState, 'asyncErrors');\n var syncErrors = getIn(formState, 'syncErrors') || plain.empty;\n var syncWarnings = getIn(formState, 'syncWarnings') || plain.empty;\n var registeredFields = getIn(formState, 'registeredFields');\n var valid = isValid(form, getFormState, false)(state);\n var validExceptSubmit = isValid(form, getFormState, true)(state);\n var anyTouched = !!getIn(formState, 'anyTouched');\n var submitting = !!getIn(formState, 'submitting');\n var submitFailed = !!getIn(formState, 'submitFailed');\n var submitSucceeded = !!getIn(formState, 'submitSucceeded');\n var error = getIn(formState, 'error');\n var warning = getIn(formState, 'warning');\n var triggerSubmit = getIn(formState, 'triggerSubmit');\n return {\n anyTouched: anyTouched,\n asyncErrors: asyncErrors,\n asyncValidating: getIn(formState, 'asyncValidating') || false,\n dirty: !pristine,\n error: error,\n initialized: initialized,\n invalid: !valid,\n pristine: pristine,\n registeredFields: registeredFields,\n submitting: submitting,\n submitFailed: submitFailed,\n submitSucceeded: submitSucceeded,\n syncErrors: syncErrors,\n syncWarnings: syncWarnings,\n triggerSubmit: triggerSubmit,\n values: values,\n valid: valid,\n validExceptSubmit: validExceptSubmit,\n warning: warning\n };\n }, function (dispatch, initialProps) {\n var bindForm = function bindForm(actionCreator) {\n return actionCreator.bind(null, initialProps.form);\n }; // Bind the first parameter on `props.form`\n\n\n var boundFormACs = _mapValues(formActions, bindForm);\n\n var boundArrayACs = _mapValues(arrayActions, bindForm);\n\n var boundBlur = function boundBlur(field, value) {\n return blur(initialProps.form, field, value, !!initialProps.touchOnBlur);\n };\n\n var boundChange = function boundChange(field, value) {\n return change(initialProps.form, field, value, !!initialProps.touchOnChange, !!initialProps.persistentSubmitErrors);\n };\n\n var boundFocus = bindForm(focus); // Wrap action creators with `dispatch`\n\n var connectedFormACs = bindActionCreators(boundFormACs, dispatch);\n var connectedArrayACs = {\n insert: bindActionCreators(boundArrayACs.arrayInsert, dispatch),\n move: bindActionCreators(boundArrayACs.arrayMove, dispatch),\n pop: bindActionCreators(boundArrayACs.arrayPop, dispatch),\n push: bindActionCreators(boundArrayACs.arrayPush, dispatch),\n remove: bindActionCreators(boundArrayACs.arrayRemove, dispatch),\n removeAll: bindActionCreators(boundArrayACs.arrayRemoveAll, dispatch),\n shift: bindActionCreators(boundArrayACs.arrayShift, dispatch),\n splice: bindActionCreators(boundArrayACs.arraySplice, dispatch),\n swap: bindActionCreators(boundArrayACs.arraySwap, dispatch),\n unshift: bindActionCreators(boundArrayACs.arrayUnshift, dispatch)\n };\n return _extends({}, connectedFormACs, {}, boundArrayACs, {\n blur: boundBlur,\n change: boundChange,\n array: connectedArrayACs,\n focus: boundFocus,\n dispatch: dispatch\n });\n }, undefined, {\n forwardRef: true\n });\n var ConnectedForm = hoistStatics(connector(Form), WrappedComponent);\n ConnectedForm.defaultProps = config; // build outer component to expose instance api\n\n var ReduxForm = /*#__PURE__*/function (_React$Component2) {\n _inheritsLoose(ReduxForm, _React$Component2);\n\n function ReduxForm() {\n var _this4;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this4 = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;\n _this4.ref = React.createRef();\n return _this4;\n }\n\n var _proto2 = ReduxForm.prototype;\n\n _proto2.submit = function submit() {\n return this.ref.current && this.ref.current.submit();\n };\n\n _proto2.reset = function reset() {\n if (this.ref) {\n this.ref.current.reset();\n }\n };\n\n _proto2.render = function render() {\n var _this$props13 = this.props,\n initialValues = _this$props13.initialValues,\n rest = _objectWithoutPropertiesLoose(_this$props13, [\"initialValues\"]);\n\n return createElement(ConnectedForm, _extends({}, rest, {\n ref: this.ref,\n // convert initialValues if need to\n initialValues: fromJS(initialValues)\n }));\n };\n\n _createClass(ReduxForm, [{\n key: \"valid\",\n get: function get() {\n return !!(this.ref.current && this.ref.current.isValid());\n }\n }, {\n key: \"invalid\",\n get: function get() {\n return !this.valid;\n }\n }, {\n key: \"pristine\",\n get: function get() {\n return !!(this.ref.current && this.ref.current.isPristine());\n }\n }, {\n key: \"dirty\",\n get: function get() {\n return !this.pristine;\n }\n }, {\n key: \"values\",\n get: function get() {\n return this.ref.current ? this.ref.current.getValues() : empty;\n }\n }, {\n key: \"fieldList\",\n get: function get() {\n // mainly provided for testing\n return this.ref.current ? this.ref.current.getFieldList() : [];\n }\n }, {\n key: \"wrappedInstance\",\n get: function get() {\n // for testing\n return this.ref.current && this.ref.current.wrapped.current;\n }\n }]);\n\n return ReduxForm;\n }(React.Component);\n\n var WithContext = hoistStatics(withReduxForm(ReduxForm), WrappedComponent);\n WithContext.defaultProps = config;\n return WithContext;\n };\n };\n}","import createReduxForm from './createReduxForm';\nimport plain from './structure/plain';\nexport default createReduxForm(plain);","export const isMobileApp = () => !!window.isMobileApp;\nexport const isNativeMobileApp = () => !!window.isNativeMobileApp;\n","import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport basePickBy from './_basePickBy.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nexport default pickBy;\n","import api from 'src/explore/services/api';\nimport GA, { EVENT_ADD_TO_CART } from 'src/explore/services/ga';\n\nimport { fetch } from '../actions';\n\n// Actions\n\nexport const CREATE = 'cart/cart_items/CREATE';\nexport const CREATE_SUCCESS = 'cart/cart_items/CREATE_SUCCESS';\nexport const CREATE_FAILURE = 'cart/cart_items/CREATE_FAILURE';\n\nexport const UPDATE = 'cart/cart_items/UPDATE';\nexport const UPDATE_SUCCESS = 'cart/cart_items/UPDATE_SUCCESS';\nexport const UPDATE_FAILURE = 'cart/cart_items/UPDATE_FAILURE';\n\nexport const DESTROY = 'cart/cart_items/DESTROY';\nexport const DESTROY_SUCCESS = 'cart/cart_items/DESTROY_SUCCESS';\nexport const DESTROY_FAILURE = 'cart/cart_items/DESTROY_FAILURE';\n\n// Action creators\n\nfunction createSuccess( item ) {\n return { type: CREATE_SUCCESS, payload: item };\n}\n\nfunction createFailure( error ) {\n return { type: CREATE_FAILURE, payload: error };\n}\nexport function create( params ) {\n return ( dispatch ) => {\n dispatch({ type: CREATE });\n\n const request = api.post( 'cart_items', params );\n\n return request\n .then(( response ) => {\n const cartItem = response.data;\n\n dispatch( createSuccess( cartItem ));\n\n // TODO: not sure of a better way to do this\n dispatch( fetch());\n\n // Track analytics\n if ( typeof window.fbq !== 'undefined' ) {\n window.fbq( 'track', 'AddToCart', {\n content_ids: [ cartItem.product.id ],\n content_type: 'product',\n value: cartItem.product.display_price,\n currency: 'USD',\n });\n\n fire_tn_pixel( window, document, 'add_cart', `${cartItem.product.id}` );\n }\n\n window.analytics.track(\n 'Product Added',\n {\n cart_id: cartItem.order_id.toString(),\n ...cartItem.data_for_analytics,\n },\n {\n integrations: {\n All: false,\n 'Google Tag Manager': true,\n 'TikTok Pixel': true,\n 'Facebook Pixel': true,\n 'Pinterest Tag': true,\n Repeater: true,\n },\n }\n );\n GA.trackEvent( EVENT_ADD_TO_CART, {\n product_id: cartItem.product.id,\n });\n })\n .catch(( error ) => {\n if ( error.response ) {\n dispatch( createFailure( error.response.data ));\n }\n });\n };\n}\n\nfunction updateSuccess() {\n return { type: UPDATE_SUCCESS };\n}\n\nfunction updateFailure( error ) {\n return { type: UPDATE_FAILURE, payload: error };\n}\nexport function update( cartItemId, params, egifting = false ) {\n return ( dispatch ) => {\n dispatch({ type: UPDATE });\n\n const request = api.put( `cart_items/${cartItemId}`, params );\n\n return request\n .then(() => {\n dispatch( updateSuccess());\n\n if ( /^\\/buy\\/?/.test( window.location.pathname )) {\n if ( /^\\/buy\\/egifting\\/?/.test( window.location.pathname )) {\n window.location.reload();\n } else {\n window.location.href = '/buy/shipping/edit';\n }\n } else {\n // TODO: not sure of a better way to do this\n dispatch( fetch( egifting ));\n }\n })\n .catch(( error ) => {\n if ( error.response ) {\n dispatch( updateFailure( error.response.data ));\n }\n });\n };\n}\n\nfunction destroySuccess() {\n return { type: DESTROY_SUCCESS };\n}\n\nfunction destroyFailure( error ) {\n return { type: DESTROY_FAILURE, payload: error };\n}\nexport function destroy( cartItemId, egifting = false ) {\n return ( dispatch ) => {\n dispatch({ type: DESTROY });\n\n const request = api.delete( `cart_items/${cartItemId}` );\n\n return request\n .then(( response ) => {\n const cartItem = response.data;\n\n dispatch( destroySuccess());\n\n if ( /^\\/buy\\/?/.test( window.location.pathname )) {\n window.location.reload();\n } else {\n // TODO: not sure of a better way to do this\n dispatch( fetch( egifting ));\n }\n\n window.analytics.track( 'Product Removed', {\n cart_id: cartItem.order_id.toString(),\n ...cartItem.data_for_analytics,\n });\n })\n .catch(( error ) => {\n if ( error.response ) {\n dispatch( destroyFailure( error.response.data ));\n }\n });\n };\n}\n","const redirect = ( to, skipTurbolinks = false ) => new Promise(( resolve ) => setTimeout(() => {\n if ( !skipTurbolinks ) {\n Turbolinks.visit( to );\n } else {\n window.location = to;\n }\n resolve();\n}));\n\nexport default {\n redirect,\n};\n","import React, { Component } from 'react';\n\nimport redirectService from 'src/explore/services/redirect';\n\nclass Redirector extends Component {\n constructor( props ) {\n super( props );\n\n this.redirecting = false;\n }\n\n render() {\n const { to, skipTurbolinks } = this.props;\n\n if ( !!to && !this.redirecting ) {\n this.redirecting = true;\n redirectService.redirect( to, skipTurbolinks ).then(() => {\n this.redirecting = false;\n });\n }\n\n // Empty component\n return null;\n }\n}\n\nexport default Redirector;\n","import React, { Component } from 'react';\n\nimport Redirector from 'src/explore/elements/Redirector';\n\nexport const withRedirector = ( WrappedComponent ) => {\n const componentName = WrappedComponent.displayName || WrappedComponent.name;\n\n class EnhancedComponent extends Component {\n constructor( props ) {\n super( props );\n\n this.state = {};\n\n this.handleRedirect = this.handleRedirect.bind( this );\n }\n\n handleRedirect( to, skipTurbolinks = false ) {\n this.setState({ to, skipTurbolinks });\n }\n\n render() {\n return (\n <>\n \n \n \n );\n }\n }\n\n EnhancedComponent.displayName = `withRedirector(${componentName})`;\n\n return EnhancedComponent;\n};\n","import { getInstance } from '@eppo/js-client-sdk';\n\ntype IAssignment = 'string' | 'boolean' | 'number' | 'integer' | 'JSON';\n\nconst getAssignment = (\n experiment: string,\n assignmentType: IAssignment,\n attributes: { [key: string]: string | boolean | number } = {}\n) => {\n if ( window.eppo?.experimentOverrides[experiment]) {\n return window.eppo.experimentOverrides[experiment];\n }\n\n const subject = String( attributes.id || window.ahoy.getVisitorToken());\n if ( !subject ) return null;\n\n switch ( assignmentType ) {\n case 'boolean':\n return getInstance().getBoolAssignment( experiment, subject, attributes, null );\n case 'number':\n return getInstance().getNumericAssignment( experiment, subject, attributes, null );\n case 'integer':\n return getInstance().getIntegerAssignment( experiment, subject, attributes, null );\n case 'JSON':\n return getInstance().getJSONAssignment( experiment, subject, attributes, null );\n default:\n return getInstance().getStringAssignment( experiment, subject, attributes, null );\n }\n};\n\ninterface IIsExperimentGroup {\n assignmentType?: IAssignment;\n attributes?: { [key: string]: string | boolean | number };\n experiment: string;\n group: string | boolean | number | JSON;\n}\n\nconst isExperimentGroup = ({\n assignmentType,\n attributes = {},\n experiment,\n group,\n}: IIsExperimentGroup ) =>\n getAssignment( experiment, assignmentType || ( typeof group as IAssignment ), attributes ) === group;\n\nexport default {\n getAssignment,\n isExperimentGroup,\n};\n","import React from 'react';\n\nconst Checkout = ({ account, isForPickUp, onCheckout }) => (\n <>\n
\n onCheckout( !!( !account && !isForPickUp ), isForPickUp )}\n >\n Check Out\n \n
\n \n);\n\nexport default Checkout;\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { Field, reduxForm } from 'redux-form';\n\nlet Form = ({ className = '', handleSubmit, pristine, submitting }) => (\n
\n
\n \n \n Add\n \n
\n
\n);\n\nForm = reduxForm({\n form: 'comment', // unique identifier\n})( Form );\n\nconst mapStateToProps = ( state ) => ({\n initialValues: {\n comment: state.data.cart.data.comment ? state.data.cart.data.comment.body : '',\n },\n});\n\nexport default connect( mapStateToProps )( Form );\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport cls from 'classnames';\n\nimport SvgIcon from 'src/explore/elements/SvgIcon';\nimport * as dataActionCreators from 'src/explore/data/cart/comment/actions';\n\nimport Form from './elements/Form';\nimport styles from './index.module.sass';\nimport * as viewActionCreators from './actions';\n\nexport const Comment = ({ comment, open, toggle, addComment }) => {\n const isOpen = !!open;\n\n return (\n \n \n
\n \n {comment ? ' Edit Instructions' : ' Special Instructions'}\n
\n \n \n
\n \n {!isOpen && (\n
\n {comment ? comment.body : 'E.g. allergy or dietary info'}\n
\n )}\n \n );\n};\n\nconst mapStateToProps = ( state ) => ({\n comment: state.data.cart.data.comment,\n open: state.Cart.Comment.open,\n});\n\nconst mapDispatchToProps = {\n addComment: ( params ) => dataActionCreators.create( params ),\n toggle: () => viewActionCreators.toggle(),\n};\n\nexport default connect( mapStateToProps, mapDispatchToProps )( Comment );\n","import api from 'src/explore/services/api';\n\nimport { fetch as fetchCart } from '../actions';\n\n// Actions\n\nexport const DESTROY = 'cart/gift_card_codes/DESTROY';\nexport const DESTROY_SUCCESS = 'cart/gift_card_codes/DESTROY_SUCCESS';\nexport const DESTROY_FAILURE = 'cart/gift_card_codes/DESTROY_FAILURE';\n\n// Action creators\n\nexport function destroySuccess() {\n return { type: DESTROY_SUCCESS };\n}\n\nexport function destroyFailure( error ) {\n return { type: DESTROY_FAILURE, payload: error };\n}\nexport function destroy( code, egifting = false ) {\n return ( dispatch ) => {\n dispatch({ type: DESTROY });\n\n const request = api.delete( `gift_card_codes/${code}` );\n\n return request\n .then(() => {\n dispatch( destroySuccess());\n dispatch( fetchCart( egifting ));\n })\n .catch(( error ) => {\n if ( error.response ) {\n dispatch( destroyFailure( error.response.data ));\n }\n });\n };\n}\n","import React from 'react';\n\nimport { useShopConfig } from 'src/explore/hooks/useShopConfig';\n\nexport const withShopConfig = ( WrappedComponent ) => {\n const componentName = WrappedComponent.displayName || WrappedComponent.name;\n\n const EnhancedComponent = ( props ) => {\n const config = useShopConfig();\n\n return ;\n };\n\n EnhancedComponent.displayName = `withShopConfig(${componentName})`;\n\n return EnhancedComponent;\n};\n","import React from 'react';\n\nimport { ntc } from 'src/explore/services/currency_helper';\n\ninterface DollarsAndCentsProps {\n amountInCents: number;\n className?: {\n cents?: string;\n };\n}\n\nexport const DollarsAndCents = ({ amountInCents, className = {}}: DollarsAndCentsProps ) => (\n <>\n {ntc( amountInCents )\n .split( '.' )\n .map(( text, i ) =>\n i === 0 ? (\n {text}\n ) : (\n \n {`.${text}`}\n \n )\n )}\n \n);\n","import React from 'react';\n\nimport { DollarsAndCents } from 'src/explore/elements/DollarsAndCents';\nimport SvgIcon from 'src/explore/elements/SvgIcon';\n\nimport styles from './index.module.sass';\n\nconst DiscountCode = ({ appliedAmountInCents, code, description, onDelete }) => (\n
\n
{code}
\n\n {description &&
{`(${description})`}
}\n\n
\n {!!appliedAmountInCents && (\n \n )}\n
\n\n
\n \n
\n
\n);\n\nexport default DiscountCode;\n","import React from 'react';\n\nconst requiresHtml = ( message ) => message == 'No products in your cart qualify for this discount.';\nconst containsHelpUrl = ( helpUrl ) => typeof helpUrl !== 'undefined' && helpUrl !== null;\n\nconst getFormatedErrorMessage = ( message, helpUrl ) => {\n const _url = containsHelpUrl( helpUrl )\n ? helpUrl\n : 'https://help.goldbelly.com/hc/en-us/articles/115003609894';\n return (\n
\n {message}{' '}\n \n See Rules\n \n
\n );\n};\n\nconst Error = ({ message, helpUrl }) => (\n
\n {containsHelpUrl( helpUrl ) || requiresHtml( message )\n ? getFormatedErrorMessage( message, helpUrl )\n : message\n }\n
\n);\n\nexport default Error;\n","/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable jsx-a11y/label-has-associated-control */\nimport * as React from 'react';\nimport cls from 'classnames';\n\ninterface Props extends React.HTMLProps {\n className?: string;\n}\n\nexport const Label = React.forwardRef(\n ({ className, ...attributes }, ref ) => (\n